Hint Resolve field_compatible0_ArraySubsc0 : field_compatible.
Hint Extern 2 (legal_nested_field0 _ _) =>
(apply compute_legal_nested_field0_spec'; repeat constructor; omega) : field_compatible.
Hint Extern 2 (field_compatible0 _ _ (offset_val _ _)) =>
(apply field_compatible0_nested_field_array; auto with field_compatible).

(* Specifications: *)
Lemma split2_data_at_Tarray_unfold {cs: compspecs}
sh t n n1 (v v' v1 v2: list (reptype t)) p:
0 <= n1 <= n ->
v = v' ->
v1 = (sublist 0 n1 v') ->
v2 = (sublist n1 n v') ->
data_at sh (Tarray t n noattr) v p |--
data_at sh (Tarray t n1 noattr) v1 p *
data_at sh (Tarray t (n - n1) noattr) v2
(field_address0 (Tarray t n noattr) (ArraySubsc n1::nil) p).
Lemma split2_data_at_Tarray_fold {cs: compspecs} sh t n n1 (v v' v1 v2: list (reptype t)) p:
0 <= n1 <= n ->
n <= Zlength v' ->
v = (sublist 0 n v') ->
v1 = (sublist 0 n1 v') ->
v2 = (sublist n1 n v') ->
data_at sh (Tarray t n1 noattr) v1 p *
data_at sh (Tarray t (n - n1) noattr) v2
(field_address0 (Tarray t n noattr) (ArraySubsc n1::nil) p)
|--
data_at sh (Tarray t n noattr) v p.
Lemma split2_data_at_Tarray {cs: compspecs} sh t n n1 (v v' v1 v2: list (reptype t)) p:
0 <= n1 <= n ->
n <= Zlength v' ->
v = (sublist 0 n v') ->
v1 = (sublist 0 n1 v') ->
v2 = (sublist n1 n v') ->
data_at sh (Tarray t n noattr) v p =
data_at sh (Tarray t n1 noattr) v1 p *
data_at sh (Tarray t (n - n1) noattr) v2 (field_address0 (Tarray t n noattr) (ArraySubsc n1::nil) p).
Lemma field_compatible0_Tarray_offset:
forall {cs: compspecs} t n i n' i' p p',
field_compatible0 (Tarray t n' noattr) (ArraySubsc i' :: nil) p ->
naturally_aligned t ->
0 <= n <= n' ->
0 <= i <= n ->
n-i <= n'-i' ->
i <= i' ->
p' = offset_val (sizeof t * (i'-i)) p ->
field_compatible0 (Tarray t n noattr) (ArraySubsc i :: nil) p'.