Section BDDand_results.
Variable cfg : BDDconfig.
Variable ul : list ad.
Variable node1 node2 : ad.
Hypothesis cfg_OK : BDDconfig_OK cfg.
Hypothesis ul_OK : used_list_OK cfg ul.
Hypothesis used1 : used_node' cfg ul node1.
Hypothesis used2 : used_node' cfg ul node2.
Definition BDDand :=
match BDDneg cfg ul node1 with
| (cfg1, node1') =>
match BDDneg cfg1 (node1' :: ul) node2 with
| (cfg2, node2') =>
match BDDor cfg2 (node2' :: node1' :: ul) node1' node2' with
| (cfg3, node3) => BDDneg cfg3 (node3 :: ul) node3
end
end
end.

(* Specifications: *)
Lemma BDDand_config_OK : BDDconfig_OK (fst BDDand).
Lemma BDDand_node_OK : config_node_OK (fst BDDand) (snd BDDand).
Lemma BDDand_used_nodes_preserved : used_nodes_preserved cfg (fst BDDand) ul.
Lemma BDDand_is_and :
bool_fun_eq (bool_fun_of_BDD (fst BDDand) (snd BDDand))
(bool_fun_and (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)).
Lemma BDDand_list_OK : used_list_OK (fst BDDand) ul.
Lemma BDDand_list_OK_cons : used_list_OK (fst BDDand) (snd BDDand :: ul).
Lemma BDDand_var_le :
Nleb (node_height (fst BDDand) (snd BDDand))
(BDDvar_max (node_height cfg node1) (node_height cfg node2)) = true.