(** * Relational specification of instruction selection *)

Definition match_fundef (cunit: Cminor.program) (f: Cminor.fundef) (tf: CminorSel.fundef) : Prop :=
  exists hf, helper_functions_declared cunit hf /\ sel_fundef (prog_defmap cunit) hf f = OK tf.Definition match_prog (p: Cminor.program) (tp: CminorSel.program) :=
  match_program match_fundef eq p tp.

Lemma eval_store: forall chunk a1 a2 v1 v2 f k m', eval_expr tge sp e m nil a1 v1 -> eval_expr tge sp e m nil a2 v2 -> Mem.storev chunk m v1 v2 = Some m' -> step tge (State f (store chunk a1 a2) k sp e m) E0 (State f Sskip k sp e m').