Object for managing optimization context. More...
Inheritance diagram for Optimize:Data Structures | |
| class | Handle |
| Handle to objectives returned by objective functions. More... | |
Public Member Functions | |
| void | Set (string name, bool value) |
| Sets parameter on the optimize solver. | |
| void | Set (string name, uint value) |
| Sets parameter on the optimize solver. | |
| void | Set (string name, double value) |
| Sets parameter on the optimize solver. | |
| void | Set (string name, string value) |
| Sets parameter on the optimize solver. | |
| void | Set (string name, Symbol value) |
| Sets parameter on the optimize solver. | |
| void | Set (Symbol name, bool value) |
| Sets parameter on the optimize solver. | |
| void | Set (Symbol name, uint value) |
| Sets parameter on the optimize solver. | |
| void | Set (Symbol name, double value) |
| Sets parameter on the optimize solver. | |
| void | Set (Symbol name, string value) |
| Sets parameter on the optimize solver. | |
| void | Set (Symbol name, Symbol value) |
| Sets parameter on the optimize solver. | |
| void | Assert (params BoolExpr[] constraints) |
| Assert a constraint (or multiple) into the optimize solver. | |
| void | Assert (IEnumerable< BoolExpr > constraints) |
| Assert a constraint (or multiple) into the optimize solver. | |
| void | Add (params BoolExpr[] constraints) |
| Alias for Assert. | |
| void | Add (IEnumerable< BoolExpr > constraints) |
| Alias for Assert. | |
| void | AssertAndTrack (BoolExpr constraint, BoolExpr p) |
| Assert a constraint into the optimize solver, and track it (in the unsat) core using the Boolean constant p. | |
| Handle | AssertSoft (BoolExpr constraint, uint weight, string group) |
| Assert soft constraint. | |
| Status | Check (params Expr[] assumptions) |
| Check satisfiability of asserted constraints. Produce a model that (when the objectives are bounded and don't use strict inequalities) is optimal. | |
| void | Push () |
| Creates a backtracking point. | |
| void | Pop () |
| Backtrack one backtracking point. | |
| Handle | MkMaximize (Expr e) |
| Declare an arithmetical maximization objective. Return a handle to the objective. The handle is used as to retrieve the values of objectives after calling Check. The expression can be either an arithmetical expression or bit-vector. | |
| Handle | MkMinimize (Expr e) |
| Declare an arithmetical minimization objective. Similar to MkMaximize. | |
| override string | ToString () |
| Print the context to a string (SMT-LIB parseable benchmark). | |
| void | FromFile (string file) |
| Parse an SMT-LIB2 file with optimization objectives and constraints. The parsed constraints and objectives are added to the optimization context. | |
| void | FromString (string s) |
| Similar to FromFile. Instead it takes as argument a string. | |
Public Member Functions inherited from Z3Object | |
| void | Dispose () |
| Disposes of the underlying native Z3 object. | |
Properties | |
| string | Help [get] |
| A string that describes all available optimize solver parameters. | |
| Params | Parameters [set] |
| Sets the optimize solver parameters. | |
| ParamDescrs | ParameterDescriptions [get] |
| Retrieves parameter descriptions for Optimize solver. | |
| Model | Model [get] |
The model of the last Check. | |
| BoolExpr[] | UnsatCore [get] |
The unsat core of the last Check. | |
| String | ReasonUnknown [get] |
| Return a string the describes why the last to check returned unknown. | |
| BoolExpr[] | Assertions [get] |
| The set of asserted formulas. | |
| Expr[] | Objectives [get] |
| The set of asserted formulas. | |
| Statistics | Statistics [get] |
| Optimize statistics. | |
Properties inherited from Z3Object | |
| Context | Context [get] |
| Access Context object. | |
Object for managing optimization context.
Definition at line 30 of file Optimize.cs.
|
inline |
Alias for Assert.
Definition at line 132 of file Optimize.cs.
|
inline |
Alias for Assert.
Definition at line 124 of file Optimize.cs.
|
inline |
Assert a constraint (or multiple) into the optimize solver.
Definition at line 116 of file Optimize.cs.
|
inline |
Assert a constraint (or multiple) into the optimize solver.
Definition at line 108 of file Optimize.cs.
Assert a constraint into the optimize solver, and track it (in the unsat) core using the Boolean constant p.
This API is an alternative to Check(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(BoolExpr,BoolExpr) and the Boolean literals provided using Check(Expr[]) with assumptions.
Definition at line 163 of file Optimize.cs.
Assert soft constraint.
Return an objective which associates with the group of constraints.
Definition at line 234 of file Optimize.cs.
Check satisfiability of asserted constraints. Produce a model that (when the objectives are bounded and don't use strict inequalities) is optimal.
Definition at line 248 of file Optimize.cs.
|
inline |
Parse an SMT-LIB2 file with optimization objectives and constraints. The parsed constraints and objectives are added to the optimization context.
Definition at line 400 of file Optimize.cs.
|
inline |
Similar to FromFile. Instead it takes as argument a string.
Definition at line 408 of file Optimize.cs.
Declare an arithmetical maximization objective. Return a handle to the objective. The handle is used as to retrieve the values of objectives after calling Check. The expression can be either an arithmetical expression or bit-vector.
Definition at line 325 of file Optimize.cs.
Declare an arithmetical minimization objective. Similar to MkMaximize.
Definition at line 334 of file Optimize.cs.
|
inline |
Backtrack one backtracking point.
Note that an exception is thrown if Pop is called without a corresponding Push
Definition at line 276 of file Optimize.cs.
|
inline |
|
inline |
Sets parameter on the optimize solver.
Definition at line 59 of file Optimize.cs.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Print the context to a string (SMT-LIB parseable benchmark).
Definition at line 391 of file Optimize.cs.
|
get |
The set of asserted formulas.
Definition at line 416 of file Optimize.cs.
|
get |
A string that describes all available optimize solver parameters.
Definition at line 35 of file Optimize.cs.
The model of the last Check.
The result is null if Check was not invoked before, if its results was not SATISFIABLE, or if model production is not enabled.
Definition at line 289 of file Optimize.cs.
|
get |
The set of asserted formulas.
Definition at line 429 of file Optimize.cs.
|
get |
Retrieves parameter descriptions for Optimize solver.
Definition at line 100 of file Optimize.cs.
|
set |
Sets the optimize solver parameters.
Definition at line 46 of file Optimize.cs.
Referenced by Optimize.Set(), Optimize.Set(), Optimize.Set(), Optimize.Set(), Optimize.Set(), Optimize.Set(), Optimize.Set(), Optimize.Set(), Optimize.Set(), and Optimize.Set().
|
get |
Return a string the describes why the last to check returned unknown.
Definition at line 379 of file Optimize.cs.
|
get |
Optimize statistics.
Definition at line 443 of file Optimize.cs.
|
get |
The unsat core of the last Check.
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.
Definition at line 309 of file Optimize.cs.