Definition halt_match c m d tm :=
  exists rv trv,
    halted source c = Some rv
    /\ halted target d = Some trv
    /\ P rv m
    /\ P trv tm.

(* Specifications: *)
Lemma corestep_ord': forall cd j, match_state cd j c m d tm -> halt_match c m d tm \/ (exists cd' j' c' m', corestep_plus source geS c m c' m' /\ ((match_state cd' j' c' m' d tm /\ halt_match c' m' d tm) \/ (exists d' tm', corestep_plus target geT d tm d' tm' /\ match_state cd' j' c' m' d' tm'))).
Lemma termination_preservation: forall cd j c' m' rv1, match_state cd j c m d tm -> corestep_star source geS c m c' m' -> halted source c' = Some rv1 -> exists d' tm' rv2, corestep_star target geT d tm d' tm' /\ halted target d' = Some rv2.
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).