- java.lang.Object
-
- org.logicng.transformations.BDDNormalFormTransformation
-
- All Implemented Interfaces:
FormulaTransformation
- Direct Known Subclasses:
BDDCNFTransformation,BDDDNFTransformation
public abstract class BDDNormalFormTransformation extends Object implements FormulaTransformation
Transformation of a formula in a normal form (DNF or CNF) by converting it to a BDD.- Since:
- 2.3.0
- Version:
- 2.3.0
-
-
Constructor Summary
Constructors Constructor Description BDDNormalFormTransformation(FormulaFactory f, int numVars)Constructs a new BDD-based normal form transformation for a given number of variables.BDDNormalFormTransformation(BDDKernel kernel)Constructs a new BDD-based normal form transformation with an optional BDD kernel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Formulacompute(Formula formula, boolean cnf, boolean cache)Computes the CNF or DNF from the given formula by using a BDD.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.logicng.formulas.FormulaTransformation
apply
-
-
-
-
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 usenumVars- 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 transformcnf-trueif a CNF should be computed,falseif a canonical DNF should be computedcache- indicates whether the result should be cached in this formula's cache- Returns:
- the normal form (CNF or DNF) of the formula
-
-