Section LList.
Variable T : Type.
Notation llist := (llist T).
Fixpoint lseg (p q : ptr) (xs : seq T) {struct xs} :=
if xs is x::xt then
[Pred h | exists r, exists h',
h = p :-> x :+ (p .+ 1 :-> r :+ h') /\ h' \In lseg r q xt]
else [Pred h | p = q /\ h = empty].

Lemma lseg_empty xs p q : empty \In lseg p q xs -> p = q /\ xs = [::].