Definition BDDmake :=
  if Neqb l r
  then (cfg, l)
  else
   match MapGet3 _ (fst (snd cfg)) l r x with
   | Some y => (cfg, y)
   | None => BDDalloc gc cfg x l r ul
   end.

(* Specifications: *)
Lemma BDDmake_keeps_config_OK : BDDconfig_OK (fst BDDmake).
Lemma BDDmake_preserves_used_nodes : used_nodes_preserved cfg (fst BDDmake) ul.
Lemma BDDmake_node_OK : config_node_OK (fst BDDmake) (snd BDDmake).
Lemma BDDmake_bool_fun : bool_fun_eq (bool_fun_of_BDD (fst BDDmake) (snd BDDmake)) (bool_fun_if x (bool_fun_of_BDD cfg r) (bool_fun_of_BDD cfg l)).
Lemma BDDmake_node_height_eq : Neqb l r = false -> Neqb (node_height (fst BDDmake) (snd BDDmake)) (ad_S x) = true.
Lemma BDDmake_node_height_eq_1 : Neqb l r = true -> Neqb (node_height (fst BDDmake) (snd BDDmake)) (node_height cfg l) = true.
Lemma BDDmake_node_height_le : Nleb (node_height (fst BDDmake) (snd BDDmake)) (ad_S x) = true.