(* Hint Extern 2 (field_compatible0 (Tarray _ _ _) (ArraySubsc _ :: nil) _) => (eapply field_compatible0_Tarray_offset; [eassumption | omega | omega]) : field_compatible.  Hint Extern 2 (field_compatible0 (tarray _ _) (ArraySubsc _ :: nil) _) => (eapply field_compatible0_Tarray_offset; [eassumption | omega | omega]) : field_compatible. *)

(* Specifications: *)
Lemma split3_data_at_Tarray {cs: compspecs} sh t n n1 n2 v (v' v1 v2 v3: list (reptype t)) p:
naturally_aligned t ->
0 <= n1 <= n2 ->
n2 <= n <= Zlength v' ->
v = (sublist 0 n v') ->
v1 = (sublist 0 n1 v') ->
v2 = (sublist n1 n2 v') ->
v3 = (sublist n2 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 (n2 - n1) noattr) v2 (field_address0 (Tarray t n noattr) (ArraySubsc n1::nil) p) *
data_at sh (Tarray t (n - n2) noattr) v3 (field_address0 (Tarray t n noattr) (ArraySubsc n2::nil) p).
Lemma split2_data_at_Tarray_tuchar {cs: compspecs} sh n n1 (v: list val) p:
0 <= n1 <= n ->
Zlength v = n ->
data_at sh (Tarray tuchar n noattr) v p =
data_at sh (Tarray tuchar n1 noattr) (sublist 0 n1 v) p *
data_at sh (Tarray tuchar (n - n1) noattr) (sublist n1 n v) (field_address0 (Tarray tuchar n noattr) (ArraySubsc n1::nil) p).
Lemma split3_data_at_Tarray_tuchar {cs: compspecs} sh n n1 n2 (v: list val) p:
0 <= n1 <= n2 ->
n2 <= n ->
Zlength v = n ->
data_at sh (Tarray tuchar n noattr) v p =
data_at sh (Tarray tuchar n1 noattr) (sublist 0 n1 v) p *
data_at sh (Tarray tuchar (n2 - n1) noattr) (sublist n1 n2 v) (field_address0 (Tarray tuchar n noattr) (ArraySubsc n1::nil) p) *
data_at sh (Tarray tuchar (n - n2) noattr) (sublist n2 n v) (field_address0 (Tarray tuchar n noattr) (ArraySubsc n2::nil) p).
Lemma sizeof_tarray_tuchar {cs} n (N:0<=n): @sizeof cs (tarray tuchar n) = n.
Lemma memory_block_field_compatible_tarraytuchar {cs} sh n p (N:0<=n < Ptrofs.modulus):
memory_block sh n p = !!(@field_compatible cs (tarray tuchar n) nil p) && memory_block sh n p.
Lemma memory_block_data_at__tarray_tuchar {cs} sh p n (N: 0<=n < Ptrofs.modulus):
memory_block sh n p |-- @data_at_ cs sh (tarray tuchar n) p.
Lemma memory_block_data_at__tarray_tuchar_eq {cs} sh p n (N: 0<=n < Ptrofs.modulus):
memory_block sh n p = @data_at_ cs sh (tarray tuchar n) p.
Lemma isptr_field_compatible0_tarray {cs}:
forall t (H: complete_legal_cosu_type t = true) p,
isptr p ->
@field_compatible cs (tarray t 0) nil p.