(********************************************  Max length gfs field_at load store: semax_max_path_field_load_nth_ram. semax_max_path_field_cast_load_nth_ram. semax_max_path_field_store_nth_ram.  ********************************************)
Section LOADSTORE_FIELD_AT.
Context {cs: compspecs}.

(* TODO: delete it *)
Lemma semax_max_path_field_load_nth_ram':
forall {Espec: OracleKind},
forall n Delta sh id P Q R (e: expr) Pre
(t t_root: type) (gfs: list gfield)
(p v : val) (v' : reptype (nested_field_type t_root gfs)),
typeof_temp Delta id = Some t ->
is_neutral_cast (typeof e) t = true ->
typeof e = nested_field_type t_root gfs ->
readable_share sh ->
type_is_volatile (typeof e) = false ->
JMeq v' v ->
nth_error R n = Some Pre ->
Pre |-- field_at sh t_root gfs v' p * TT ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
local (`(eq (field_address t_root gfs p)) (eval_lvalue e)) ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
(tc_lvalue Delta e) &&
local `(tc_val (typeof e) v) ->
semax Delta (|>PROPx P (LOCALx Q (SEPx R)))
(Sset id e)
(normal_ret_assert
(PROPx P
(LOCALx (temp id v :: remove_localdef_temp id Q)
(SEPx R)))).