Definition BDDzero := N0.Definition BDDone := Npos 1.Definition BDDvar := ad.Definition BDDcompare (x y : BDDvar) :=
    match x, y with
    | N0, N0 => Datatypes.Eq
    | N0, Npos _ => Datatypes.Lt
    | Npos _, N0 => Datatypes.Gt
    | Npos p1, Npos p2 => Pcompare p1 p2 Datatypes.Eq
    end.Definition BDDvar_eq := Neqb.Definition ad_S (a : ad) :=
    match a with
    | N0 => Npos 1
    | Npos p => Npos (Psucc p)
    end.

(* Specifications: *)
Lemma ad_S_is_S : forall a : ad, nat_of_N (ad_S a) = S (nat_of_N a).
Lemma lt_pred : forall x y : nat, x < y -> x <> 0 -> pred x < pred y.
Lemma O_N0 : forall x : ad, nat_of_N x = 0 -> x = N0.
Lemma INFERIEUR_neq_O : forall x y : ad, BDDcompare x y = Datatypes.Lt -> y <> N0.
Lemma BDDcompare_trans : forall x y z : BDDvar, BDDcompare x y = Datatypes.Lt -> BDDcompare y z = Datatypes.Lt -> BDDcompare x z = Datatypes.Lt.
Lemma ad_S_le_then_le : forall x y : ad, Nleb (ad_S x) y = true -> Nleb x y = true.
Lemma le_then_le_S : forall x y : ad, Nleb x y = true -> Nleb x (ad_S y) = true.
Lemma ad_S_le_then_neq : forall x y : ad, Nleb (ad_S x) y = true -> Neqb x y = false.
Lemma BDDcompare_succ : forall a : BDDvar, BDDcompare a (ad_S a) = Datatypes.Lt.
Lemma BDDcompare_lt : forall x y : BDDvar, BDDcompare x y = Datatypes.Lt -> nat_of_N x < nat_of_N y.
Lemma BDDlt_compare : forall x y : BDDvar, nat_of_N x < nat_of_N y -> BDDcompare x y = Datatypes.Lt.
Lemma relation_sum : forall r : Datatypes.comparison, {r = Datatypes.Eq} + {r = Datatypes.Lt} + {r = Datatypes.Gt}.
Lemma BDD_EGAL_complete : forall x y : BDDvar, BDDcompare x y = Datatypes.Eq -> x = y.
Lemma lt_trans_1 : forall x y z : nat, x < y -> y < S z -> x < z.
Lemma BDDcompare_sup_inf : forall x y : BDDvar, BDDcompare x y = Datatypes.Gt -> BDDcompare y x = Datatypes.Lt.
Lemma BDDcompare_1 : forall x y : BDDvar, BDDcompare x y = Datatypes.Lt -> BDDcompare (ad_S x) y = Datatypes.Lt \/ ad_S x = y.