public interface BooleanFormulaManager
| Modifier and Type | Method and Description |
|---|---|
BooleanFormula |
and(BooleanFormula... bits) |
BooleanFormula |
and(BooleanFormula bits1,
BooleanFormula bits2)
Creates a formula representing an AND of the two arguments.
|
BooleanFormula |
and(Collection<BooleanFormula> bits) |
BooleanFormula |
equivalence(BooleanFormula formula1,
BooleanFormula formula2)
Creates a formula representing an equivalence of the two arguments.
|
<T extends Formula> |
ifThenElse(BooleanFormula cond,
T f1,
T f2)
Creates a formula representing
IF cond THEN f1 ELSE f2 |
BooleanFormula |
implication(BooleanFormula formula1,
BooleanFormula formula2) |
boolean |
isFalse(BooleanFormula formula)
Check, if the formula is the formula "FALSE".
|
boolean |
isTrue(BooleanFormula formula)
Check, if the formula is the formula "TRUE".
|
BooleanFormula |
makeBoolean(boolean value)
Returns a
BooleanFormula representing the given value. |
BooleanFormula |
makeFalse()
Shortcut for
makeBoolean(false). |
BooleanFormula |
makeTrue()
Shortcut for
makeBoolean(true). |
BooleanFormula |
makeVariable(String pVar) |
BooleanFormula |
not(BooleanFormula bits)
Creates a formula representing a negation of the argument.
|
BooleanFormula |
or(BooleanFormula... bits) |
BooleanFormula |
or(BooleanFormula bits1,
BooleanFormula bits2)
Creates a formula representing an OR of the two arguments.
|
BooleanFormula |
or(Collection<BooleanFormula> bits) |
Set<BooleanFormula> |
toConjunctionArgs(BooleanFormula f,
boolean flatten)
Return a set of formulas such that a conjunction over them
is equivalent to the input formula.
|
Set<BooleanFormula> |
toDisjunctionArgs(BooleanFormula f,
boolean flatten)
Return a set of formulas such that a disjunction over them
is equivalent to the input formula.
|
BooleanFormula |
transformRecursively(BooleanFormula f,
BooleanFormulaTransformationVisitor pVisitor)
Visit the formula recursively with a given
BooleanFormulaVisitor. |
<R> R |
visit(BooleanFormula pFormula,
BooleanFormulaVisitor<R> visitor)
Visit the formula with the given visitor.
|
void |
visitRecursively(BooleanFormula f,
BooleanFormulaVisitor<TraversalProcess> rFormulaVisitor)
Visit the formula recursively with a given
BooleanFormulaVisitor. |
BooleanFormula |
xor(BooleanFormula bits1,
BooleanFormula bits2)
Creates a formula representing XOR of the two arguments.
|
BooleanFormula makeBoolean(boolean value)
BooleanFormula representing the given value.value - the boolean value the returned Formula should representBooleanFormula makeTrue()
makeBoolean(true).BooleanFormula makeFalse()
makeBoolean(false).BooleanFormula makeVariable(String pVar)
BooleanFormula equivalence(BooleanFormula formula1, BooleanFormula formula2)
formula1 - a Formulaformula2 - a Formulaformula1 <-> formula2BooleanFormula implication(BooleanFormula formula1, BooleanFormula formula2)
formula1 => formula2.boolean isTrue(BooleanFormula formula)
boolean isFalse(BooleanFormula formula)
<T extends Formula> T ifThenElse(BooleanFormula cond, T f1, T f2)
IF cond THEN f1 ELSE f2cond - a Formulaf1 - a Formulaf2 - a FormulaBooleanFormula not(BooleanFormula bits)
bits - a Formula!bitsBooleanFormula and(BooleanFormula bits1, BooleanFormula bits2)
bits1 - a Formulabits2 - a Formulabits1 & bits2BooleanFormula and(Collection<BooleanFormula> bits)
and(BooleanFormula, BooleanFormula)BooleanFormula and(BooleanFormula... bits)
and(BooleanFormula, BooleanFormula)BooleanFormula or(BooleanFormula bits1, BooleanFormula bits2)
bits1 - a Formulabits2 - a Formulabits1 | bits2BooleanFormula or(Collection<BooleanFormula> bits)
or(BooleanFormula, BooleanFormula)BooleanFormula or(BooleanFormula... bits)
or(BooleanFormula, BooleanFormula)BooleanFormula xor(BooleanFormula bits1, BooleanFormula bits2)
<R> R visit(BooleanFormula pFormula, BooleanFormulaVisitor<R> visitor)
void visitRecursively(BooleanFormula f, BooleanFormulaVisitor<TraversalProcess> rFormulaVisitor)
BooleanFormulaVisitor.
This method guarantees that the traversal is done iteratively, without using Java recursion, and thus is not prone to StackOverflowErrors.
Furthermore, this method also guarantees that every equal part of the formula is visited only once. Thus it can be used to traverse DAG-like formulas efficiently.
BooleanFormula transformRecursively(BooleanFormula f, BooleanFormulaTransformationVisitor pVisitor)
BooleanFormulaVisitor.
The arguments each visitor method receives are already transformed.
This method guarantees that the traversal is done iteratively, without using Java recursion, and thus is not prone to StackOverflowErrors.
Furthermore, this method also guarantees that every equal part of the formula is visited only once. Thus it can be used to traverse DAG-like formulas efficiently.
Set<BooleanFormula> toConjunctionArgs(BooleanFormula f, boolean flatten)
Example output:
A /\ B /\ C: A, B, Cflatten - If true, flatten recursively.Set<BooleanFormula> toDisjunctionArgs(BooleanFormula f, boolean flatten)
Example output:
A \/ B \/ C: A, B, Cflatten - If true, flatten recursively.