mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
add opt_solver layer
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f4e2b23238
commit
cfedbe3dfd
10 changed files with 248 additions and 18 deletions
|
@ -985,6 +985,15 @@ namespace smt {
|
|||
// -----------------------------------
|
||||
virtual bool get_value(enode * n, expr_ref & r);
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
// Optimization
|
||||
//
|
||||
// -----------------------------------
|
||||
|
||||
void min(theory_var v);
|
||||
theory_var set_objective(app* term);
|
||||
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
|
|
@ -948,6 +948,24 @@ namespace smt {
|
|||
return x_i;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief minimize the given variable.
|
||||
TODO: max_min returns a bool. What does this do?
|
||||
*/
|
||||
template<typename Ext>
|
||||
void theory_arith<Ext>::min(theory_var v) {
|
||||
max_min(v, false);
|
||||
}
|
||||
|
||||
// set_objective(expr* term) internalizes the arithmetic term and creates
|
||||
// a row for it if it is not already internalized. Then return the variable
|
||||
// corresponding to the term.
|
||||
// TODO handle case where internalize fails. e.g., check for this in a suitable way.
|
||||
template<typename Ext>
|
||||
theory_var theory_arith<Ext>::set_objective(app* term) {
|
||||
return internalize_term_core(term);
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Maximize (Minimize) the given temporary row.
|
||||
Return true if succeeded.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue