mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 10:25:18 +00:00
fix lower bound update
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
02f74f1028
commit
72130ac7b9
|
@ -424,6 +424,10 @@ namespace opt {
|
|||
objective const& obj = m_objectives[i];
|
||||
switch(obj.m_type) {
|
||||
case O_MINIMIZE:
|
||||
if (m_model->eval(obj.m_term, val) && a.is_numeral(val, r)) {
|
||||
m_optsmt.update_lower(obj.m_index, -r);
|
||||
}
|
||||
break;
|
||||
case O_MAXIMIZE:
|
||||
if (m_model->eval(obj.m_term, val) && a.is_numeral(val, r)) {
|
||||
m_optsmt.update_lower(obj.m_index, r);
|
||||
|
|
|
@ -117,6 +117,7 @@ namespace opt {
|
|||
|
||||
void optsmt::update_lower(unsigned idx, rational const& r) {
|
||||
inf_eps v(r);
|
||||
std::cout << "update lower: " << r << "\n";
|
||||
if (m_lower[idx] < v) {
|
||||
m_lower[idx] = v;
|
||||
if (m_s) m_s->get_model(m_model);
|
||||
|
@ -322,7 +323,6 @@ namespace opt {
|
|||
|
||||
std::ostream& optsmt::display_objective(std::ostream& out, unsigned i) const {
|
||||
bool is_max = m_is_max[i];
|
||||
inf_eps val = get_lower(i);
|
||||
expr_ref obj(m_objs[i], m);
|
||||
if (!is_max) {
|
||||
arith_util a(m);
|
||||
|
|
Loading…
Reference in a new issue