Class AbstractBooleanFormulaManager<TFormulaInfo,TType,TEnv,TFuncDecl>
- All Implemented Interfaces:
BooleanFormulaManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FormulaCreator<TFormulaInfo,TType, TEnv, TFuncDecl> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionand(Collection<BooleanFormula> pBits) and(BooleanFormula... pBits) and(BooleanFormula pBits1, BooleanFormula pBits2) Creates a formula representing an AND of the two arguments.protected abstract TFormulaInfoand(TFormulaInfo pParam1, TFormulaInfo pParam2) protected TFormulaInfoandImpl(Collection<TFormulaInfo> pParams) Create an n-ary conjunction.final BooleanFormulaequivalence(BooleanFormula pBits1, BooleanFormula pBits2) Creates a formula representing an equivalence of the two arguments.protected abstract TFormulaInfoequivalence(TFormulaInfo bits1, TFormulaInfo bits2) protected final FormulaCreator<TFormulaInfo,TType, TEnv, TFuncDecl> final <T extends Formula>
TifThenElse(BooleanFormula pBits, T f1, T f2) Creates a formula representing "IF cond THEN f1 ELSE f2".protected abstract TFormulaInfoifThenElse(TFormulaInfo cond, TFormulaInfo f1, TFormulaInfo f2) final BooleanFormulaimplication(BooleanFormula pBits1, BooleanFormula pBits2) protected TFormulaInfoimplication(TFormulaInfo bits1, TFormulaInfo bits2) final booleanisFalse(BooleanFormula pBits) Check, if the formula is the formula "FALSE".protected abstract booleanisFalse(TFormulaInfo bits) final booleanisTrue(BooleanFormula pBits) Check, if the formula is the formula "TRUE".protected abstract booleanisTrue(TFormulaInfo bits) protected abstract TFormulaInfomakeBooleanImpl(boolean value) Shortcut formakeBoolean(false).makeTrue()Shortcut formakeBoolean(true).makeVariable(String pVar) Creates a variable with exactly the given name.protected abstract TFormulaInfomakeVariableImpl(String pVar) not(BooleanFormula pBits) Creates a formula representing a negation of the argument.protected abstract TFormulaInfonot(TFormulaInfo pParam1) or(Collection<BooleanFormula> pBits) or(BooleanFormula... pBits) or(BooleanFormula pBits1, BooleanFormula pBits2) Creates a formula representing an OR of the two arguments.protected abstract TFormulaInfoor(TFormulaInfo pParam1, TFormulaInfo pParam2) protected TFormulaInfoorImpl(Collection<TFormulaInfo> pParams) Create an n-ary disjunction.final Collector<BooleanFormula,?, BooleanFormula> Return a streamCollectorthat creates a conjunction of all elements in the stream.toConjunctionArgs(BooleanFormula f, boolean flatten) Return a set of formulas such that a conjunction over them is equivalent to the input formula.final Collector<BooleanFormula,?, BooleanFormula> Return a streamCollectorthat creates a disjunction of all elements in the stream.toDisjunctionArgs(BooleanFormula f, boolean flatten) Return a set of formulas such that a disjunction over them is equivalent to the input formula.protected final TTypetoSolverType(FormulaType<?> formulaType) Visit the formula recursively with a givenBooleanFormulaVisitor.<R> Rvisit(BooleanFormula pFormula, BooleanFormulaVisitor<R> visitor) Visit the formula with the given visitor.voidvisitRecursively(BooleanFormula pF, BooleanFormulaVisitor<TraversalProcess> pFormulaVisitor) Visit the formula recursively with a givenBooleanFormulaVisitor.xor(BooleanFormula pBits1, BooleanFormula pBits2) Creates a formula representing XOR of the two arguments.protected abstract TFormulaInfoxor(TFormulaInfo pParam1, TFormulaInfo pParam2) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sosy_lab.java_smt.api.BooleanFormulaManager
makeBoolean
-
Field Details
-
formulaCreator
-
-
Constructor Details
-
AbstractBooleanFormulaManager
-
-
Method Details
-
makeVariable
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
-
makeVariableImpl
-
makeTrue
Description copied from interface:BooleanFormulaManagerShortcut formakeBoolean(true).- Specified by:
makeTruein interfaceBooleanFormulaManager
-
makeFalse
Description copied from interface:BooleanFormulaManagerShortcut formakeBoolean(false).- Specified by:
makeFalsein interfaceBooleanFormulaManager
-
makeBooleanImpl
-
not
Description copied from interface:BooleanFormulaManagerCreates a formula representing a negation of the argument.- Specified by:
notin interfaceBooleanFormulaManager- Parameters:
pBits- a Formula- Returns:
!bits
-
not
-
and
Description copied from interface:BooleanFormulaManagerCreates a formula representing an AND of the two arguments.- Specified by:
andin interfaceBooleanFormulaManager- Parameters:
pBits1- a FormulapBits2- a Formula- Returns:
bits1 & bits2
-
and
-
and
- Specified by:
andin interfaceBooleanFormulaManager- See Also:
-
and
- Specified by:
andin interfaceBooleanFormulaManager- See Also:
-
andImpl
Create an n-ary conjunction. The default implementation delegates toand(Object, Object)and assumes that all simplifications are done by that method. This method can be overridden, in which case it should filter out irrelevant operands.- Parameters:
pParams- A collection of at least 3 operands.- Returns:
- A term that is equivalent to a conjunction of pParams.
-
toConjunction
Description copied from interface:BooleanFormulaManagerReturn a streamCollectorthat creates a conjunction of all elements in the stream.- Specified by:
toConjunctionin interfaceBooleanFormulaManager
-
or
Description copied from interface:BooleanFormulaManagerCreates a formula representing an OR of the two arguments.- Specified by:
orin interfaceBooleanFormulaManager- Parameters:
pBits1- a FormulapBits2- a Formula- Returns:
bits1 | bits2
-
or
- Specified by:
orin interfaceBooleanFormulaManager- See Also:
-
or
-
xor
Description copied from interface:BooleanFormulaManagerCreates a formula representing XOR of the two arguments.- Specified by:
xorin interfaceBooleanFormulaManager
-
or
- Specified by:
orin interfaceBooleanFormulaManager- See Also:
-
orImpl
Create an n-ary disjunction. The default implementation delegates toor(Object, Object)and assumes that all simplifications are done by that method. This method can be overridden, in which case it should filter out irrelevant operands.- Parameters:
pParams- A collection of at least 3 operands.- Returns:
- A term that is equivalent to a disjunction of pParams.
-
toDisjunction
Description copied from interface:BooleanFormulaManagerReturn a streamCollectorthat creates a disjunction of all elements in the stream.- Specified by:
toDisjunctionin interfaceBooleanFormulaManager
-
xor
-
equivalence
Creates a formula representing an equivalence of the two arguments.- Specified by:
equivalencein interfaceBooleanFormulaManager- Parameters:
pBits1- a FormulapBits2- a Formula- Returns:
f1 <-> f2
-
equivalence
-
implication
- Specified by:
implicationin interfaceBooleanFormulaManager- Returns:
formula1 => formula2.
-
implication
-
isTrue
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
-
isTrue
-
isFalse
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
-
isFalse
-
ifThenElse
Creates a formula representing "IF cond THEN f1 ELSE f2".- Specified by:
ifThenElsein interfaceBooleanFormulaManager- Parameters:
pBits- a Formulaf1- a Formulaf2- a Formula- Returns:
- (IF cond THEN f1 ELSE f2)
-
ifThenElse
-
visit
Description copied from interface:BooleanFormulaManagerVisit the formula with the given visitor.- Specified by:
visitin interfaceBooleanFormulaManager
-
visitRecursively
public void visitRecursively(BooleanFormula pF, BooleanFormulaVisitor<TraversalProcess> pFormulaVisitor) 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
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
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
-
getFormulaCreator
-
toSolverType
-