End ListLib.
Definition listboxrep (sh: share) (contents: list int) (x: val) : mpred :=
EX y: val, data_at sh (tptr t_struct_list) y x * listrep sh contents y.
Module LBsegWandQFrame.
Definition lbseg (sh: share) (contents: list int) (x z: val) : mpred :=
ALL tcontents: list int, listboxrep sh tcontents z -* listboxrep sh (contents ++ tcontents) x.

(* Specifications: *)
Lemma singleton_lbseg: forall sh (a: int) (x y: val),
data_at sh (tptr t_struct_list) y x *
field_at sh t_struct_list [StructField _head] (Vint a) y |--
lbseg sh [a] x (field_address t_struct_list [StructField _tail] y).
Lemma lbseg_lbseg: forall sh (s1 s2: list int) (x y z: val),
lbseg sh s2 y z * lbseg sh s1 x y |-- lbseg sh (s1 ++ s2) x z.