public class Optimize extends Z3Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Optimize.Handle<R extends Sort>
Handle to objectives returned by objective functions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Add(Expr<BoolSort>... constraints)
Alias for Assert.
|
void |
Assert(Expr<BoolSort>... constraints)
Assert a constraint (or multiple) into the optimize solver.
|
void |
AssertAndTrack(Expr<BoolSort> constraint,
Expr<BoolSort> p)
Assert a constraint into the optimizer, and track it (in the unsat) core
using the Boolean constant p.
|
Optimize.Handle<?> |
AssertSoft(Expr<BoolSort> constraint,
int weight,
String group)
Assert soft constraint
Return an objective which associates with the group of constraints.
|
Optimize.Handle<?> |
AssertSoft(Expr<BoolSort> constraint,
String weight,
String group)
Assert soft constraint
Return an objective which associates with the group of constraints.
|
Status |
Check(Expr<BoolSort>... assumptions)
Check satisfiability of asserted constraints.
|
void |
fromFile(String file)
Parse an SMT-LIB2 file with optimization objectives and constraints.
|
void |
fromString(String s)
Similar to FromFile.
|
BoolExpr[] |
getAssertions()
The set of asserted formulas.
|
String |
getHelp()
A string that describes all available optimize solver parameters.
|
Model |
getModel()
The model of the last Check.
|
Expr<?>[] |
getObjectives()
The set of asserted formulas.
|
ParamDescrs |
getParameterDescriptions()
Retrieves parameter descriptions for Optimize solver.
|
String |
getReasonUnknown()
Return a string the describes why the last to check returned unknown
|
Statistics |
getStatistics()
Optimize statistics.
|
BoolExpr[] |
getUnsatCore()
The unsat core of the last
Check. |
<R extends Sort> |
MkMaximize(Expr<R> e)
Declare an arithmetical maximization objective.
|
<R extends Sort> |
MkMinimize(Expr<R> e)
Declare an arithmetical minimization objective.
|
void |
Pop()
Backtrack one backtracking point.
|
void |
Push()
Creates a backtracking point.
|
void |
setParameters(Params value)
Sets the optimize solver parameters.
|
String |
toString()
Print the context to a String (SMT-LIB parseable benchmark).
|
arrayLength, arrayToNativepublic String getHelp()
public void setParameters(Params value)
Z3Exceptionpublic ParamDescrs getParameterDescriptions()
public void Assert(Expr<BoolSort>... constraints)
public void AssertAndTrack(Expr<BoolSort> constraint, Expr<BoolSort> p)
#check 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 with assumptions.public Optimize.Handle<?> AssertSoft(Expr<BoolSort> constraint, int weight, String group)
public Optimize.Handle<?> AssertSoft(Expr<BoolSort> constraint, String weight, String group)
public Status Check(Expr<BoolSort>... assumptions)
public void Push()
public void Pop()
public Model getModel()
public BoolExpr[] getUnsatCore()
Check.
Remarks: The unsat core
is a subset of Assumptions The result is empty if
Check was not invoked before, if its results was not
UNSATISFIABLE, or if core production is disabled.Z3Exceptionpublic <R extends Sort> Optimize.Handle<R> MkMaximize(Expr<R> e)
public <R extends Sort> Optimize.Handle<R> MkMinimize(Expr<R> e)
public String getReasonUnknown()
public String toString()
public void fromFile(String file)
public void fromString(String s)
public BoolExpr[] getAssertions()
public Expr<?>[] getObjectives()
public Statistics getStatistics()