Module logicng

Class BDDNormalFormTransformation

    • Constructor Detail

      • BDDNormalFormTransformation

        public BDDNormalFormTransformation​(BDDKernel kernel)
        Constructs a new BDD-based normal form transformation with an optional BDD kernel.

        Warning: You can use this object for arbitrarily many transformations, but the number of different variables in all applied formulas must not exceed the number of variables in the kernel.

        Parameters:
        kernel - the optional BDD kernel
      • BDDNormalFormTransformation

        public BDDNormalFormTransformation​(FormulaFactory f,
                                           int numVars)
        Constructs a new BDD-based normal form transformation for a given number of variables.

        Warning: You can use this object for arbitrarily many transformations, but the number of different variables in all applied formulas must not exceed numVars.

        To improve performance you might want to use BDDNormalFormTransformation(BDDKernel), where you have full control over the node and cache size in the used BDD kernel.

        Parameters:
        f - the formula factory to use
        numVars - the number of variables
    • Method Detail

      • compute

        protected Formula compute​(Formula formula,
                                  boolean cnf,
                                  boolean cache)
        Computes the CNF or DNF from the given formula by using a BDD.
        Parameters:
        formula - the formula to transform
        cnf - true if a CNF should be computed, false if a canonical DNF should be computed
        cache - indicates whether the result should be cached in this formula's cache
        Returns:
        the normal form (CNF or DNF) of the formula