Section SEMAX_PTREE.
Context {cs: compspecs}.

Lemma semax_PTree_field_cast_load_with_hint:
forall {Espec: OracleKind},
forall n Rn Delta sh id P Q R (e: expr) t
T1 T2 GV p_from_e
(t_root: type) (gfs0 gfs1 gfs: list gfield) (p: val)
(v_val : val) (v_reptype : reptype (nested_field_type t_root gfs0)),
local2ptree Q = (T1, T2, nil, GV) ->
typeof_temp Delta id = Some t ->
type_is_by_value (typeof e) = true ->
type_is_volatile (typeof e) = false ->
cast_pointer_to_bool (typeof e) t = false ->
msubst_eval_lvalue Delta T1 T2 GV e = Some p_from_e ->
p_from_e = field_address t_root gfs p ->
typeof e = nested_field_type t_root gfs ->
find_nth_preds (fun Rn => Rn = field_at sh t_root gfs0 v_reptype p /\ gfs = gfs1 ++ gfs0) R (Some (n, Rn)) ->
readable_share sh ->
JMeq (proj_reptype (nested_field_type t_root gfs0) gfs1 v_reptype) v_val ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
local (`(tc_val t (eval_cast (typeof e) t v_val))) ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
tc_lvalue Delta e ->
@semax cs Espec Delta (|> PROPx P (LOCALx Q (SEPx R)))
(Sset id (Ecast e t))
(normal_ret_assert
(PROPx P
(LOCALx (temp id (eval_cast (typeof e) t v_val) :: remove_localdef_temp id Q)
(SEPx R)))).