Documentation

Bdd.BDD

structure BDD :

Abstract BDD type.

Instances For
    def BDD.lift {n : } (B : BDD) (h : B.nvars n) :

    Raise the input size (BDD.nvars) of a BDD to n, given a proof that the current input size is at most n.

    Equations
    Instances For
      @[simp]
      theorem BDD.lift_nvars {n : } {B : BDD} {h : B.nvars n} :
      (B.lift h).nvars = n

      Lifting a BDD to n yields a BDD with input size (BDD.nvars) of n.

      @[simp]
      theorem BDD.lift_refl {B : BDD} :
      B.lift = B

      Lifting a BDD B to its current input size (BDD.nvars) yields back B.

      def BDD.denotation {n : } (B : BDD) (h : B.nvars n) :

      The denotation of a BDD is the Boolean function that it represents.

      Equations
      Instances For
        @[simp]
        theorem BDD.lift_denotation {n m : } {B : BDD} {h1 : B.nvars n} {h2 : n m} :
        (B.lift h1).denotation h2 = B.denotation

        BDD.lift does not affect BDD.denotation.

        @[simp]
        theorem BDD.denotation_cast {n m : } {I : Vector Bool n} {B : BDD} {hn : B.nvars n} {hm : B.nvars m} (h : n = m) :

        BDD.denotation absorbs Vector.cast.

        theorem BDD.denotation_independentOf_of_geq_nvars {n : } {i : Fin n} {B : BDD} {h1 : B.nvars n} {h2 : B.nvars i} :

        The denotation of a BDD is independent of indices that exceed its input size.

        BDDs are semantically equivalent when their denotations coincide.

        Equations
        Instances For
          def BDD.size :
          BDD
          Equations
          Instances For
            def BDD.const :
            BoolBDD
            Equations
            Instances For
              def BDD.var :
              BDD
              Equations
              Instances For
                def BDD.apply :
                (BoolBoolBool)BDDBDDBDD
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[simp]
                  theorem BDD.apply_nvars {B C : BDD} {o : BoolBoolBool} :
                  (apply o B C).nvars = max B.nvars C.nvars
                  def BDD.and :
                  BDDBDDBDD
                  Equations
                  Instances For
                    def BDD.or :
                    BDDBDDBDD
                    Equations
                    Instances For
                      def BDD.xor :
                      BDDBDDBDD
                      Equations
                      Instances For
                        def BDD.imp :
                        BDDBDDBDD
                        Equations
                        Instances For
                          def BDD.not :
                          BDDBDD
                          Equations
                          Instances For
                            @[simp]
                            theorem BDD.const_nvars {b : Bool} :
                            (const b).nvars = 0
                            @[simp]
                            theorem BDD.const_denotation {b : Bool} {a✝ : } {h : (const b).nvars a✝} :
                            @[simp]
                            theorem BDD.var_nvars {i : } :
                            (var i).nvars = i + 1
                            @[simp]
                            theorem BDD.var_denotation {i a✝ : } {h : (var i).nvars a✝} {I : Vector Bool a✝} :
                            (var i).denotation h I = I[i]
                            @[reducible, inline]
                            abbrev BDD.denotation' (O : BDD) :
                            Equations
                            Instances For
                              theorem BDD.denotation_take {n m : } {I : Vector Bool n} {B : BDD} {hn : B.nvars n} {hm1 : B.nvars m} {hm2 : m n} :
                              B.denotation hn I = B.denotation (I.take m)
                              theorem BDD.denotation_take' {n : } {I : Vector Bool n} {B : BDD} {hn : B.nvars n} :
                              B.denotation hn I = B.denotation (Vector.cast (I.take B.nvars))
                              @[simp]
                              theorem BDD.apply_denotation {n : } {B C : BDD} {op : BoolBoolBool} {I : Vector Bool n} {h : (apply op B C).nvars n} :
                              (apply op B C).denotation h I = op (B.denotation I) (C.denotation I)
                              @[simp]
                              theorem BDD.and_nvars {B C : BDD} :
                              (B.and C).nvars = max B.nvars C.nvars
                              @[simp]
                              theorem BDD.and_denotation {n : } {B C : BDD} {I : Vector Bool n} {h : (B.and C).nvars n} :
                              (B.and C).denotation h I = (B.denotation I && C.denotation I)
                              @[simp]
                              theorem BDD.or_nvars {B C : BDD} :
                              (B.or C).nvars = max B.nvars C.nvars
                              @[simp]
                              theorem BDD.or_denotation {n : } {B C : BDD} {I : Vector Bool n} {h : (B.or C).nvars n} :
                              (B.or C).denotation h I = (B.denotation I || C.denotation I)
                              @[simp]
                              theorem BDD.xor_nvars {B C : BDD} :
                              (B.xor C).nvars = max B.nvars C.nvars
                              @[simp]
                              theorem BDD.xor_denotation {n : } {B C : BDD} {I : Vector Bool n} {h : (B.xor C).nvars n} :
                              (B.xor C).denotation h I = (B.denotation I ^^ C.denotation I)
                              @[simp]
                              theorem BDD.imp_nvars {B C : BDD} :
                              (B.imp C).nvars = max B.nvars C.nvars
                              @[simp]
                              theorem BDD.imp_denotation {n : } {B C : BDD} {I : Vector Bool n} {h : (B.imp C).nvars n} :
                              (B.imp C).denotation h I = (!B.denotation I || C.denotation I)
                              @[simp]
                              theorem BDD.not_nvars {B : BDD} :
                              @[simp]
                              theorem BDD.not_denotation {n : } {B : BDD} {I : Vector Bool n} {h : B.not.nvars n} :
                              B.not.denotation h I = !B.denotation I
                              def BDD.relabel {n : } (B : BDD) (f : Fin B.nvarsFin n) (h : ∀ (i i' : Nary.Dependency B.denotation'), i < i'f i < f i') :
                              Equations
                              Instances For
                                @[simp]
                                theorem BDD.relabel_nvars {n : } {B : BDD} {f : Fin B.nvarsFin n} {h : ∀ (i i' : Nary.Dependency B.denotation'), i < i'f i < f i'} :
                                (B.relabel f h).nvars = n
                                @[simp]
                                theorem BDD.relabel_denotation {n : } {B : BDD} {f : Fin B.nvarsFin n} {hf : ∀ (i i' : Nary.Dependency B.denotation'), i < i'f i < f i'} {I : Vector Bool n} {h : (B.relabel f hf).nvars n} :
                                (B.relabel f hf).denotation h I = B.denotation' (Vector.ofFn fun (i : Fin B.nvars) => I[f i])
                                def BDD.choice {B : BDD} (s : ∃ (I : Vector Bool B.nvars), B.denotation' I = true) :
                                Equations
                                Instances For
                                  @[simp]
                                  theorem BDD.choice_denotation {B : BDD} {s : ∃ (I : Vector Bool B.nvars), B.denotation' I = true} :
                                  Equations
                                  Instances For
                                    theorem BDD.find_some {B : BDD} {I : Vector Bool B.nvars} :
                                    def BDD.restrict (B : BDD) (b : Bool) (i : ) :
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem BDD.restrict_geq_eq_self {i : } {b : Bool} {B : BDD} :
                                      i B.nvarsB.restrict b i = B
                                      @[simp]
                                      theorem BDD.restrict_nvars {b : Bool} {B : BDD} {i : } :
                                      (B.restrict b i).nvars = B.nvars
                                      @[simp]
                                      theorem BDD.restrict_denotation {n : } {b : Bool} {B : BDD} {I : Vector Bool n} {i : } {hi : i < n} {h : (B.restrict b i).nvars n} :
                                      (B.restrict b i).denotation h I = Nary.restrict (B.denotation ) b i, hi I
                                      def BDD.bforall (B : BDD) (i : ) :
                                      Equations
                                      Instances For
                                        def BDD.bforalls (B : BDD) (l : List ) :
                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem BDD.bforall_nvars {B : BDD} {i : } :
                                          @[simp]
                                          theorem BDD.bforall_denotation {n : } {B : BDD} {i : } {hi : i < n} {I : Vector Bool n} {h : (B.bforall i).nvars n} :
                                          (B.bforall i).denotation h I = decide (∀ (b : Bool), B.denotation (I.set i b hi) = true)
                                          @[simp]
                                          theorem BDD.bforall_idem {n : } {B : BDD} {i : } {hi : i < n} {I : Vector Bool n} {h : ((B.bforall i).bforall i).nvars n} :
                                          ((B.bforall i).bforall i).denotation h I = (B.bforall i).denotation I
                                          theorem BDD.bforall_comm {n : } {B : BDD} {i j : Fin B.nvars} {I : Vector Bool n} {h : ((B.bforall i).bforall j).nvars n} :
                                          ((B.bforall i).bforall j).denotation h I = ((B.bforall j).bforall i).denotation I
                                          def BDD.bexists (B : BDD) (i : ) :
                                          Equations
                                          Instances For
                                            def BDD.bexistss (B : BDD) (l : List ) :
                                            Equations
                                            Instances For
                                              @[simp]
                                              theorem BDD.bexists_nvars {B : BDD} {i : } :
                                              @[simp]
                                              theorem BDD.bexists_denotation {n : } {B : BDD} {i : } {hi : i < n} {I : Vector Bool n} {h : (B.bexists i).nvars n} :
                                              (B.bexists i).denotation h I = decide (∃ (b : Bool), B.denotation (I.set i b hi) = true)
                                              @[simp]
                                              theorem BDD.bexists_idem {n : } {B : BDD} {i : } {hi : i < n} {I : Vector Bool n} {h : ((B.bexists i).bexists i).nvars n} :
                                              ((B.bexists i).bexists i).denotation h I = (B.bexists i).denotation I
                                              theorem BDD.bexists_comm {n : } {B : BDD} {i j : Fin B.nvars} {I : Vector Bool n} {h : ((B.bexists i).bexists j).nvars n} :
                                              ((B.bexists i).bexists j).denotation h I = ((B.bexists j).bexists i).denotation I