3
0
Fork 0
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:
Nikolaj Bjorner 2013-12-18 05:49:43 +02:00
parent 02f74f1028
commit 72130ac7b9
2 changed files with 5 additions and 1 deletions

View file

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

View file

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