3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

Replace the use of optional<rational> by inf_eps_rational<rational>

Also handle composite objectives correctly.
This commit is contained in:
Phan Anh Dung 2013-10-19 06:03:21 +02:00
parent a44044fb15
commit 53f78f7d19
9 changed files with 50 additions and 43 deletions

View file

@ -16,7 +16,6 @@ Notes:
--*/
#include "opt_context.h"
#include "fu_malik.h"
#include "weighted_maxsat.h"
@ -62,7 +61,7 @@ namespace opt {
}
if (!m_objectives.empty()) {
vector<optional<rational> > values;
vector<inf_eps_rational<rational> > values;
for (unsigned i = 0; i < fmls_copy.size(); ++i) {
s->assert_expr(fmls_copy[i].get());
}
@ -75,11 +74,7 @@ namespace opt {
}
for (unsigned i = 0; i < values.size(); ++i) {
if (values[i]) {
std::cout << "objective function: " << mk_pp(m_objectives[i].get(), m) << " -> " << *values[i] << "\n";
} else {
std::cout << "objective function: " << mk_pp(m_objectives[i].get(), m) << " -> unbounded\n";
}
std::cout << "objective function: " << mk_pp(m_objectives[i].get(), m) << " -> " << values[i].to_string() << "\n";
}
}