3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +00:00

Updated optimization ML API. Addresses #776.

This commit is contained in:
Christoph M. Wintersteiger 2016-11-04 21:22:01 +00:00
parent e7f7090a01
commit 81fce55d78
2 changed files with 34 additions and 14 deletions

View file

@ -3236,33 +3236,28 @@ sig
(** Asssert a soft constraint.
Supply integer weight and string that identifies a group
of soft constraints.
*)
of soft constraints. *)
val add_soft : optimize -> Expr.expr -> string -> Symbol.symbol -> handle
(** Add maximization objective.
*)
(** Add maximization objective. *)
val maximize : optimize -> Expr.expr -> handle
(** Add minimization objective.
*)
(** Add minimization objective. *)
val minimize : optimize -> Expr.expr -> handle
(** Checks whether the assertions in the context are satisfiable and solves objectives.
*)
(** Checks whether the assertions in the context are satisfiable and solves objectives. *)
val check : optimize -> Solver.status
(** Retrieve model from satisfiable context *)
val get_model : optimize -> Model.model option
(** Retrieve lower bound in current model for handle *)
val get_lower : handle -> int -> Expr.expr
val get_lower : handle -> Expr.expr
(** Retrieve upper bound in current model for handle *)
val get_upper : handle -> int -> Expr.expr
val get_upper : handle -> Expr.expr
(** Creates a backtracking point.
{!pop} *)
(** Creates a backtracking point. {!pop} *)
val push : optimize -> unit
(** Backtrack one backtracking point.
@ -3278,6 +3273,27 @@ sig
(** Retrieve statistics information from the last call to check *)
val get_statistics : optimize -> Statistics.statistics
(** Parse an SMT-LIB2 file with assertions, soft constraints and optimization
objectives. Add the parsed constraints and objectives to the optimization
context. *)
val from_file : optimize -> string -> unit
(** Parse an SMT-LIB2 string with assertions, soft constraints and optimization
objectives. Add the parsed constraints and objectives to the optimization
context. *)
val from_string : optimize -> string -> unit
(** Return the set of asserted formulas on the optimization context. *)
val get_assertions : optimize -> Expr.expr list
(** Return objectives on the optimization context. If the objective function
is a max-sat objective it is returned as a Pseudo-Boolean (minimization)
sum of the form (+ (if f1 w1 0) (if f2 w2 0) ...). If the objective
function is entered as a maximization objective, then return the
corresponding minimization objective. In this way the resulting
objective function is always returned as a minimization objective. *)
val get_objectives : optimize -> Expr.expr list
end