3
0
Fork 0
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:
Nikolaj Bjorner 2013-10-17 17:33:43 -07:00
parent f4e2b23238
commit cfedbe3dfd
10 changed files with 248 additions and 18 deletions

View file

@ -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);
// -----------------------------------
//

View file

@ -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.