Instance CompSpecs : compspecs. make_compspecs prog. Defined.
Definition Vprog : varspecs. mk_varspecs prog. Defined.
Definition t_struct_Xnode := Tstruct _Xnode noattr.
Definition t_struct_Xlist := Tstruct _XList noattr.
Definition t_struct_Ynode := Tstruct _Ynode noattr.
Definition t_struct_Ylist := Tstruct _YList noattr.
Definition t_struct_Ytree := Tstruct _BinaryTree noattr.
Section LISTS.
Variable V: Type.
Variable list_cell: V -> val -> val -> mpred.
Fixpoint list_rep (l: list V) (x: val) : mpred :=
match l with
| h::hs =>
EX y:val, list_cell h y x * list_rep hs y
| nil =>
!! (x = nullval) && emp
end.

(* Specifications: *)
Lemma list_rep_valid_pointer:
(forall v q p, list_cell v q p |-- valid_pointer p) ->
forall l p, list_rep l p |-- valid_pointer p.
Lemma list_rep_local_facts:
(forall v q p, list_cell v q p |-- !! (isptr p)) ->
forall l p, list_rep l p |-- !! (is_pointer_or_null p  /\ (p=nullval <-> l=nil)).