- java.lang.Object
-
- org.logicng.knowledgecompilation.bdds.BDDFactory
-
public final class BDDFactory extends Object
The factory for the jBuddy implementation.- Since:
- 1.4.0
- Version:
- 2.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BDDbuild(Formula formula)Builds a BDD for a given formula.static BDDbuild(Formula formula, BDDKernel kernel)Builds a BDD for a given formula.static BDDbuild(Formula formula, BDDKernel kernel, BDDHandler handler)Builds a BDD for a given formula.
-
-
-
Method Detail
-
build
public static BDD build(Formula formula)
Builds a BDD for a given formula. BDDs support all Boolean formula types but not pseudo-Boolean constraints. The reason is that before converting a formula to a BDD one must specify the number of variables. In case of pseudo-Boolean constraints this number depends on the translation of the constraint. Therefore, the caller first has to transform any pseudo-Boolean constraints in their respective CNF representation before converting them to a BDD.- Parameters:
formula- the formula- Returns:
- the top node of the BDD
-
build
public static BDD build(Formula formula, BDDKernel kernel)
Builds a BDD for a given formula. BDDs support all Boolean formula types but not pseudo-Boolean constraints. The reason is that before converting a formula to a BDD one must specify the number of variables. In case of pseudo-Boolean constraints this number depends on the translation of the constraint. Therefore, the caller first has to transform any pseudo-Boolean constraints in their respective CNF representation before converting them to a BDD.- Parameters:
formula- the formulakernel- the BBD kernel to use- Returns:
- the top node of the BDD or
BDDKernel.BDD_ABORTif the computation was aborted
-
build
public static BDD build(Formula formula, BDDKernel kernel, BDDHandler handler)
Builds a BDD for a given formula. BDDs support all Boolean formula types but not pseudo-Boolean constraints. The reason is that before converting a formula to a BDD one must specify the number of variables. In case of pseudo-Boolean constraints this number depends on the translation of the constraint. Therefore, the caller first has to transform any pseudo-Boolean constraints in their respective CNF representation before converting them to a BDD.If a BDD handler is given and the BDD generation is aborted due to the handler, the method will return
BDDKernel.BDD_ABORTas result. Ifnullis passed as handler, the generation will continue without interruption.- Parameters:
formula- the formulakernel- the BBD kernel to usehandler- the BDD handler- Returns:
- the top node of the BDD or
BDDKernel.BDD_ABORTif the computation was aborted
-
-