Module logicng

Class BDDConstruction


  • public class BDDConstruction
    extends Object
    This class provides abstractions for the construction of BDDs.
    Since:
    2.0.0
    Version:
    2.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      BDDConstruction​(BDDKernel k)
      Constructs a new object with the given kernel.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int and​(int l, int r)
      Returns the conjunction of two BDDs.
      int bddHigh​(int root)
      Returns the true branch of the given root node.
      int bddLow​(int root)
      Returns the false branch of the given root node.
      int bddVar​(int root)
      Returns the variable index labeling the given root node.
      int equivalence​(int l, int r)
      Returns the equivalence of two BDDs.
      int exists​(int r, int var)
      Existential quantifier elimination for the variables in var.
      int forAll​(int r, int var)
      Universal quantifier elimination for the variables in var.
      int implication​(int l, int r)
      Returns the implication of two BDDs.
      protected boolean insvarset​(int a)  
      protected boolean invarset​(int a)  
      int ithVar​(int i)
      Returns a BDD representing the i-th variable (one node with the children true and false).
      int nithVar​(int i)
      Returns a BDD representing the negation of the i-th variable (one node with the children true and false).
      int not​(int r)
      Returns the negation of a BDD.
      protected int notRec​(int r)  
      int or​(int l, int r)
      Returns the disjunction of two BDDs.
      protected int quantRec​(int r, BDDKernel.Operand op, int quantid)  
      int restrict​(int r, int var)
      Restricts the variables in the BDD r to constants true or false.
      protected int restrictRec​(int r, int miscid)  
      protected void varset2svartable​(int r)  
      protected void varset2vartable​(int r)  
    • Constructor Detail

      • BDDConstruction

        public BDDConstruction​(BDDKernel k)
        Constructs a new object with the given kernel.
        Parameters:
        k - the kernel
    • Method Detail

      • ithVar

        public int ithVar​(int i)
        Returns a BDD representing the i-th variable (one node with the children true and false).
        Parameters:
        i - the index i
        Returns:
        the BDD representing the i-th variable
        Throws:
        IllegalArgumentException - if the index is not within the range of variables
      • nithVar

        public int nithVar​(int i)
        Returns a BDD representing the negation of the i-th variable (one node with the children true and false).
        Parameters:
        i - the index i
        Returns:
        the BDD representing the negated i-th variable
        Throws:
        IllegalArgumentException - if the index is not within the range of variables
      • bddVar

        public int bddVar​(int root)
        Returns the variable index labeling the given root node.
        Parameters:
        root - the root node of the BDD
        Returns:
        the variable index
      • bddLow

        public int bddLow​(int root)
        Returns the false branch of the given root node.
        Parameters:
        root - the root node of the BDD
        Returns:
        the false branch
      • bddHigh

        public int bddHigh​(int root)
        Returns the true branch of the given root node.
        Parameters:
        root - the root node of the BDD
        Returns:
        the true branch
      • and

        public int and​(int l,
                       int r)
        Returns the conjunction of two BDDs.
        Parameters:
        l - the first BDD
        r - the second BDD
        Returns:
        the conjunction of the two BDDs
      • or

        public int or​(int l,
                      int r)
        Returns the disjunction of two BDDs.
        Parameters:
        l - the first BDD
        r - the second BDD
        Returns:
        the disjunction of the two BDDs
      • implication

        public int implication​(int l,
                               int r)
        Returns the implication of two BDDs.
        Parameters:
        l - the first BDD
        r - the second BDD
        Returns:
        the implication of the two BDDs
      • equivalence

        public int equivalence​(int l,
                               int r)
        Returns the equivalence of two BDDs.
        Parameters:
        l - the first BDD
        r - the second BDD
        Returns:
        the equivalence of the two BDDs
      • not

        public int not​(int r)
        Returns the negation of a BDD.
        Parameters:
        r - the BDD
        Returns:
        the negation of the BDD
      • restrict

        public int restrict​(int r,
                            int var)
        Restricts the variables in the BDD r to constants true or false. The restriction is submitted in the BDD var.
        Parameters:
        r - the BDD to be restricted
        var - the variable mapping as a BDD
        Returns:
        the restricted BDD
      • exists

        public int exists​(int r,
                          int var)
        Existential quantifier elimination for the variables in var.
        Parameters:
        r - the BDD root node
        var - the variables to eliminate
        Returns:
        the BDD with the eliminated variables
      • forAll

        public int forAll​(int r,
                          int var)
        Universal quantifier elimination for the variables in var.
        Parameters:
        r - the BDD root node
        var - the variables to eliminate
        Returns:
        the BDD with the eliminated variables
      • varset2svartable

        protected void varset2svartable​(int r)
      • varset2vartable

        protected void varset2vartable​(int r)
      • insvarset

        protected boolean insvarset​(int a)
      • invarset

        protected boolean invarset​(int a)