public class Solver extends Z3Object
| Modifier and Type | Method and Description |
|---|---|
void |
add(BoolExpr... constraints)
Assert a multiple constraints into the solver.
|
void |
assertAndTrack(BoolExpr[] constraints,
BoolExpr[] ps)
Assert multiple constraints into the solver, and track them (in the
unsat) core
using the Boolean constants in ps.
|
void |
assertAndTrack(BoolExpr constraint,
BoolExpr p)
Assert a constraint into the solver, and track it (in the unsat) core
using the Boolean constant p.
|
Status |
check()
Checks whether the assertions in the solver are consistent or not.
|
Status |
check(Expr... assumptions)
Checks whether the assertions in the solver are consistent or not.
|
BoolExpr[] |
getAssertions()
The set of asserted formulas.
|
java.lang.String |
getHelp()
A string that describes all available solver parameters.
|
Model |
getModel()
The model of the last
Check. |
int |
getNumAssertions()
The number of assertions in the solver.
|
int |
getNumScopes()
The current number of backtracking points (scopes).
|
ParamDescrs |
getParameterDescriptions()
Retrieves parameter descriptions for solver.
|
Expr |
getProof()
The proof of the last
Check. |
java.lang.String |
getReasonUnknown()
A brief justification of why the last call to
Check returned
UNKNOWN. |
Statistics |
getStatistics()
Solver statistics.
|
BoolExpr[] |
getUnsatCore()
The unsat core of the last
Check. |
void |
pop()
Backtracks one backtracking point.
|
void |
pop(int n)
Backtracks
n backtracking points. |
void |
push()
Creates a backtracking point.
|
void |
reset()
Resets the Solver.
|
void |
setParameters(Params value)
Sets the solver parameters.
|
java.lang.String |
toString()
A string representation of the solver.
|
Solver |
translate(Context ctx)
Create a clone of the current solver with respect to
|
public java.lang.String getHelp()
public void setParameters(Params value)
Z3Exceptionpublic ParamDescrs getParameterDescriptions()
Z3Exceptionpublic int getNumScopes()
public void push()
pop()public void pop()
public void pop(int n)
n backtracking points.
Remarks: Note that
an exception is thrown if n is not smaller than
NumScopespush()public void reset()
public void add(BoolExpr... constraints)
Z3Exceptionpublic void assertAndTrack(BoolExpr[] constraints, BoolExpr[] ps)
check(com.microsoft.z3.Expr...) with assumptions for
extracting unsat cores.
Both APIs can be used in the same solver. The unsat core will contain a
combination
of the Boolean variables provided using assertAndTrack
and the Boolean literals
provided using check(com.microsoft.z3.Expr...) with assumptions.public void assertAndTrack(BoolExpr constraint, BoolExpr p)
check(com.microsoft.z3.Expr...) with assumptions for
extracting unsat cores.
Both APIs can be used in the same solver. The unsat core will contain a
combination
of the Boolean variables provided using assertAndTrack(com.microsoft.z3.BoolExpr[], com.microsoft.z3.BoolExpr[])
and the Boolean literals
provided using check(com.microsoft.z3.Expr...) with assumptions.public int getNumAssertions()
Z3Exceptionpublic BoolExpr[] getAssertions()
Z3Exceptionpublic Status check(Expr... assumptions)
getModel(),
getUnsatCore(),
getProof()public Status check()
getModel(),
getUnsatCore(),
getProof()public Model getModel()
Check.
Remarks: The result is
null if Check was not invoked before, if its
results was not SATISFIABLE, or if model production is not
enabled.Z3Exceptionpublic Expr getProof()
Check.
Remarks: The result is
null if Check was not invoked before, if its
results was not UNSATISFIABLE, or if proof production is
disabled.Z3Exceptionpublic BoolExpr[] getUnsatCore()
Check.
Remarks: The unsat core
is a subset of Assertions The result is empty if
Check was not invoked before, if its results was not
UNSATISFIABLE, or if core production is disabled.Z3Exceptionpublic java.lang.String getReasonUnknown()
Check returned
UNKNOWN.public Solver translate(Context ctx)
public Statistics getStatistics()
Z3Exceptionpublic java.lang.String toString()
toString in class java.lang.Object