(* (* originaly, premises are nested_non_volatile, sizeof < modulus, sizeof = sz *)
Hint Extern 1 (data_at_ _ _ _ |-- memory_block _ _ _) =>
(simple apply data_at__memory_block_cancel;
[reflexivity
| rewrite ?sizeof_Tarray by omega;
rewrite ?sizeof_tuchar, ?Z.mul_1_l;simpl;
rep_omega
| try apply f_equal_Int_repr;
rewrite ?sizeof_Tarray by omega;
rewrite ?sizeof_tuchar, ?Z.mul_1_l; simpl; rep_omega
])
: cancel.
Hint Extern 1 (data_at _ _ _ _ |-- memory_block _ _ _) =>
(simple apply data_at_memory_block;
[reflexivity
| rewrite ?sizeof_Tarray by omega;
rewrite ?sizeof_tuchar, ?Z.mul_1_l;simpl;
rep_omega
| try apply f_equal_Int_repr;
rewrite ?sizeof_Tarray by omega;
rewrite ?sizeof_tuchar, ?Z.mul_1_l; simpl; rep_omega
])
: cancel.
*)

Lemma array_at_ramif: forall sh t gfs t0 n a lo hi i v v0 p,
nested_field_type t gfs = Tarray t0 n a ->
lo <= i < hi ->
JMeq v0 (Znth (i - lo) v) ->
array_at sh t gfs lo hi v p |-- field_at sh t (ArraySubsc i :: gfs) v0 p *
(ALL v0: _, ALL v0': _, !! JMeq v0 v0' -->
(field_at sh t (ArraySubsc i :: gfs) v0 p -*
array_at sh t gfs lo hi (upd_Znth (i - lo) v v0') p)).