End ANALYSIS.
(** Properties of the elimination of unused global definitions. *)
Section TRANSFORMATION.
Variable p: program.
Variable used: IS.t.
Let add_def (m: prog_map) idg := PTree.set (fst idg) (snd idg) m.
Remark filter_globdefs_accu:
forall defs accu1 accu2 u,
filter_globdefs u (accu1 ++ accu2) defs = filter_globdefs u accu1 defs ++ accu2.
Remark filter_globdefs_nil:
forall u accu defs,
filter_globdefs u accu defs = filter_globdefs u nil defs ++ accu.

(* Specifications: *)
Lemma filter_globdefs_map_1:
forall id l u m1,
IS.mem id u = false ->
m1!id = None ->
(fold_left add_def (filter_globdefs u nil l) m1)!id = None.
Lemma filter_globdefs_map_2:
forall id l u m1 m2,
IS.mem id u = true ->
m1!id = m2!id ->
(fold_left add_def (filter_globdefs u nil l) m1)!id = (fold_left add_def (List.rev l) m2)!id.
Lemma filter_globdefs_map:
forall id u defs,
(PTree_Properties.of_list (filter_globdefs u nil (List.rev defs)))! id =
if IS.mem id u then (PTree_Properties.of_list defs)!id else None.
Lemma filter_globdefs_domain:
forall id l u,
In id (map fst (filter_globdefs u nil l)) -> IS.In id u /\ In id (map fst l).
Lemma filter_globdefs_unique_names:
forall l u, list_norepet (map fst (filter_globdefs u nil l)).