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)
Creates a variable with exactly the given name.
|
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) |
Collector<BooleanFormula,?,BooleanFormula> |
toConjunction()
Return a stream
Collector that creates a conjunction of all elements in the stream. |
Set<BooleanFormula> |
toConjunctionArgs(BooleanFormula f,
boolean flatten)
Return a set of formulas such that a conjunction over them is equivalent to the input formula.
|
Collector<BooleanFormula,?,BooleanFormula> |
toDisjunction()
Return a stream
Collector that creates a disjunction of all elements in the stream. |
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)
Please make sure that the given name is valid in SMT-LIB2. Take a look at FormulaManager.isValidName(java.lang.String) for further information.
This method does not quote or unquote the given name, but uses the plain name "AS IS".
Formula.toString() can return a different String than the given one.
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 f2.cond - 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)Collector<BooleanFormula,?,BooleanFormula> toConjunction()
Collector that creates a conjunction of all elements in the stream.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)Collector<BooleanFormula,?,BooleanFormula> toDisjunction()
Collector that creates a disjunction of all elements in the stream.BooleanFormula xor(BooleanFormula bits1, BooleanFormula bits2)
@CanIgnoreReturnValue <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, C
flatten - If true, flatten recursively.Set<BooleanFormula> toDisjunctionArgs(BooleanFormula f, boolean flatten)
Example output:
A \/ B \/ C: A, B, C
flatten - If true, flatten recursively.