End termination_preservation.
Local Open Scope nat_scope.
(** ** Safety & semantics preservation *)
Section safety_preservation.
Variables F V TF TV C D Z data : Type.
Variable source : CoreSemantics (Genv.t F V) C mem.
Variable target : CoreSemantics (Genv.t TF TV) D mem.
Variable match_state : data -> meminj -> C -> mem -> D -> mem -> Prop.
Variable ord : data -> data -> Prop.
Variable geS : Genv.t F V.
Variable geT : (Genv.t TF TV).
Variable entry_points : list (val*val*signature).
Variable (SRC_DET : corestep_fun source).
Variable (TGT_DET : corestep_fun target).

(* Specifications: *)
Lemma safety_preservation:
forall
(sim : Forward_simulation_inject source target geS geT entry_points data match_state ord)
(c : C)
(d : D)
(m : mem)
(tm: mem)
(P : val -> mem -> Prop)
(P_good : forall j v tv m tm, val_inject j v tv -> Mem.inject j m tm -> P v m -> P tv tm)
(MATCH : exists (cd: data) (j: meminj), match_state cd j c m d tm)
(source_safe : forall n, safeN source geS P n c m),
forall n, safeN target geT P n d tm.
Lemma halted_safe:
forall c m c' m' (P: val -> mem -> Prop) rv,
corestep_star source geS c m c' m' ->
halted source c = Some rv ->
P rv m' ->
(forall n, safeN source geS P n c m).