(** Semantic preservation for expressions. *)
Section EXPRESSIONS.
Variable cunit: Cminor.program.
Variable hf: helper_functions.
Hypothesis LINK: linkorder cunit prog.
Hypothesis HF: helper_functions_declared cunit hf.

(* Specifications: *)
Lemma sel_expr_correct:
forall sp e m a v,
Cminor.eval_expr ge sp e m a v ->
forall e' le m',
env_lessdef e e' -> Mem.extends m m' ->
exists v', eval_expr tge sp e' m' le (sel_expr a) v' /\ Val.lessdef v v'.
Lemma sel_exprlist_correct:
forall sp e m a v,
Cminor.eval_exprlist ge sp e m a v ->
forall e' le m',
env_lessdef e e' -> Mem.extends m m' ->
exists v', eval_exprlist tge sp e' m' le (sel_exprlist a) v' /\ Val.lessdef_list v v'.
Lemma sel_builtin_arg_correct:
forall sp e e' m m' a v c,
env_lessdef e e' -> Mem.extends m m' ->
Cminor.eval_expr ge sp e m a v ->
exists v',
CminorSel.eval_builtin_arg tge sp e' m' (sel_builtin_arg a c) v'
/\ Val.lessdef v v'.
Lemma sel_builtin_args_correct:
forall sp e e' m m',
env_lessdef e e' -> Mem.extends m m' ->
forall al vl,
Cminor.eval_exprlist ge sp e m al vl ->
forall cl,
exists vl',
list_forall2 (CminorSel.eval_builtin_arg tge sp e' m')
(sel_builtin_args al cl)
vl'
/\ Val.lessdef_list vl vl'.
Lemma sel_builtin_res_correct:
forall oid v e v' e',
env_lessdef e e' -> Val.lessdef v v' ->
env_lessdef (set_optvar oid v e) (set_builtin_res (sel_builtin_res oid) v' e').