Section CORRECTNESS.
Variable prog: Clight.program.
Variable tprog: Csharpminor.program.
Hypothesis TRANSL: match_prog prog tprog.
Let ge := globalenv prog.
Let tge := Genv.globalenv tprog.
Proof (Genv.find_symbol_match TRANSL).
Proof (Genv.senv_match TRANSL).
Proof (Genv.find_funct_ptr_match TRANSL).
Proof (Genv.find_funct_match TRANSL).
(** * Matching between environments *)
(** In this section, we define a matching relation between a Clight local environment and a Csharpminor local environment. *)
Record match_env (e: Clight.env) (te: Csharpminor.env) : Prop :=
mk_match_env {
me_local:
forall id b ty,
e!id = Some (b, ty) -> te!id = Some(b, Ctypes.sizeof ge ty);
me_local_inv:
forall id b sz,
te!id = Some (b, sz) -> exists ty, e!id = Some(b, ty)
}.

Lemma match_env_same_blocks:
forall e te,
match_env e te ->
blocks_of_env te = Clight.blocks_of_env ge e.