Class DebuggingBooleanFormulaManager
- java.lang.Object
-
- org.sosy_lab.java_smt.delegate.debugging.DebuggingBooleanFormulaManager
-
- All Implemented Interfaces:
BooleanFormulaManager
public class DebuggingBooleanFormulaManager extends Object implements BooleanFormulaManager
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanFormulaand(Collection<BooleanFormula> bits)BooleanFormulaand(BooleanFormula... bits)BooleanFormulaand(BooleanFormula bits1, BooleanFormula bits2)Creates a formula representing an AND of the two arguments.BooleanFormulaequivalence(BooleanFormula formula1, BooleanFormula formula2)Creates a formula representing an equivalence of the two arguments.<T extends Formula>
TifThenElse(BooleanFormula cond, T f1, T f2)Creates a formula representingIF cond THEN f1 ELSE f2.BooleanFormulaimplication(BooleanFormula formula1, BooleanFormula formula2)booleanisFalse(BooleanFormula formula)Check, if the formula is the formula "FALSE".booleanisTrue(BooleanFormula formula)Check, if the formula is the formula "TRUE".BooleanFormulamakeFalse()Shortcut formakeBoolean(false).BooleanFormulamakeTrue()Shortcut formakeBoolean(true).BooleanFormulamakeVariable(String pVar)Creates a variable with exactly the given name.BooleanFormulanot(BooleanFormula bits)Creates a formula representing a negation of the argument.BooleanFormulaor(Collection<BooleanFormula> bits)BooleanFormulaor(BooleanFormula... bits)BooleanFormulaor(BooleanFormula bits1, BooleanFormula bits2)Creates a formula representing an OR of the two arguments.Collector<BooleanFormula,?,BooleanFormula>toConjunction()Return a streamCollectorthat 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 streamCollectorthat 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.BooleanFormulatransformRecursively(BooleanFormula f, BooleanFormulaTransformationVisitor pVisitor)Visit the formula recursively with a givenBooleanFormulaVisitor.<R> Rvisit(BooleanFormula pFormula, BooleanFormulaVisitor<R> visitor)Visit the formula with the given visitor.voidvisitRecursively(BooleanFormula f, BooleanFormulaVisitor<TraversalProcess> rFormulaVisitor)Visit the formula recursively with a givenBooleanFormulaVisitor.BooleanFormulaxor(BooleanFormula bits1, BooleanFormula bits2)Creates a formula representing XOR of the two arguments.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sosy_lab.java_smt.api.BooleanFormulaManager
makeBoolean
-
-
-
-
Method Detail
-
makeTrue
public BooleanFormula makeTrue()
Description copied from interface:BooleanFormulaManagerShortcut formakeBoolean(true).- Specified by:
makeTruein interfaceBooleanFormulaManager
-
makeFalse
public BooleanFormula makeFalse()
Description copied from interface:BooleanFormulaManagerShortcut formakeBoolean(false).- Specified by:
makeFalsein interfaceBooleanFormulaManager
-
makeVariable
public BooleanFormula makeVariable(String pVar)
Description copied from interface:BooleanFormulaManagerCreates a variable with exactly the given name.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.- Specified by:
makeVariablein interfaceBooleanFormulaManager
-
equivalence
public BooleanFormula equivalence(BooleanFormula formula1, BooleanFormula formula2)
Description copied from interface:BooleanFormulaManagerCreates a formula representing an equivalence of the two arguments.- Specified by:
equivalencein interfaceBooleanFormulaManager- Parameters:
formula1- a Formulaformula2- a Formula- Returns:
formula1 <-> formula2
-
implication
public BooleanFormula implication(BooleanFormula formula1, BooleanFormula formula2)
- Specified by:
implicationin interfaceBooleanFormulaManager- Returns:
formula1 => formula2.
-
isTrue
public boolean isTrue(BooleanFormula formula)
Description copied from interface:BooleanFormulaManagerCheck, if the formula is the formula "TRUE". This does not include a satisfiability check, but only a syntactical matching. However, depending on the SMT solver, there might be some pre-processing of formulas such that trivial cases like "1==1" are recognized and rewritten as "TRUE", and thus such formulas might also be matched.- Specified by:
isTruein interfaceBooleanFormulaManager
-
isFalse
public boolean isFalse(BooleanFormula formula)
Description copied from interface:BooleanFormulaManagerCheck, if the formula is the formula "FALSE". This does not include a satisfiability check, but only a syntactical matching. However, depending on the SMT solver, there might be some pre-processing of formulas such that trivial cases like "1==2" are recognized and rewritten as "FALSE", and thus such formulas might also be matched.- Specified by:
isFalsein interfaceBooleanFormulaManager
-
ifThenElse
public <T extends Formula> T ifThenElse(BooleanFormula cond, T f1, T f2)
Description copied from interface:BooleanFormulaManagerCreates a formula representingIF cond THEN f1 ELSE f2.- Specified by:
ifThenElsein interfaceBooleanFormulaManager- Parameters:
cond- a Formulaf1- a Formulaf2- a Formula- Returns:
- (IF cond THEN f1 ELSE f2)
-
not
public BooleanFormula not(BooleanFormula bits)
Description copied from interface:BooleanFormulaManagerCreates a formula representing a negation of the argument.- Specified by:
notin interfaceBooleanFormulaManager- Parameters:
bits- a Formula- Returns:
!bits
-
and
public BooleanFormula and(BooleanFormula bits1, BooleanFormula bits2)
Description copied from interface:BooleanFormulaManagerCreates a formula representing an AND of the two arguments.- Specified by:
andin interfaceBooleanFormulaManager- Parameters:
bits1- a Formulabits2- a Formula- Returns:
bits1 & bits2
-
and
public BooleanFormula and(Collection<BooleanFormula> bits)
- Specified by:
andin interfaceBooleanFormulaManager- See Also:
BooleanFormulaManager.and(BooleanFormula, BooleanFormula)
-
and
public BooleanFormula and(BooleanFormula... bits)
- Specified by:
andin interfaceBooleanFormulaManager- See Also:
BooleanFormulaManager.and(BooleanFormula, BooleanFormula)
-
toConjunction
public Collector<BooleanFormula,?,BooleanFormula> toConjunction()
Description copied from interface:BooleanFormulaManagerReturn a streamCollectorthat creates a conjunction of all elements in the stream.- Specified by:
toConjunctionin interfaceBooleanFormulaManager
-
or
public BooleanFormula or(BooleanFormula bits1, BooleanFormula bits2)
Description copied from interface:BooleanFormulaManagerCreates a formula representing an OR of the two arguments.- Specified by:
orin interfaceBooleanFormulaManager- Parameters:
bits1- a Formulabits2- a Formula- Returns:
bits1 | bits2
-
or
public BooleanFormula or(Collection<BooleanFormula> bits)
- Specified by:
orin interfaceBooleanFormulaManager- See Also:
BooleanFormulaManager.or(BooleanFormula, BooleanFormula)
-
or
public BooleanFormula or(BooleanFormula... bits)
- Specified by:
orin interfaceBooleanFormulaManager- See Also:
BooleanFormulaManager.or(BooleanFormula, BooleanFormula)
-
toDisjunction
public Collector<BooleanFormula,?,BooleanFormula> toDisjunction()
Description copied from interface:BooleanFormulaManagerReturn a streamCollectorthat creates a disjunction of all elements in the stream.- Specified by:
toDisjunctionin interfaceBooleanFormulaManager
-
xor
public BooleanFormula xor(BooleanFormula bits1, BooleanFormula bits2)
Description copied from interface:BooleanFormulaManagerCreates a formula representing XOR of the two arguments.- Specified by:
xorin interfaceBooleanFormulaManager
-
visit
public <R> R visit(BooleanFormula pFormula, BooleanFormulaVisitor<R> visitor)
Description copied from interface:BooleanFormulaManagerVisit the formula with the given visitor.- Specified by:
visitin interfaceBooleanFormulaManager
-
visitRecursively
public void visitRecursively(BooleanFormula f, BooleanFormulaVisitor<TraversalProcess> rFormulaVisitor)
Description copied from interface:BooleanFormulaManagerVisit the formula recursively with a givenBooleanFormulaVisitor.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.
- Specified by:
visitRecursivelyin interfaceBooleanFormulaManager
-
transformRecursively
public BooleanFormula transformRecursively(BooleanFormula f, BooleanFormulaTransformationVisitor pVisitor)
Description copied from interface:BooleanFormulaManagerVisit the formula recursively with a givenBooleanFormulaVisitor. 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.
- Specified by:
transformRecursivelyin interfaceBooleanFormulaManager
-
toConjunctionArgs
public Set<BooleanFormula> toConjunctionArgs(BooleanFormula f, boolean flatten)
Description copied from interface:BooleanFormulaManagerReturn a set of formulas such that a conjunction over them is equivalent to the input formula.Example output:
- For conjunction
A /\ B /\ C:A, B, C - For "true": empty set.
- For anything else: singleton set consisting of the input formula.
- Specified by:
toConjunctionArgsin interfaceBooleanFormulaManagerflatten- Iftrue, flatten recursively.
- For conjunction
-
toDisjunctionArgs
public Set<BooleanFormula> toDisjunctionArgs(BooleanFormula f, boolean flatten)
Description copied from interface:BooleanFormulaManagerReturn a set of formulas such that a disjunction over them is equivalent to the input formula.Example output:
- For conjunction
A \/ B \/ C:A, B, C - For "false": empty set.
- For anything else: singleton set consisting of the input formula.
- Specified by:
toDisjunctionArgsin interfaceBooleanFormulaManagerflatten- Iftrue, flatten recursively.
- For conjunction
-
-