(** Evaluation of expressions *)
Section EVAL_EXPR.
Variables e te: env.
Variables le tle: temp_env.
Variables m tm: mem.
Variable f: meminj.
Variable cenv: compilenv.
Variables lo hi tlo thi: block.
Hypothesis MATCH: match_envs f cenv e le m lo hi te tle tlo thi.
Hypothesis MEMINJ: Mem.inject f m tm.
Hypothesis GLOB: exists bound, match_globalenvs f bound.

(* Specifications: *)
Lemma typeof_simpl_expr:
forall a, typeof (simpl_expr cenv a) = typeof a.
Lemma deref_loc_inject:
forall ty loc ofs v loc' ofs',
deref_loc ty m loc ofs v ->
Val.inject f (Vptr loc ofs) (Vptr loc' ofs') ->
exists tv, deref_loc ty tm loc' ofs' tv /\ Val.inject f v tv.
Lemma eval_simpl_expr:
forall a v,
eval_expr ge e le m a v ->
compat_cenv (addr_taken_expr a) cenv ->
exists tv, eval_expr tge te tle tm (simpl_expr cenv a) tv /\ Val.inject f v tv
with eval_simpl_lvalue:
forall a b ofs,
eval_lvalue ge e le m a b ofs ->
compat_cenv (addr_taken_expr a) cenv ->
match a with Evar id ty => VSet.mem id cenv = false | _ => True end ->
exists b', exists ofs', eval_lvalue tge te tle tm (simpl_expr cenv a) b' ofs' /\ Val.inject f (Vptr b ofs) (Vptr b' ofs').
Lemma eval_simpl_exprlist:
forall al tyl vl,
eval_exprlist ge e le m al tyl vl ->
compat_cenv (addr_taken_exprlist al) cenv ->
val_casted_list vl tyl /\
exists tvl,
eval_exprlist tge te tle tm (simpl_exprlist cenv al) tyl tvl
/\ Val.inject_list f vl tvl.