Require VST.floyd.aggregate_pred. Import VST.floyd.aggregate_pred.aggregate_pred.
Hint Extern 2 (field_compatible0 _ (ArraySubsc _ :: _) _) =>
(eapply field_compatible0_cons_Tarray; [reflexivity | | omega])
: field_compatible.
Hint Extern 2 (field_compatible _ (ArraySubsc _ :: _) _) =>
(eapply field_compatible_cons_Tarray; [reflexivity | | omega])
: field_compatible.
Hint Extern 2 (field_compatible (Tarray _ _ _) nil _) =>
(eapply field_compatible_array_smaller0; [eassumption | omega]) : field_compatible.
Hint Extern 2 (field_compatible (tarray _ _) nil _) =>
(eapply field_compatible_array_smaller0; [eassumption | omega]) : field_compatible.
Hint Extern 2 (field_compatible0 (Tarray _ _ _) nil _) =>
(eapply field_compatible0_array_smaller0; [eassumption | omega]) : field_compatible.
Hint Extern 2 (field_compatible0 (tarray _ _) nil _) =>
(eapply field_compatible0_array_smaller0; [eassumption | omega]) : field_compatible.
Hint Extern 2 (field_compatible0 (Tarray _ _ _) (ArraySubsc _ :: nil) _) =>
(eapply field_compatible0_array_smaller1; [eassumption | omega | omega]) : field_compatible.
Hint Extern 2 (field_compatible0 (tarray _ _) (ArraySubsc _ :: nil) _) =>
(eapply field_compatible0_array_smaller1; [eassumption | omega | omega]) : field_compatible.
Arguments nested_field_array_type {cs} t gfs lo hi / .
Hint Resolve field_compatible_field_compatible0 : field_compatible.
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) : core. (*FIXME: should be field_compatible*)
(* 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. *)

Lemma split3_data_at_Tarray_tschar {cs: compspecs} sh n n1 n2 (v: list val) p:
0 <= n1 <= n2 ->
n2 <= n ->
Zlength v = n ->
data_at sh (Tarray tschar n noattr) v p =
data_at sh (Tarray tschar n1 noattr) (sublist 0 n1 v) p *
data_at sh (Tarray tschar (n2 - n1) noattr) (sublist n1 n2 v) (field_address0 (Tarray tschar n noattr) (ArraySubsc n1::nil) p) *
data_at sh (Tarray tschar (n - n2) noattr) (sublist n2 n v) (field_address0 (Tarray tschar n noattr) (ArraySubsc n2::nil) p).