mirror of
https://github.com/Z3Prover/z3
synced 2025-04-14 21:08:46 +00:00
fixing bug with optimization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
11010086be
commit
7c8fbbb06a
|
@ -993,7 +993,7 @@ namespace smt {
|
|||
// Optimization
|
||||
//
|
||||
// -----------------------------------
|
||||
virtual bool maximize(theory_var v) { return max_min(v, true); }
|
||||
virtual bool maximize(theory_var v);
|
||||
virtual theory_var add_objective(app* term);
|
||||
virtual inf_eps_rational<inf_rational> get_objective_value(theory_var v);
|
||||
inf_rational m_objective;
|
||||
|
|
|
@ -975,6 +975,13 @@ namespace smt {
|
|||
return internalize_term_core(term);
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
bool theory_arith<Ext>::maximize(theory_var v) {
|
||||
bool r = max_min(v, true);
|
||||
return r || at_upper(v);
|
||||
}
|
||||
|
||||
|
||||
template<typename Ext>
|
||||
inf_eps_rational<inf_rational> theory_arith<Ext>::get_objective_value(theory_var v) {
|
||||
inf_eps_rational<inf_rational> val(m_objective);
|
||||
|
|
Loading…
Reference in a new issue