Definition Xfoo_spec :=
DECLARE _Xfoo
WITH p: val, t: XTree
PRE  [ _p OF (tptr t_struct_Xnode) ]
PROP  (Forall_XTree (fun x => x >= 0) t)
LOCAL (temp _p p)
SEP (xtree_rep t p)
POST [ Tvoid ]
EX t': XTree,
PROP(Forall_XTree (fun x => x > 0) t')
LOCAL()
SEP (xtree_rep t' p).
Fixpoint y_add1 (t: YTree): YTree :=
match t with
| YLeaf =>
YLeaf
| YNode tl v =>
let map1 := fun u_t_pair => (tt, y_add1 (snd u_t_pair)) in
let map2 := fun tt_u_pair => (map_tree map1 (fst tt_u_pair), tt) in
let map3 := fun tl => map map2 tl in
YNode (map3 tl) (v + 1)
end.
Definition ty_add1 (t: tree (unit * YTree)) :=
map_tree (fun t => (tt, y_add1 (snd t))) t.
Definition lty_add1 (t: list (tree (unit * YTree) * unit)) :=
map (fun t => (ty_add1 (fst t), tt)) t.

(* Specifications: *)
Theorem y_add1_spec: forall t,
y_add1 t =
match t with
| YLeaf =>
YLeaf
| YNode tl v =>
YNode (lty_add1 tl) (v + 1)
end.