(* Lemma set_locals_lessdef: forall e1 e2, env_lessdef e1 e2 -> forall il, env_lessdef (set_locals il e1) (set_locals il e2). Lemma set_locals_inject: forall j e1 e2, env_inject j e1 e2 -> forall il, env_inject j (set_locals il e1) (set_locals il e2).  Lemma lessdef_inject: forall v j (Hv: forall b1, getBlocks (v::nil) b1 = true -> j b1 = Some(b1,0)) v' (LD: Val.lessdef v v'), val_inject j v v'. (* Lemma inject_lessdef: forall v j (Hv: forall b1, getBlocks (v::nil) b1 = true -> j b1 = Some(b1,0)) v' (INJ: val_inject j v v'), Val.lessdef v v'. *)
(** Semantic preservation for expressions. *)
(*NEW*)
Definition sp_preserved (j:meminj) (sp sp':val) :=
exists b i b', sp = Vptr b i /\ sp' = Vptr b' i /\
j b = Some(b',0).

Lemma sel_expr_inject:
forall sp e m a v,
Cminor.eval_expr ge sp e m a v ->
forall j e' le m',
env_inject j e e' -> Mem.inject j m m' ->
forall (PG: meminj_preserves_globals ge j)
(GD: genvs_domain_eq ge tge)
(NoRepet: list_norepet (map fst (prog_defs prog)))
sp' (SP: sp_preserved j sp sp'),
exists v', CminorSel.eval_expr tge sp' e' m' le (sel_expr hf a) v' /\
val_inject j v v'.