Local Open Scope logic.
Require Export mc_reify.reify.
Require Export MirrorCore.RTac.Repeat.
Require Export MirrorCore.RTac.Try.
Require Export MirrorCore.RTac.First.
Require Export mc_reify.funcs.
Require Export mc_reify.reflexivity_tacs.
Definition set_lemma (temp : PTree.t (type * bool)) (var : PTree.t type)
(ret : type) (gt : PTree.t type) (id : ident)
(e : Clight.expr) (ty : type): my_lemma.
reify_lemma reify_vst (semax_set_localD temp var ret gt id e ty).
Defined.
Definition load_lemma (temp : PTree.t (type * bool)) (var : PTree.t type)
(ret : type) (gt : PTree.t type) (id : ident) (t t_root : type) (e0 e1 : Clight.expr)
(efs: list efield) (tts : list type) (e : type_id_env) (lr : LLRR)
(n: nat): my_lemma.
reify_lemma reify_vst (semax_load_localD temp var ret gt id t t_root e0 e1 efs tts e lr n).
Defined.

Lemma semax_store_localD:
forall (temp : PTree.t (type * bool)) (var : PTree.t type)
(ret : type) (gt : PTree.t type) (t t_root : type) (e0 e1 e2: Clight.expr)
(efs : list efield) (tts : list type)
(e : type_id_env) (lr : LLRR) (n: nat)
sh P T1 T2 R gs Post
(gfs: list gfield)
(p p': val) (v0: val) (v': reptype t_root),
forall {Espec: OracleKind},
typeof (nested_efield e1 efs tts) = t ->
type_is_by_value t = true ->
tc_LR_b_norho (mk_tycontext temp var ret gt gs) e1 lr = true ->
tc_LR_b_norho (mk_tycontext temp var ret gt gs) (Ecast e2 (typeof (nested_efield e1 efs tts))) RRRR = true ->
tc_efield_b_norho (mk_tycontext temp var ret gt gs) efs = true ->
msubst_efield_denote T1 T2 efs = Some gfs ->
msubst_eval_LR T1 T2 e1 lr = Some p ->
msubst_eval_LR T1 T2 (Ecast e2 t) RRRR = Some v0 ->
legal_nested_efield e t_root e1 gfs tts lr = true ->
(@eq (option mpred)) (nth_error R n) (Some (data_at sh t_root v' p')) ->
(forall rho,
!!(tc_environ (mk_tycontext temp var ret gt gs) rho) && (assertD P (localD T1 T2) R rho) |-- !! (p = p')) ->
(forall rho,
!! (tc_environ (mk_tycontext temp var ret gt gs) rho) && (assertD P (localD T1 T2) R rho) |--
!! (legal_nested_field t_root gfs)) ->
(assertD P (localD T1 T2)
(replace_nth n R
(data_at sh t_root
(upd_val t_root gfs v' v0) p))) = Post -> (* need to add replace_nth *)
writable_share sh ->
nested_efield e1 efs tts = e0 ->
semax (mk_tycontext temp var ret gt gs) (|>assertD P (localD T1 T2) R)
(Sassign e0 e2)
(normal_ret_assert Post).