(** * Semantic preservation *)
Section SOUNDNESS.
Variable p: program.
Variable tp: program.
Variable used: IS.t.
Hypothesis USED_VALID: valid_used_set p used.
Hypothesis TRANSF: match_prog_1 used p tp.
Let ge := Genv.globalenv p.
Let tge := Genv.globalenv tp.
Let pm := prog_defmap p.
Definition kept (id: ident) : Prop := IS.In id used.

(* Specifications: *)
Lemma kept_closed:
forall id gd id',
kept id -> pm!id = Some gd -> ref_def gd id' -> kept id'.
Lemma kept_main:
kept p.(prog_main).
Lemma kept_public:
forall id, In id p.(prog_public) -> kept id.