Instance CompSpecs : compspecs.Definition Vprog : varspecs.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.Inductive tree : Type :=
 | E : tree
 | T: tree -> V -> tree -> tree.Inductive tree : Type :=
 | E : tree
 | T: tree -> V -> tree -> tree.Inductive tree : Type :=
 | E : tree
 | T: tree -> V -> tree -> tree.Definition map_tree {V1 V2: Type} (f: V1 -> V2): tree V1 -> tree V2 :=
  fix map_tree (t: tree V1) :=
    match t with
    | E => E
    | T t1 x t2 => T (map_tree t1) (f x) (map_tree t2)
    end.Fixpoint iter_tree_sepcon (t1 : tree B) : A :=
    match t1 with
    | E => emp
    | T a x b => p x * iter_tree_sepcon a * iter_tree_sepcon b
    end.Fixpoint iter_tree_sepcon2 (t1 : tree B1) : tree B2 -> A :=
    match t1 with
    | E => fun t2 =>
       match t2 with
       | E => emp
       | _ => FF
       end
    | T xa x xb => fun t2 =>
       match t2 with
       | E => FF
       | T ya y yb => p x y * iter_tree_sepcon2 xa ya * iter_tree_sepcon2 xb yb
       end
  end.(* X_DEFS *)

Inductive XTree: Type :=
| XLeaf: XTree
| XNode: list XTree -> Z -> XTree.(* X_DEFS *)

Inductive XTree: Type :=
| XLeaf: XTree
| XNode: list XTree -> Z -> XTree.(* X_DEFS *)

Inductive XTree: Type :=
| XLeaf: XTree
| XNode: list XTree -> Z -> XTree.(* X_DEFS ends. *)

(* Y_DEFS *)

Inductive YTree: Type :=
| YLeaf: YTree
| YNode: list (tree (unit * YTree) * unit) -> Z -> YTree.(* X_DEFS ends. *)

(* Y_DEFS *)

Inductive YTree: Type :=
| YLeaf: YTree
| YNode: list (tree (unit * YTree) * unit) -> Z -> YTree.(* X_DEFS ends. *)

(* Y_DEFS *)

Inductive YTree: Type :=
| YLeaf: YTree
| YNode: list (tree (unit * YTree) * unit) -> Z -> YTree.Definition y_tree_rep (t: tree val) (p: val): mpred :=
  tree_rep (fun q L R p: val => data_at Tsh t_struct_Ytree (q, (L, R)) p) t p.Definition y_list_rep (l: list val) (p: val): mpred :=
  list_rep (fun q n p: val => data_at Tsh t_struct_Ylist (q, n) p) l p.Fixpoint x_add1 (t: XTree): XTree :=
  match t with
  | XLeaf =>
      XLeaf
  | XNode tl v =>
      XNode (map x_add1 tl) (v + 1)
  end.Fixpoint Forall_XTree (t: XTree): Prop :=
  match t with
  | XLeaf =>
      True
  | XNode tl v =>
      fold_right and (P v) (map Forall_XTree tl)
  end.

Lemma add1_pos: forall t, Forall_XTree (fun x => x >= 0) t -> Forall_XTree (fun x => x > 0) (x_add1 t).