(***************************************  Load/store lemmas about mapsto: semax_load_nth_ram. semax_cast_load_nth_ram. semax_store_nth_ram.  ***************************************)

Lemma semax_cast_load_nth_ram :
forall {Espec: OracleKind}{cs: compspecs} n (Delta: tycontext) sh id P Q R e1 Pre t1 t2 v p,
typeof e1 = t1 ->
typeof_temp Delta id = Some t2 ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
local (`(eq p) (eval_lvalue e1)) ->
nth_error R n = Some Pre ->
cast_pointer_to_bool t1 t2 = false ->
readable_share sh ->
Pre |-- mapsto sh t1 p v * TT ->
ENTAIL Delta, PROPx P (LOCALx Q (SEPx R)) |--
(tc_lvalue Delta e1) && local (`(tc_val t2 (eval_cast t1 t2 v))) ->
@semax cs Espec Delta (|> PROPx P (LOCALx Q (SEPx R)))
(Sset id (Ecast e1 t2))
(normal_ret_assert
(PROPx P
(LOCALx (temp id (eval_cast t1 t2 v) :: remove_localdef_temp id Q)
(SEPx R)))).