Section CORRECTNESS.
Variable prog: CminorSel.program.
Variable tprog: RTL.program.
Hypothesis TRANSL: transl_program prog = OK tprog.
Let ge : CminorSel.genv := Genv.globalenv prog.
Let tge : RTL.genv := Genv.globalenv tprog.
(** Relationship between the global environments for the original CminorSel program and the generated RTL program. *)
Proof
(Genv.find_symbol_transf_partial transl_fundef _ TRANSL).
Proof
(Genv.find_funct_ptr_transf_partial transl_fundef _ TRANSL).
Proof
(Genv.find_funct_transf_partial transl_fundef _ TRANSL).
Proof
(Genv.find_var_info_transf_partial transl_fundef _ TRANSL).
(*LENB: GFP as in selectionproofEFF*)
Definition globalfunction_ptr_inject (j:meminj):=
forall b f, Genv.find_funct_ptr ge b = Some f ->
j b = Some(b,0) /\ isGlobalBlock ge b = true.
(*From Cminorgenproof*)
Remark val_inject_function_pointer:
forall v fd j tv,
Genv.find_funct ge v = Some fd ->
globalfunction_ptr_inject j ->
val_inject j v tv ->
tv = v.
(** Correctness of the code generated by [add_move]. *)
(** Correctness of the translation of [switch] statements *)

Lemma transl_switch_correct:
forall j cs sp e m f map r nexits t ns,
tr_switch f.(fn_code) map r nexits t ns ->
forall rs i act,
rs#r = Vint i ->
map_wf map ->
match_env j map e nil rs ->
comptree_match i t = Some act ->
exists nd, exists rs',
corestep_star rtl_eff_sem  tge (RTL_State cs f sp ns rs) m (RTL_State cs f sp nd rs') m /\
nth_error nexits act = Some nd /\
match_env j map e nil rs'.