- java.lang.Object
-
- org.logicng.transformations.qmc.QuineMcCluskeyAlgorithm
-
public class QuineMcCluskeyAlgorithm extends Object
An implementation of the Quine-McCluskey algorithm for minimizing canonical DNFs. This implementation is fairly efficient but keep in mind that Quine-McCluskey can be a very expensive procedure for large canonical DNFs. So we would not recommend using this implementation for super large DNFs.- Since:
- 1.4.0
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description QuineMcCluskeyAlgorithm()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Formulacompute(List<Assignment> models, FormulaFactory f)Computes a minimized DNF for a given set of models.static Formulacompute(Formula formula)Computes a minimized DNF for a given formula.static Formulacompute(Formula formula, Collection<Variable> relevantVariables)Computes a minimized DNF for a given formula projected to a given set of variables.
-
-
-
Method Detail
-
compute
public static Formula compute(Formula formula, Collection<Variable> relevantVariables)
Computes a minimized DNF for a given formula projected to a given set of variables. First a projected canonical DNF of the formula is computed for the given variables. Then for this canonical DNF the Quine-McCluskey algorithm is computed.- Parameters:
formula- the formularelevantVariables- the relevant formulas for the projected canonical DNF- Returns:
- the minimized DNF due to Qune-McCluskey
-
compute
public static Formula compute(Formula formula)
Computes a minimized DNF for a given formula. First the canonical DNF of the formula is computed. Then for this canonical DNF the Quine-McCluskey algorithm is computed.- Parameters:
formula- the formula- Returns:
- the minimized DNF due to Quine-McCluskey
-
compute
public static Formula compute(List<Assignment> models, FormulaFactory f)
Computes a minimized DNF for a given set of models. These models have to represent a canonical DNF of a formula as computed e.g. by the projected model enumeration of a SAT solverSATSolver.enumerateAllModels(Variable[])or by the transformationCanonicalDNFEnumeration.- Parameters:
models- the models of the formulaf- the formula factory- Returns:
- the minimized DNF due to Quine-McCluskey
-
-