Section SEMAX_PTREE.
Context {cs: compspecs}.

Lemma semax_PTree_field_store_with_hint:
forall {Espec: OracleKind},
forall n Rn Delta sh P Q R (e1 e2 : expr)
T1 T2 GV p_from_e
(t_root: type) (gfs0 gfs1 gfs: list gfield) (p: val)
(v0: reptype (nested_field_type (nested_field_type t_root gfs0) gfs1))
(v0_val: val) Rv (v v_new: reptype (nested_field_type t_root gfs0)),
local2ptree Q = (T1, T2, nil, GV) ->
type_is_by_value (typeof e1) = true ->
type_is_volatile (typeof e1) = false ->
msubst_eval_expr Delta T1 T2 GV (Ecast e2 (typeof e1)) = Some v0_val ->
msubst_eval_lvalue Delta T1 T2 GV e1 = Some p_from_e ->
p_from_e = field_address t_root gfs p ->
typeof e1 = nested_field_type t_root gfs ->
find_nth_preds (fun Rn => (Rn = Rv v /\ (Rv = fun v => field_at sh t_root gfs0 v p)) /\ gfs = gfs1 ++ gfs0) R (Some (n, Rn)) ->
writable_share sh ->
JMeq v0_val v0 ->
data_equal (upd_reptype (nested_field_type t_root gfs0) gfs1 v v0) v_new ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
denote_tc_assert
(tc_andp (typecheck_lvalue Delta e1) (typecheck_expr Delta (Ecast e2 (typeof e1)))) ->
semax Delta (|>PROPx P (LOCALx Q (SEPx R)))
(Sassign e1 e2)
(normal_ret_assert
(PROPx P
(LOCALx Q
(SEPx
(replace_nth n R
(field_at sh t_root gfs0 v_new p)))))).