Local Open Scope logic.
Section SEMAX_SC.
Context {cs: compspecs}.

Lemma semax_SC_field_cast_load:
forall {Espec: OracleKind} n (Delta: tycontext) sh id P Q R e1 t
t_root gfs0 gfs1 gfs (p v_val: val) (v_reptype: reptype (nested_field_type t_root gfs0)),
typeof e1 = nested_field_type t_root gfs ->
typeof_temp Delta id = Some t ->
type_is_by_value (nested_field_type t_root gfs) = true ->
cast_pointer_to_bool (nested_field_type t_root gfs) t = false ->
type_is_volatile (nested_field_type t_root gfs) = false ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
local (`(eq (field_address t_root gfs p)) (eval_lvalue e1)) ->
nth_error R n = Some (field_at sh t_root gfs0 v_reptype p) ->
gfs = gfs1 ++ gfs0 ->
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)) |--
(tc_lvalue Delta e1) && local (`(tc_val t (eval_cast (nested_field_type t_root gfs) t v_val))) ->
@semax cs Espec Delta (|> PROPx P (LOCALx Q (SEPx R)))
(Sset id (Ecast e1 t))
(normal_ret_assert
(PROPx P
(LOCALx (temp id (eval_cast (nested_field_type t_root gfs) t v_val) :: remove_localdef_temp id Q)
(SEPx R)))).