(* (* 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.
*)

(* Specifications: *)
Lemma array_at_array_at_: forall sh t gfs lo hi v p,
array_at sh t gfs lo hi v p |-- array_at_ sh t gfs lo hi p.
Lemma withspacer_field_at__Tunion: forall sh t gfs i id a p,
nested_field_type t gfs = Tunion id a ->
in_members i (co_members (get_co id)) ->
withspacer sh
(nested_field_offset t gfs +
sizeof (field_type i (co_members (get_co id))))
(nested_field_offset t gfs + sizeof (nested_field_type t gfs))
(field_at_ sh t (gfs UDOT i)) p =
memory_block sh (sizeof (nested_field_type t gfs)) (field_address t gfs p).
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)).