End LsegRecursiveMaybeLoop.
Module LsegWandFrame.
Definition lseg (sh: share) (tcontents contents: list int) (x z: val) : mpred :=
listrep sh tcontents z -* listrep sh (contents ++ tcontents) x.

(* Specifications: *)
Lemma singleton_lseg: forall sh (contents: list int) (a: int) (x y: val),
field_at sh t_struct_list [StructField _head] (Vint a) x *
field_at sh t_struct_list [StructField _tail] y x |--
lseg sh contents [a] x y.
Lemma lseg_lseg: forall sh (s1 s2 t: list int) (x y z: val),
lseg sh t s2 y z * lseg sh (s2 ++ t) s1 x y |-- lseg sh t (s1 ++ s2) x z.
Lemma list_lseg: forall sh (s1 s2: list int) (x y: val),
listrep sh s2 y * lseg sh s2 s1 x y |-- listrep sh (s1 ++ s2) x.