Package com.microsoft.z3
Class Solver
java.lang.Object
com.microsoft.z3.Z3Object
com.microsoft.z3.Solver
Solvers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAssert a multiple constraints into the solver.voidassertAndTrack(Expr<BoolSort>[] constraints, Expr<BoolSort>[] ps) Assert multiple constraints into the solver, and track them (in the unsat) core using the Boolean constants in ps.voidassertAndTrack(Expr<BoolSort> constraint, Expr<BoolSort> p) Assert a constraint into the solver, and track it (in the unsat) core using the Boolean constant p.check()Checks whether the assertions in the solver are consistent or not.final StatusChecks whether the assertions in the solver are consistent or not.voidvoidfromString(String str) BoolExpr[]The set of asserted formulas.getConsequences(Expr<BoolSort>[] assumptions, Expr<?>[] variables, List<Expr<BoolSort>> consequences) Retrieve fixed assignments to the set of variables in the form of consequences.getHelp()A string that describes all available solver parameters.getModel()The model of the lastCheck.intThe number of assertions in the solver.intThe current number of backtracking points (scopes).Retrieves parameter descriptions for solver.Expr<?>getProof()The proof of the lastCheck.A brief justification of why the last call toCheckreturnedUNKNOWN.Solver statistics.BoolExpr[]The unsat core of the lastCheck.voidInterrupt the execution of the solver object.voidpop()Backtracks one backtracking point.voidpop(int n) Backtracksnbacktracking points.voidpush()Creates a backtracking point.voidreset()Resets the Solver.voidsetParameters(Params value) Sets the solver parameters.toString()A string representation of the solver.Create a clone of the current solver with respect toctx.Methods inherited from class com.microsoft.z3.Z3Object
arrayLength, arrayToNative
-
Method Details
-
getHelp
A string that describes all available solver parameters. -
setParameters
Sets the solver parameters.- Throws:
Z3Exception
-
getParameterDescriptions
Retrieves parameter descriptions for solver.- Throws:
Z3Exception
-
getNumScopes
public int getNumScopes()The current number of backtracking points (scopes). -
push
public void push()Creates a backtracking point.- See Also:
-
pop
public void pop()Backtracks one backtracking point. Remarks: . -
pop
public void pop(int n) Backtracksnbacktracking points. Remarks: Note that an exception is thrown ifnis not smaller thanNumScopes- See Also:
-
reset
public void reset()Resets the Solver. Remarks: This removes all assertions from the solver. -
interrupt
public void interrupt()Interrupt the execution of the solver object. Remarks: This ensures that the interrupt applies only to the given solver object and it applies only if it is running. -
add
Assert a multiple constraints into the solver.- Throws:
Z3Exception
-
assertAndTrack
Assert multiple constraints into the solver, and track them (in the unsat) core using the Boolean constants in ps. Remarks: This API is an alternative tocheck()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#assertAndTrackand the Boolean literals provided usingcheck()with assumptions. -
assertAndTrack
Assert a constraint into the solver, and track it (in the unsat) core using the Boolean constant p. Remarks: This API is an alternative tocheck(com.microsoft.z3.Expr<com.microsoft.z3.BoolSort>...)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 usingassertAndTrack(com.microsoft.z3.Expr<com.microsoft.z3.BoolSort>[], com.microsoft.z3.Expr<com.microsoft.z3.BoolSort>[])and the Boolean literals provided usingcheck(com.microsoft.z3.Expr<com.microsoft.z3.BoolSort>...)with assumptions. -
fromFile
-
fromString
-
getNumAssertions
public int getNumAssertions()The number of assertions in the solver.- Throws:
Z3Exception
-
getAssertions
The set of asserted formulas.- Throws:
Z3Exception
-
check
Checks whether the assertions in the solver are consistent or not. Remarks:- See Also:
-
check
Checks whether the assertions in the solver are consistent or not. Remarks:- See Also:
-
getConsequences
public Status getConsequences(Expr<BoolSort>[] assumptions, Expr<?>[] variables, List<Expr<BoolSort>> consequences) Retrieve fixed assignments to the set of variables in the form of consequences. Each consequence is an implication of the form relevant-assumptions Implies variable = value where the relevant assumptions is a subset of the assumptions that are passed in and the equality on the right side of the implication indicates how a variable is fixed. -
getModel
The model of the lastCheck. Remarks: The result isnullifCheckwas not invoked before, if its results was notSATISFIABLE, or if model production is not enabled.- Throws:
Z3Exception
-
getProof
The proof of the lastCheck. Remarks: The result isnullifCheckwas not invoked before, if its results was notUNSATISFIABLE, or if proof production is disabled.- Throws:
Z3Exception
-
getUnsatCore
The unsat core of the lastCheck. Remarks: The unsat core is a subset ofAssertionsThe result is empty ifCheckwas not invoked before, if its results was notUNSATISFIABLE, or if core production is disabled.- Throws:
Z3Exception
-
getReasonUnknown
A brief justification of why the last call toCheckreturnedUNKNOWN. -
translate
Create a clone of the current solver with respect toctx. -
getStatistics
Solver statistics.- Throws:
Z3Exception
-
toString
A string representation of the solver.
-