End BDDsubst_results.
Section BDDreplace_results.
Variable cfg : BDDconfig.
Variable ul : list ad.
Variable node : ad.
Variable x y : ad.
Hypothesis cfg_OK : BDDconfig_OK cfg.
Hypothesis ul_OK : used_list_OK cfg ul.
Hypothesis used : used_node' cfg ul node.
Hypothesis xy_neq : Neqb x y = false.
Definition BDDreplace :=
match BDDvar_make gc cfg ul y with
| (cfg1, nodey) => BDDsubst cfg1 (nodey :: ul) node x nodey
end.

(* Specifications: *)
Lemma BDDreplace_config_OK : BDDconfig_OK (fst BDDreplace).
Lemma BDDreplace_node_OK : config_node_OK (fst BDDreplace) (snd BDDreplace).
Lemma BDDreplace_used_nodes_preserved :
used_nodes_preserved cfg (fst BDDreplace) ul.
Lemma BDDreplace_list_OK : used_list_OK (fst BDDreplace) ul.
Lemma BDDreplace_list_OK_cons :
used_list_OK (fst BDDreplace) (snd BDDreplace :: ul).
Lemma BDDreplace_is_replace :
bool_fun_eq (bool_fun_of_BDD (fst BDDreplace) (snd BDDreplace))
(bool_fun_replace x y (bool_fun_of_BDD cfg node)).