Section PRESERVATION.
Variable prog: program.
Variable tprog: program.
Hypothesis TRANSL: match_prog prog tprog.
Let ge := Genv.globalenv prog.
Let tge := Genv.globalenv tprog.
(** * Correctness of the code transformation *)
(** We now show that the transformed code after constant propagation has the same semantics as the original code. *)
Proof (Genv.find_symbol_match TRANSL).
Proof (Genv.senv_match TRANSL).

Lemma transf_ros_correct:
forall bc rs ae ros f rs',
genv_match bc ge ->
ematch bc rs ae ->
find_function ge ros rs = Some f ->
regs_lessdef rs rs' ->
exists cunit,
find_function tge (transf_ros ae ros) rs' = Some (transf_fundef (romem_for cunit) f)
/\ linkorder cunit prog.