public interface FormulaManager
| Modifier and Type | Method and Description |
|---|---|
BooleanFormula |
applyTactic(BooleanFormula input,
Tactic tactic)
Apply a tactic which performs formula transformation.
|
Appender |
dumpFormula(BooleanFormula pT)
Serialize an input formula to an SMT-LIB format.
|
Map<String,Formula> |
extractVariables(Formula f)
Extract the names of all free variables and UFs in a formula.
|
Map<String,Formula> |
extractVariablesAndUFs(Formula f)
Extract the names of all free variables and UFs in a formula.
|
ArrayFormulaManager |
getArrayFormulaManager()
Returns the Array-Theory.
|
BitvectorFormulaManager |
getBitvectorFormulaManager()
Returns the Bitvector-Theory.
|
BooleanFormulaManager |
getBooleanFormulaManager()
Returns the Boolean-Theory.
|
FloatingPointFormulaManager |
getFloatingPointFormulaManager()
Returns the Floating-Point-Theory.
|
<T extends Formula> |
getFormulaType(T formula)
Returns the type of the given Formula.
|
FunctionFormulaManager |
getFunctionFormulaManager()
Returns the Function-Theory.
|
IntegerFormulaManager |
getIntegerFormulaManager()
Returns the Integer-Theory.
|
QuantifiedFormulaManager |
getQuantifiedFormulaManager()
Returns the interface for handling quantifiers.
|
RationalFormulaManager |
getRationalFormulaManager()
Returns the Rational-Theory.
|
<T extends Formula> |
makeEqual(T pLhs,
T pRhs)
Create a formula representing equality between two formulas of the same
type.
|
<T extends Formula> |
makeVariable(FormulaType<T> formulaType,
String name)
Create variable of the type equal to
formulaType. |
BooleanFormula |
parse(String s)
Parse a boolean formula given as a String in an SMT-LIB file format.
|
<T extends Formula> |
simplify(T input)
Simplify an input formula, while ensuring equivalence.
|
<T extends Formula> |
splitNumeralEqualityIfPossible(T f)
For a numeral (i.e., non-boolean) equality "x = y",
return a list
x<=y, x>=y. |
<T extends Formula> |
substitute(T f,
Map<? extends Formula,? extends Formula> fromToMapping)
Substitute every occurrence of any item from
changeFrom
in formula f to the corresponding occurrence from changeTo. |
<T extends Formula> |
transformRecursively(FormulaTransformationVisitor pFormulaVisitor,
T f)
Visit the formula recursively with a given
FormulaVisitor. |
BooleanFormula |
translate(BooleanFormula other,
SolverContext otherContext)
Translates the formula from another context into the context represented by
this. |
<R> R |
visit(FormulaVisitor<R> rFormulaVisitor,
Formula f)
Visit the formula with a given visitor.
|
void |
visitRecursively(FormulaVisitor<TraversalProcess> rFormulaVisitor,
Formula f)
Visit the formula recursively with a given
FormulaVisitor. |
IntegerFormulaManager getIntegerFormulaManager()
UnsupportedOperationException - If the theory is not supported by the solver.RationalFormulaManager getRationalFormulaManager()
UnsupportedOperationException - If the theory is not supported by the solver.BooleanFormulaManager getBooleanFormulaManager()
ArrayFormulaManager getArrayFormulaManager()
UnsupportedOperationException - If the theory is not supported by the solver.BitvectorFormulaManager getBitvectorFormulaManager()
UnsupportedOperationException - If the theory is not supported by the solver.FloatingPointFormulaManager getFloatingPointFormulaManager()
UnsupportedOperationException - If the theory is not supported by the solver.FunctionFormulaManager getFunctionFormulaManager()
QuantifiedFormulaManager getQuantifiedFormulaManager()
UnsupportedOperationException - If the theory is not supported by the solver.<T extends Formula> BooleanFormula makeEqual(T pLhs, T pRhs)
<T extends Formula> T makeVariable(FormulaType<T> formulaType, String name)
formulaType.formulaType - the type of the variable.name - the name of the variable.<T extends Formula> FormulaType<T> getFormulaType(T formula)
BooleanFormula parse(String s) throws IllegalArgumentException
IllegalArgumentException - If the string cannot be parsed.Appender dumpFormula(BooleanFormula pT)
To get a String, simply call Object.toString()
on the returned object.
This method is lazy and does not create an output string until the returned
object is actually used.
BooleanFormula applyTactic(BooleanFormula input, Tactic tactic) throws InterruptedException
InterruptedException<T extends Formula> T simplify(T input)
For solvers that do not provide a simplification API, an original formula is returned.
input - The input formula<R> R visit(FormulaVisitor<R> rFormulaVisitor, Formula f)
void visitRecursively(FormulaVisitor<TraversalProcess> rFormulaVisitor, Formula f)
FormulaVisitor.
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.
<T extends Formula> T transformRecursively(FormulaTransformationVisitor pFormulaVisitor, T f)
FormulaVisitor.
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.
pFormulaVisitor - Transformation described by the user.Map<String,Formula> extractVariables(Formula f)
f - The input formulaMap<String,Formula> extractVariablesAndUFs(Formula f)
f - The input formula<T extends Formula> T substitute(T f, Map<? extends Formula,? extends Formula> fromToMapping)
changeFrom
in formula f to the corresponding occurrence from changeTo.
E.g. if changeFrom contains a variable a and
changeTo contains a variable b all occurrences of a
will be changed to b in the returned formula.
f - Formula to change.fromToMapping - Mapping of old and new formula parts.BooleanFormula translate(BooleanFormula other, SolverContext otherContext)
this.
Default implementation relies on string serialization
(dumpFormula(BooleanFormula) and parse(String)),
but each solver may implement more efficient translation between its own
contexts.other - Formula belonging to otherContext.otherContext - A different contextthis context.<T extends Formula> List<T> splitNumeralEqualityIfPossible(T f)
x<=y, x>=y.
Otherwise, return the list consisting of the input formula. Note: 1) Returned list always has one or two elements. 2) Conjunction over the returned list is equivalent to the input formula.