Definition bool_fun_impl (bf1 bf2 : bool_fun) : bool_fun :=
fun vb : var_binding => implb (bf1 vb) (bf2 vb).

(* Specifications: *)
Lemma bool_fun_impl_is_neg_or_bf2 :
forall bf1 bf2 : bool_fun,
bool_fun_eq (bool_fun_impl bf1 bf2) (bool_fun_or (bool_fun_neg bf1) bf2).
Lemma BDDimpl_is_impl :
forall (cfg : BDDconfig) (negm : BDDneg_memo) (orm : BDDor_memo)
(node1 node2 : ad),
BDDconfig_OK cfg ->
BDDneg_memo_OK_2 cfg negm ->
BDDor_memo_OK cfg orm ->
config_node_OK cfg node1 ->
config_node_OK cfg node2 ->
bool_fun_eq
(bool_fun_of_BDD (fst (BDDimpl cfg negm orm node1 node2))
(fst (snd (BDDimpl cfg negm orm node1 node2))))
(bool_fun_impl (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)).
Lemma BDDimpl_preserves_nodes :
forall (cfg : BDDconfig) (negm : BDDneg_memo) (orm : BDDor_memo)
(node1 node2 : ad),
BDDconfig_OK cfg ->
BDDneg_memo_OK_2 cfg negm ->
BDDor_memo_OK cfg orm ->
config_node_OK cfg node1 ->
config_node_OK cfg node2 ->
nodes_preserved cfg (fst (BDDimpl cfg negm orm node1 node2)).
Lemma BDDimpl_keeps_node_OK :
forall (cfg : BDDconfig) (negm : BDDneg_memo) (orm : BDDor_memo)
(node1 node2 : ad),
BDDconfig_OK cfg ->
BDDneg_memo_OK_2 cfg negm ->
BDDor_memo_OK cfg orm ->
config_node_OK cfg node1 ->
config_node_OK cfg node2 ->
forall node : ad,
config_node_OK cfg node ->
config_node_OK (fst (BDDimpl cfg negm orm node1 node2)) node.
Lemma BDDimpl_preserves_bool_fun :
forall (cfg : BDDconfig) (negm : BDDneg_memo) (orm : BDDor_memo)
(node1 node2 : ad),
BDDconfig_OK cfg ->
BDDneg_memo_OK_2 cfg negm ->
BDDor_memo_OK cfg orm ->
config_node_OK cfg node1 ->
config_node_OK cfg node2 ->
forall node : ad,
config_node_OK cfg node ->
bool_fun_eq (bool_fun_of_BDD (fst (BDDimpl cfg negm orm node1 node2)) node)
(bool_fun_of_BDD cfg node).
Lemma BDDimpl_keeps_neg_memo_OK :
forall (cfg : BDDconfig) (negm : BDDneg_memo) (orm : BDDor_memo)
(node1 node2 : ad),
BDDconfig_OK cfg ->
BDDneg_memo_OK_2 cfg negm ->
BDDor_memo_OK cfg orm ->
config_node_OK cfg node1 ->
config_node_OK cfg node2 ->
BDDneg_memo_OK_2 (fst (BDDimpl cfg negm orm node1 node2))
(fst (snd (snd (BDDimpl cfg negm orm node1 node2)))).
Lemma BDDimpl_keeps_or_memo_OK :
forall (cfg : BDDconfig) (negm : BDDneg_memo) (orm : BDDor_memo)
(node1 node2 : ad),
BDDconfig_OK cfg ->
BDDneg_memo_OK_2 cfg negm ->
BDDor_memo_OK cfg orm ->
config_node_OK cfg node1 ->
config_node_OK cfg node2 ->
BDDor_memo_OK (fst (BDDimpl cfg negm orm node1 node2))
(snd (snd (snd (BDDimpl cfg negm orm node1 node2)))).