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].
(* Special case when p = null *)
Definition lseq p := lseg p null.

Lemma lseq_null xs h : def h -> h \In lseq null xs -> xs = [::] /\ h = empty.