Hint Resolve lseg_valid_pointer : valid_pointer.

(* Specifications: *)
Lemma lseg_eq: forall sh contents x,
lseg sh contents x x = !! (contents=nil /\ is_pointer_or_null x) && emp.
Lemma lseg_null: forall sh contents,
lseg sh contents nullval nullval = !! (contents=nil) && emp.
Lemma lseg_cons: forall sh (v u x: val) s,
readable_share sh ->
data_at sh t_struct_list (v, u) x * lseg sh s u nullval
|-- lseg sh [v] x u * lseg sh s u nullval.
Lemma lseg_cons': forall sh (v u x a b: val) ,
readable_share sh ->
data_at sh t_struct_list (v, u) x * data_at sh t_struct_list (a,b) u
|-- lseg sh [v] x u * data_at sh t_struct_list (a,b) u.
Lemma lseg_app': forall sh s1 s2 (a w x y z: val),
readable_share sh ->
lseg sh s1 w x * lseg sh s2 x y * data_at sh t_struct_list (a,z) y |--
lseg sh (s1++s2) w y * data_at sh t_struct_list (a,z) y.
Lemma lseg_app_null: forall sh s1 s2 (w x: val),
readable_share sh ->
lseg sh s1 w x * lseg sh s2 x nullval |--
lseg sh (s1++s2) w nullval.
Lemma lseg_app: forall sh s1 s2 a s3 (w x y z: val),
readable_share sh ->
lseg sh s1 w x * lseg sh s2 x y * lseg sh (a::s3) y z |--
lseg sh (s1++s2) w y * lseg sh (a::s3) y z.
Lemma listrep_lseg_null :
listrep = fun sh s p => lseg sh s p nullval.
Lemma body_append: semax_body Vprog Gprog f_append append_spec.
End Proof3.