Module LsegWandQFrame.
Definition lseg (sh: share) (contents: list int) (x z: val) : mpred :=
ALL tcontents: list int, listrep sh tcontents z -* listrep sh (contents ++ tcontents) x.
Hint Resolve listrep_local_facts : saturate_local.
Hint Resolve listrep_valid_pointer : valid_pointer.

Lemma listrep_nonnull: forall sh contents x,
x <> nullval ->
listrep sh contents x = EX h: int, EX hs: list int, EX y:val,
!! (contents = h :: hs) &&
field_at sh t_struct_list [StructField _head] (Vint h) x *
field_at sh t_struct_list [StructField _tail] y x *
listrep sh hs y.