(** The assignment of function arguments to local variables (on the Cminor side) and pseudo-registers (on the RTL side) preserves matching between environments. *)

(* Specifications: *)
Lemma match_set_params_init_regs:
forall j il rl s1 map2 s2 vl tvl i,
add_vars init_mapping il s1 = OK (rl, map2) s2 i ->
val_list_inject j vl tvl ->
match_env j map2 (set_params vl il) nil (init_regs tvl rl)
/\ (forall r, reg_fresh r s2 -> (init_regs tvl rl)#r = Vundef).
Lemma match_set_locals:
forall j map1 s1,
map_wf map1 ->
forall il rl map2 s2 e le rs i,
match_env j map1 e le rs ->
(forall r, reg_fresh r s1 -> rs#r = Vundef) ->
add_vars map1 il s1 = OK (rl, map2) s2 i ->
match_env j map2 (set_locals il e) le rs.
Lemma match_init_env_init_reg:
forall j params s0 rparams map1 s1 i1 vars rvars map2 s2 i2 vparams tvparams,
add_vars init_mapping params s0 = OK (rparams, map1) s1 i1 ->
add_vars map1 vars s1 = OK (rvars, map2) s2 i2 ->
val_list_inject j vparams tvparams ->
match_env j map2 (set_locals vars (set_params vparams params))
nil (init_regs tvparams rparams).