(** * Properties of node enumeration *)
(** An enumeration of CFG nodes is correct if the following conditions hold: - All nodes for reachable basic blocks must be in the list. - The list is without repetition (so that no code duplication occurs).  We prove that the result of the [enumerate] function satisfies both conditions. *)

(* Specifications: *)
Lemma nodeset_of_list_correct:
forall l s s',
nodeset_of_list l s = OK s' ->
list_norepet l
/\ (forall pc, Nodeset.In pc s' <-> Nodeset.In pc s \/ In pc l)
/\ (forall pc, In pc l -> ~Nodeset.In pc s).
Lemma check_reachable_correct:
forall f reach s pc i,
check_reachable f reach s = true ->
f.(LTL.fn_code)!pc = Some i ->
reach!!pc = true ->
Nodeset.In pc s.
Lemma enumerate_complete:
forall f enum pc i,
enumerate f = OK enum ->
f.(LTL.fn_code)!pc = Some i ->
(reachable f)!!pc = true ->
In pc enum.
Lemma enumerate_norepet:
forall f enum,
enumerate f = OK enum ->
list_norepet enum.