public abstract class Z3Solver extends Z3Context implements SolverFunctions
Modifier and Type | Class and Description |
---|---|
static class |
Z3Solver.SatResult
Result of a SMT query
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.String> |
contextStatements
We save all the assertions on this stack.
|
private boolean |
enableStatementStack
For every statement that we assert, we can save it on our own stack to
generate the output file.
|
protected boolean |
pushedContext
Context pushed on the stack?
Next thing to do will be a pop.
|
protected int |
statementCountAfterPush
Number of statements asserted after context pushed.
|
protected com.microsoft.z3.Solver |
z3Solver
Z3 Solver Instance.
|
Modifier | Constructor and Description |
---|---|
protected |
Z3Solver()
Build Z3 Solver Object
|
Modifier and Type | Method and Description |
---|---|
com.microsoft.z3.Expr |
addVariableDeclaration(java.lang.String variableName,
java.lang.String variableType)
Declare a variable in Z3 context.
|
Z3Solver.SatResult |
checkSat(int timeOutInSeconds)
Perform a SMT query if the problem is
satisfiable or not.
|
com.microsoft.z3.FuncDecl |
declareFunction(java.lang.String functionName,
java.lang.String[] argumentType,
java.lang.String returnType)
Declare a function in Z3 context.
|
void |
generateAssertion(com.microsoft.z3.BoolExpr expression)
Generate an assertion in Z3 context.
|
void |
generateSatCode(java.lang.String fileName)
Generate a Z3 file with all the constraints in it.
|
java.util.Map<java.lang.String,java.lang.String> |
getModel()
Get model from the Solver
|
private com.microsoft.z3.Sort |
getSort(java.lang.String sortType)
Get a Sort from the Z3.
|
java.lang.String |
getStatistics()
Get Z3 Solver statistics
|
void |
popContext(int scopes)
Get back the context for next query.
|
void |
printContext()
Print the current context of variables and assertions.
|
void |
pushContext()
Save the context.
|
void |
resetSolver()
Reset the Z3 Solver.
|
void |
setTacTicSolver(java.lang.String[] tacticNames)
Instead of default solver, we would want to use tactic solver.
|
check, getModel, getVersion, setRandomSeed
protected com.microsoft.z3.Solver z3Solver
private boolean enableStatementStack
protected java.util.List<java.lang.String> contextStatements
protected boolean pushedContext
protected int statementCountAfterPush
private com.microsoft.z3.Sort getSort(java.lang.String sortType)
sortType
- type of sort in stringpublic com.microsoft.z3.Expr addVariableDeclaration(java.lang.String variableName, java.lang.String variableType)
variableName
- name of the variablevariableType
- type of the variablepublic com.microsoft.z3.FuncDecl declareFunction(java.lang.String functionName, java.lang.String[] argumentType, java.lang.String returnType)
functionName
- name of the functionargumentType
- arguments of the functionreturnType
- return type of the functionpublic void setTacTicSolver(java.lang.String[] tacticNames)
tacticNames
- name of the tactics for the solver.public void generateSatCode(java.lang.String fileName)
fileName
- name of the output file including the pathpublic void printContext()
public void popContext(int scopes)
SolverFunctions
popContext
in interface SolverFunctions
public void pushContext()
SolverFunctions
pushContext
in interface SolverFunctions
public java.util.Map<java.lang.String,java.lang.String> getModel()
SolverFunctions
getModel
in interface SolverFunctions
public void generateAssertion(com.microsoft.z3.BoolExpr expression)
expression
- expresssion to be assertedpublic Z3Solver.SatResult checkSat(int timeOutInSeconds)
SolverFunctions
checkSat
in interface SolverFunctions
timeOutInSeconds
- time out in seconds for the querypublic java.lang.String getStatistics()
public void resetSolver()