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)).