(* solve list equations *)
(* interpreted functions : Zlength app list_repeat / Zrepeat map sublist upd_Znth -> sublist Znth *)
Definition data_subsume {cs : compspecs} (t : type) (x y : reptype t) : Prop :=
forall sh p, data_at sh t x p |-- data_at sh t y p.
Ltac apply_list_ext :=
first
[ apply data_subsume_array_ext;
only 1, 2 : Zlength_solve
| match goal with |- @eq ?list_A _ _ =>
match eval compute in list_A with list ?A =>
apply (@Znth_eq_ext A ltac:(auto with typeclass_instances))
end
end;
only 1 : Zlength_solve
];
autorewrite with Zlength;
intros.

Lemma range_binB_app : forall {A : Type} {da : Inhabitant A} {B : Type} {db : Inhabitant B}
(lo hi offset : Z) (l : list A) (al' bl' : list B) (P : A -> B -> Prop),
0 <= lo + offset <= Zlength al' /\ Zlength al' <= hi + offset <= Zlength al' + Zlength bl' ->
range_bin lo hi offset l (al' ++ bl') P ->
range_bin lo (Zlength al' - offset) offset l al' P /\
range_bin (Zlength al' - offset) hi (offset - Zlength al') l bl' P.