(* This program is free software; you can redistribute it and/or      *)
(* modify it under the terms of the GNU Lesser General Public License *)
(* as published by the Free Software Foundation; either version 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program is distributed in the hope that it will be useful,    *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of     *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)


Require Import Bool.
Require Import Sumbool.
Require Import Arith.
Require Import ZArith NArith Nnat Ndec Ndigits.
From IntMap Require Import Allmaps.
Require Import Wf_nat.

Require Import BDDvar_ad_nat.
Require Import bdd1.
Require Import bdd2.
Require Import bdd3.
Require Import bdd4.
Require Import bdd5_1.
Require Import bdd5_2.
Require Import bdd6.
Require Import bdd7.
Require Import BDDdummy_lemma_2.
Require Import BDDdummy_lemma_3.
Require Import BDDdummy_lemma_4.

Lemma BDDor_1_lemma :
 forall (bound : nat) (cfg : BDDconfig) (node1 node2 : ad)
   (memo : BDDor_memo),
 BDDconfig_OK cfg ->
 BDDor_memo_OK cfg memo ->
 config_node_OK cfg node1 ->
 config_node_OK cfg node2 ->
 (is_internal_node cfg node1 ->
  is_internal_node cfg node2 ->
  max (nat_of_N (var cfg node1)) (nat_of_N (var cfg node2)) < bound) ->
 BDDconfig_OK (fst (BDDor_1 cfg memo node1 node2 bound)) /\
 BDDor_memo_OK (fst (BDDor_1 cfg memo node1 node2 bound))
   (snd (snd (BDDor_1 cfg memo node1 node2 bound))) /\
 config_node_OK (fst (BDDor_1 cfg memo node1 node2 bound))
   (fst (snd (BDDor_1 cfg memo node1 node2 bound))) /\
 nodes_preserved cfg (fst (BDDor_1 cfg memo node1 node2 bound)) /\
 BDDvar_le
   (var (fst (BDDor_1 cfg memo node1 node2 bound))
      (fst (snd (BDDor_1 cfg memo node1 node2 bound))))
   (BDDvar_max (var cfg node1) (var cfg node2)) = true /\
 bool_fun_eq
   (bool_fun_of_BDD (fst (BDDor_1 cfg memo node1 node2 bound))
      (fst (snd (BDDor_1 cfg memo node1 node2 bound))))
   (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)).
Proof.
(* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) m), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)))))))) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) n), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro bound.
apply
 lt_wf_ind
  with
    (P := fun bound : nat =>
          forall (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo),
          BDDconfig_OK cfg ->
          BDDor_memo_OK cfg memo ->
          config_node_OK cfg node1 ->
          config_node_OK cfg node2 ->
          (is_internal_node cfg node1 ->
           is_internal_node cfg node2 ->
           max (nat_of_N (var cfg node1)) (nat_of_N (var cfg node2)) <
           bound) ->
          BDDconfig_OK (fst (BDDor_1 cfg memo node1 node2 bound)) /\
          BDDor_memo_OK (fst (BDDor_1 cfg memo node1 node2 bound))
            (snd (snd (BDDor_1 cfg memo node1 node2 bound))) /\
          config_node_OK (fst (BDDor_1 cfg memo node1 node2 bound))
            (fst (snd (BDDor_1 cfg memo node1 node2 bound))) /\
          nodes_preserved cfg (fst (BDDor_1 cfg memo node1 node2 bound)) /\
          BDDvar_le
            (var (fst (BDDor_1 cfg memo node1 node2 bound))
               (fst (snd (BDDor_1 cfg memo node1 node2 bound))))
            (BDDvar_max (var cfg node1) (var cfg node2)) = true /\
          bool_fun_eq
            (bool_fun_of_BDD (fst (BDDor_1 cfg memo node1 node2 bound))
               (fst (snd (BDDor_1 cfg memo node1 node2 bound))))
            (bool_fun_or (bool_fun_of_BDD cfg node1)
               (bool_fun_of_BDD cfg node2))).




(* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) m), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)))))))) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) n), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
clear bound.
(* Goal: forall (n : nat) (_ : forall (m : nat) (_ : lt m n) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) m), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)))))))) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) n), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 n)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro bound.
(* Goal: forall (_ : forall (m : nat) (_ : lt m bound) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) m), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 m)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)))))))) (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro H.
(* Goal: forall (cfg : BDDconfig) (node1 node2 : ad) (memo : BDDor_memo) (_ : BDDconfig_OK cfg) (_ : BDDor_memo_OK cfg memo) (_ : config_node_OK cfg node1) (_ : config_node_OK cfg node2) (_ : forall (_ : is_internal_node cfg node1) (_ : is_internal_node cfg node2), lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros cfg node1 node2 memo H0 H1 H2 H3 H4.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim (option_sum _ (BDDor_memo_lookup memo node1 node2)); intro y.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim y; clear y.
(* Goal: forall (x : ad) (_ : @eq (option ad) (BDDor_memo_lookup memo node1 node2) (@Some ad x)), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros node H5.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (BDDor_1_lemma_1 cfg memo node1 node2 node bound H5).
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
simpl in |- *.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in H1.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node *)
(* Goal: and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (H1 node1 node2 node H5)))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: nodes_preserved cfg cfg *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold nodes_preserved in |- *.
(* Goal: forall (x : BDDvar) (l r node : ad) (_ : @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r)))), @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r))) *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros x l r node0 H6.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1) (var cfg node2))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (proj2 (H1 node1 node2 node H5))))).

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2)) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (proj2 (proj2 (proj2 (H1 node1 node2 node H5))))).

(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim H2; intro.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite H5.





(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)))) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDzero node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (BDDor_1_lemma_zero_2 cfg memo node2 bound).
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
simpl in |- *.
cut
 (bool_fun_eq (bool_fun_of_BDD cfg node2)
    (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))).
(* Goal: forall _ : bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)), and (BDDconfig_OK cfg) (and (BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone)) (and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro H6.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in |- *.
(* Goal: forall (node2 node3 node : ad) (_ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node2 node3) (@Some ad node)), and (config_node_OK cfg node2) (and (config_node_OK cfg node3) (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node2) (var cfg node3))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node2) (bool_fun_of_BDD cfg node3)))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros node1' node2' node.
(* Goal: forall _ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node1' node2') (@Some ad node), and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros H7.
rewrite (BDDor_memo_lookup_semantics memo BDDzero node2 node2 node1' node2')
  in H7.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim (sumbool_of_bool (Neqb BDDzero node1' && Neqb node2 node2')); intro y0.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (BDDzero = node1').
(* Goal: forall _ : @eq N BDDone node1', and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (node2 = node2').
(* Goal: forall (_ : is_internal_node cfg node1) (_ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node1 *)
intros H8 H9.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H8; assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H7.
(* Goal: forall _ : lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H7; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8.
(* Goal: @eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_2.

(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7; injection H7; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.



(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb node2 node2') true *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (andb_prop (Neqb BDDzero node1') (Neqb node2 node2') y0)).

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb BDDzero node1') true *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (andb_prop (Neqb BDDzero node1') (Neqb node2 node2') y0)).

(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in H1.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node1' *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (H1 node1' node2' node H7)).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node2' *)
(* Goal: and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (H1 node1' node2' node H7))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (H1 node1' node2' node H7)))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (proj2 (H1 node1' node2' node H7))))).

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (proj2 (proj2 (proj2 (H1 node1' node2' node H7))))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: nodes_preserved cfg cfg *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold nodes_preserved in |- *; intro.
(* Goal: forall (l r node : ad) (_ : @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r)))), @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r))) *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros l r node H7.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_2.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (proj1 (bool_fun_of_BDD_semantics cfg H0)).
(* Goal: bool_fun_eq bool_fun_one (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_one) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_eq_symm.
apply
 bool_fun_eq_trans
  with (bool_fun_or (bool_fun_of_BDD cfg node2) bool_fun_zero).
(* Goal: bool_fun_eq (bool_fun_or (bool_fun_of_BDD cfg node2) bool_fun_one) (bool_fun_or bool_fun_one (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_or_commute.

(* Goal: bool_fun_eq (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_zero) (bool_fun_of_BDD cfg node1) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_or_zero.



(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H5; assumption.

(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim H5; clear H5; intro.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite H5.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)))) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo BDDone node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (BDDor_1_lemma_one_2 cfg memo node2 bound).
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
simpl in |- *.
cut
 (bool_fun_eq (bool_fun_of_BDD cfg BDDone)
    (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))).
(* Goal: forall _ : bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)), and (BDDconfig_OK cfg) (and (BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone)) (and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro H6.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in |- *.
(* Goal: forall (node2 node3 node : ad) (_ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node2 node3) (@Some ad node)), and (config_node_OK cfg node2) (and (config_node_OK cfg node3) (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node2) (var cfg node3))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node2) (bool_fun_of_BDD cfg node3)))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros node1' node2' node.
(* Goal: forall _ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node1' node2') (@Some ad node), and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros H7.
rewrite (BDDor_memo_lookup_semantics memo BDDone node2 BDDone node1' node2')
  in H7.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim (sumbool_of_bool (Neqb BDDone node1' && Neqb node2 node2')); intro y0.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (BDDone = node1').
(* Goal: forall _ : @eq N BDDone node1', and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (node2 = node2').
(* Goal: forall (_ : is_internal_node cfg node1) (_ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node1 *)
intros H8 H9.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
right; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H8; assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H7.
(* Goal: forall _ : lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
right; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H7; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8.
(* Goal: @eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1') (var cfg node2))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold var at 1 in |- *.
(* Goal: @eq bool (BDDvar_le match MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) BDDone with | Some (pair x (pair l r as p0) as p) => x | None => BDDzero end (BDDvar_max (var cfg node1') (var cfg node2))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (config_OK_one cfg H0).




(* Goal: @eq bool (BDDvar_le BDDzero (BDDvar_max (var cfg node1') (var cfg node2))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDzero in |- *.
(* Goal: @eq bool (BDDvar_le N0 (BDDvar_max (var cfg node1') (var cfg node2))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_z.

(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7; injection H7; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb node2 node2') true *)
(* Goal: @eq N BDDone node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (andb_prop (Neqb BDDone node1') (Neqb node2 node2') y0)).

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb BDDone node1') true *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg BDDone) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg BDDone) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (andb_prop (Neqb BDDone node1') (Neqb node2 node2') y0)).

(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in H1.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node1' *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (H1 node1' node2' node H7)).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node2' *)
(* Goal: and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (H1 node1' node2' node H7))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (H1 node1' node2' node H7)))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (proj2 (H1 node1' node2' node H7))))).

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (proj2 (proj2 (proj2 (H1 node1' node2' node H7))))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
right; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: nodes_preserved cfg cfg *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold nodes_preserved in |- *; intro.
(* Goal: forall (l r node : ad) (_ : @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r)))), @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r))) *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros l r node H7.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.





(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_1.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (proj1 (proj2 (bool_fun_of_BDD_semantics cfg H0))).
apply
 bool_fun_eq_trans
  with (bf2 := bool_fun_or (bool_fun_of_BDD cfg node2) bool_fun_one).
(* Goal: bool_fun_eq bool_fun_one (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_one) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_eq_symm.
(* Goal: bool_fun_eq (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_one) bool_fun_one *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_or_one.

(* Goal: bool_fun_eq (bool_fun_or (bool_fun_of_BDD cfg node2) bool_fun_one) (bool_fun_or bool_fun_one (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDone node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_or_commute.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H5; assumption.

(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim H3; intro.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite H6.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)))) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDzero bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (BDDor_1_lemma_zero_1 cfg memo node1 bound).
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
simpl in |- *.
cut
 (bool_fun_eq (bool_fun_of_BDD cfg node1)
    (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))).
(* Goal: forall _ : is_internal_node cfg node2, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro H7.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in |- *.
(* Goal: forall (node2 node3 node : ad) (_ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node2 node3) (@Some ad node)), and (config_node_OK cfg node2) (and (config_node_OK cfg node3) (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node2) (var cfg node3))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node2) (bool_fun_of_BDD cfg node3)))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros node1' node2' node.
(* Goal: forall _ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDzero node1) node1' node2') (@Some ad node), and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros H8.
rewrite (BDDor_memo_lookup_semantics memo node1 BDDzero node1 node1' node2')
  in H8.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim (sumbool_of_bool (Neqb node1 node1' && Neqb BDDzero node2')); intro y0.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (node1 = node1').
(* Goal: forall _ : @eq ad node1 node1', and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (BDDzero = node2').
(* Goal: forall (_ : @eq N BDDzero node2') (_ : @eq ad node1 node1'), and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: @eq N BDDzero node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros H9 H10.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H10; assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H8.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDzero node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H8; intro.








(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H11; assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H8.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDzero node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H8; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq N BDDzero node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H11.
(* Goal: @eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_1.

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDzero node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H8; injection H8; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq N BDDzero node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H11.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb BDDzero node2') true *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (andb_prop (Neqb node1 node1') (Neqb BDDzero node2') y0)).

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb node1 node1') true *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (andb_prop (Neqb node1 node1') (Neqb BDDzero node2') y0)).

(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H8.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in H1.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node1' *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (H1 node1' node2' node H8)).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node2' *)
(* Goal: and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (H1 node1' node2' node H8))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (H1 node1' node2' node H8)))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (proj2 (H1 node1' node2' node H8))))).

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg node1) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (proj2 (proj2 (proj2 (H1 node1' node2' node H8))))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.






(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: nodes_preserved cfg cfg *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold nodes_preserved in |- *; intro.
(* Goal: forall (l r node : ad) (_ : @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r)))), @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r))) *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true) (bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros l r node H8.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node1) (BDDvar_max (var cfg node1) (var cfg BDDzero))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_1.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node1) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDzero)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (proj1 (bool_fun_of_BDD_semantics cfg H0)).
(* Goal: bool_fun_eq bool_fun_one (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_one) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_eq_symm.
(* Goal: bool_fun_eq (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_zero) (bool_fun_of_BDD cfg node1) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDzero) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_or_zero.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H6; assumption.

(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim H6.
(* Goal: forall _ : @eq ad node2 BDDone, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
clear H5 H6.
(* Goal: forall _ : @eq ad node2 BDDone, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro H5.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite H5.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)))) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 BDDone bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (BDDor_1_lemma_one_1 cfg memo node1 bound).
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone))))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (@pair BDDconfig (prod N (Map (Map ad))) cfg (@pair N (Map (Map ad)) BDDone (BDDor_memo_put memo node1 BDDone BDDone)))))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
simpl in |- *.
cut
 (bool_fun_eq (bool_fun_of_BDD cfg BDDone)
    (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))).
(* Goal: forall _ : bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)), and (BDDconfig_OK cfg) (and (BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone)) (and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intro H6.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: BDDor_memo_OK cfg (BDDor_memo_put memo node1 BDDone BDDone) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in |- *.
(* Goal: forall (node2 node3 node : ad) (_ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node2 node3) (@Some ad node)), and (config_node_OK cfg node2) (and (config_node_OK cfg node3) (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node2) (var cfg node3))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node2) (bool_fun_of_BDD cfg node3)))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros node1' node2' node.
(* Goal: forall _ : @eq (option ad) (BDDor_memo_lookup (BDDor_memo_put memo node1 BDDone BDDone) node1' node2') (@Some ad node), and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros H7.
rewrite (BDDor_memo_lookup_semantics memo node1 BDDone BDDone node1' node2')
  in H7.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
elim (sumbool_of_bool (Neqb node1 node1' && Neqb BDDone node2')); intro y0.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (node1 = node1').
(* Goal: forall _ : @eq ad node1 node1', and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (BDDone = node2').
(* Goal: forall (_ : is_internal_node cfg node1) (_ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node1 *)
intros H8 H9.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros.








(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H9; assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8; right; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H7.
(* Goal: forall _ : lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
right; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
injection H7; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8.
(* Goal: @eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_2.

(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7; injection H7; intro.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H10.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H9.
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2')) *)
(* Goal: @eq N BDDone node2' *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite <- H8.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb BDDone node2') true *)
(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (andb_prop (Neqb node1 node1') (Neqb BDDone node2') y0)).

(* Goal: @eq ad node1 node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply Neqb_complete.
(* Goal: @eq bool (N.eqb node1 node1') true *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (andb_prop (Neqb node1 node1') (Neqb BDDone node2') y0)).

(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite y0 in H7.
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold BDDor_memo_OK in H1.
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node1' *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (H1 node1' node2' node H7)).






(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node2' *)
(* Goal: and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (H1 node1' node2' node H7))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg node *)
(* Goal: and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (H1 node1' node2' node H7)))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj1 (proj2 (proj2 (proj2 (H1 node1' node2' node H7))))).

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')) *)
(* Goal: and (config_node_OK cfg BDDone) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
exact (proj2 (proj2 (proj2 (proj2 (H1 node1' node2' node H7))))).

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: config_node_OK cfg BDDzero *)
(* Goal: and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2'))))) *)
(* Goal: @eq ad node2 node2' *)
(* Goal: @eq N BDDzero node1' *)
(* Goal: and (config_node_OK cfg node1') (and (config_node_OK cfg node2') (and (config_node_OK cfg node) (and (@eq bool (BDDvar_le (var cfg node) (BDDvar_max (var cfg node1') (var cfg node2'))) true) (bool_fun_eq (bool_fun_of_BDD cfg node) (bool_fun_or (bool_fun_of_BDD cfg node1') (bool_fun_of_BDD cfg node2')))))) *)
(* Goal: and (config_node_OK cfg node2) (and (nodes_preserved cfg cfg) (and (@eq bool (BDDvar_le (var cfg node2) (BDDvar_max (var cfg BDDzero) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2))))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg node2) (bool_fun_or (bool_fun_of_BDD cfg BDDzero) (bool_fun_of_BDD cfg node2)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo BDDzero node2) (@None ad) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
right; left; reflexivity.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: nodes_preserved cfg cfg *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
unfold nodes_preserved in |- *; intro.
(* Goal: forall (l r node : ad) (_ : @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r)))), @eq (option (prod BDDvar (prod ad ad))) (MapGet (prod BDDvar (prod ad ad)) (@fst BDDstate (prod BDDsharing_map ad) cfg) node) (@Some (prod BDDvar (prod ad ad)) (@pair BDDvar (prod ad ad) x (@pair ad ad l r))) *)
(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
intros l r node H7.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: and (@eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true) (bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone))) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
split.
(* Goal: @eq bool (BDDvar_le (var cfg BDDone) (BDDvar_max (var cfg node1) (var cfg BDDone))) true *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply BDDvar_le_max_2.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: bool_fun_eq (bool_fun_of_BDD cfg BDDone) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg BDDone)) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
rewrite (proj1 (proj2 (bool_fun_of_BDD_semantics cfg H0))).
(* Goal: bool_fun_eq bool_fun_one (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_one) *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_eq_symm.
(* Goal: bool_fun_eq (bool_fun_or (bool_fun_of_BDD cfg node1) bool_fun_one) bool_fun_one *)
(* Goal: @eq (option ad) (BDDor_memo_lookup memo node1 BDDone) (@None ad) *)
(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
apply bool_fun_or_one.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
rewrite <- H5; assumption.

(* Goal: forall _ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
cut (is_internal_node cfg node1).



(* Goal: forall (_ : is_internal_node cfg node1) (_ : @eq bool (in_dom (prod BDDvar (prod ad ad)) node2 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node1 *)
intros H8 H9.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node1 *)
cut (is_internal_node cfg node2).
(* Goal: forall _ : is_internal_node cfg node2, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro H7.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
elim (nat_sum bound).
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro y0.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
elim y0; clear y0.
(* Goal: forall (x : nat) (_ : @eq nat bound (S x)), and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro bound'.
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro y0.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
cut (max (nat_of_N (var cfg node1)) (nat_of_N (var cfg node2)) < bound).
(* Goal: forall _ : lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro H10.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
elim (relation_sum (BDDcompare (var cfg node1) (var cfg node2))); intro y1.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
elim y1; clear y1; intro.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply BDDdummy_lemma_2 with (bound' := bound').
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply BDDdummy_lemma_3 with (bound' := bound').
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
cut (BDDcompare (var cfg node2) (var cfg node1) = Datatypes.Lt).
(* Goal: forall _ : @eq comparison (BDDcompare (var cfg node2) (var cfg node1)) Lt, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: @eq comparison (BDDcompare (var cfg node2) (var cfg node1)) Lt *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro y11.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: @eq comparison (BDDcompare (var cfg node2) (var cfg node1)) Lt *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply BDDdummy_lemma_4 with (bound' := bound').
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: @eq comparison (BDDcompare (var cfg node2) (var cfg node1)) Lt *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) bound *)
(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply BDDcompare_sup_inf.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) O *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply H4.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: forall _ : @eq nat bound O, and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
intro y0.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
rewrite y0 in H4.
(* Goal: and (BDDconfig_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (BDDor_memo_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@snd ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (config_node_OK (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (and (nodes_preserved cfg (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound))) (and (@eq bool (BDDvar_le (var (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (BDDvar_max (var cfg node1) (var cfg node2))) true) (bool_fun_eq (bool_fun_of_BDD (@fst BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)) (@fst ad BDDor_memo (@snd BDDconfig (prod ad BDDor_memo) (BDDor_1 cfg memo node1 node2 bound)))) (bool_fun_or (bool_fun_of_BDD cfg node1) (bool_fun_of_BDD cfg node2))))))) *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
absurd (max (nat_of_N (var cfg node1)) (nat_of_N (var cfg node2)) < 0).
(* Goal: not (lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) O) *)
(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) O *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply lt_n_O.

(* Goal: lt (max (N.to_nat (var cfg node1)) (N.to_nat (var cfg node2))) O *)
(* Goal: is_internal_node cfg node2 *)
(* Goal: is_internal_node cfg node1 *)
apply H4.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: is_internal_node cfg node1 *)
apply in_dom_is_internal.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.

(* Goal: is_internal_node cfg node1 *)
apply in_dom_is_internal.
(* Goal: @eq bool (in_dom (prod BDDvar (prod ad ad)) node1 (@fst BDDstate (prod BDDsharing_map ad) cfg)) true *)
assumption.
Qed.