(* Lemma make_memcpy_correct: forall f dst src ty k e le m b ofs v m', eval_expr ge e le m dst (Vptr b ofs) -> eval_expr ge e le m src v -> assign_loc ty m b ofs v m' -> access_mode ty = By_copy -> step ge (State f (make_memcpy dst src ty) k e le m) E0 (State f Sskip k e le m').  (*Will be needed for builtin: Lemma make_memcpy_correct: forall f dst src ty k e le m b ofs v m', eval_expr ge e le m dst (Vptr b ofs) -> eval_expr ge e le m src v -> assign_loc ty m b ofs v m' -> access_mode ty = By_copy -> CSharpMin_corestep ge (CSharpMin_State f (make_memcpy dst src ty) k e le) m (CSharpMin_State f Sskip k e le) m'. *)
(* Lemma make_memcpy_correct_BuiltinEffect: forall f dst src ty k e le m b ofs v m', eval_expr ge e le m dst (Vptr b ofs) -> eval_expr ge e le m src v -> assign_loc ty m b ofs v m' -> access_mode ty = By_copy -> exists b' ofs', v = Vptr b' ofs' /\ effstep csharpmin_eff_sem ge (BuiltinEffect ge (ef_sig (EF_memcpy (sizeof ty) (alignof_blockcopy ty))) (Vptr b ofs :: Vptr b' ofs' :: nil) m) (CSharpMin_State f (make_memcpy dst src ty) k e le) m (CSharpMin_State f Sskip k e le) m'. *)
(*WILL be needed for builtin Lemma make_memcpy_correct_assignlocEffect: forall f dst src ty k e le m b ofs v m', eval_expr ge e le m dst (Vptr b ofs) -> eval_expr ge e le m src v -> assign_loc ty m b ofs v m' -> access_mode ty = By_copy -> exists b' ofs', v = Vptr b' ofs' /\ effstep csharpmin_eff_sem ge (assign_loc_Effect ty b ofs v) (CSharpMin_State f (make_memcpy dst src ty) k e le) m (CSharpMin_State f Sskip k e le) m'. Lemma make_store_correct: forall addr ty rhs code e le m b ofs v m' f k, make_store addr ty rhs = OK code -> eval_expr ge e le m addr (Vptr b ofs) -> eval_expr ge e le m rhs v -> assign_loc ty m b ofs v m' -> CSharpMin_corestep ge (CSharpMin_State f code k e le) m (CSharpMin_State f Sskip k e le) m'.  Lemma make_store_correct_StoreEffect: forall addr ty rhs code e le m b ofs v m' f k, make_store addr ty rhs = OK code -> eval_expr ge e le m addr (Vptr b ofs) -> eval_expr ge e le m rhs v -> assign_loc ty m b ofs v m' -> match access_mode ty with By_value chunk => effstep csharpmin_eff_sem ge (StoreEffect (Vptr b ofs) (encode_val chunk v)) (CSharpMin_State f code k e le) m (CSharpMin_State f Sskip k e le) m' | By_copy => True (*WILL be needed for builtin: exists b' ofs', v = Vptr b' ofs' /\ effstep csharpmin_eff_sem ge (BuiltinEffect ge (ef_sig (EF_memcpy (sizeof ty) (alignof_blockcopy ty))) (Vptr b ofs :: Vptr b' ofs' :: nil) m) (CSharpMin_State f code k e le) m (CSharpMin_State f Sskip k e le) m'*)
| _ => False
end.

(* Specifications: *)
Lemma make_store_correct_AssignlocEffect:
forall addr ty rhs code e le m b ofs v m' f k,
make_store addr ty rhs = OK code ->
eval_expr ge e le m addr (Vptr b ofs) ->
eval_expr ge e le m rhs v ->
assign_loc ty m b ofs v m' ->
effstep csharpmin_eff_sem ge
(assign_loc_Effect ty b ofs v)
(CSharpMin_State f code k e le) m
(CSharpMin_State f Sskip k e le) m'.