End LsegRecursiveLoopFree.
Module LsegRecursiveMaybeLoop.
Fixpoint lseg (sh: share) (contents: list int) (x z: val) : mpred :=
match contents with
| h::hs => EX y:val,
field_at sh t_struct_list [StructField _head] (Vint h) x *
field_at sh t_struct_list [StructField _tail] y x *
lseg sh hs y z
| nil => !! (x = z) && emp
end.
Arguments lseg sh contents x z : simpl never.

Lemma singleton_lseg: forall sh (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 [a] x y.