3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

fix bug in lexicographic handling in maxres: previous assumptions were not committed in corner cases

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-02-02 10:19:11 -08:00
parent f015e3e4cc
commit 9ca52a3361
5 changed files with 34 additions and 16 deletions

View file

@ -351,6 +351,21 @@ static unsigned parse_opt(std::istream& in, bool is_wcnf) {
case l_false: std::cout << "unsat\n"; break;
case l_undef: std::cout << "unknown\n"; break;
}
DEBUG_CODE(
if (false && r == l_true) {
model_ref mdl;
opt.get_model(mdl);
expr_ref_vector hard(m);
opt.get_hard_constraints(hard);
for (unsigned i = 0; i < hard.size(); ++i) {
std::cout << "validate: " << i << "\n";
expr_ref tmp(m);
VERIFY(mdl->eval(hard[i].get(), tmp));
if (!m.is_true(tmp)) {
std::cout << tmp << "\n";
}
}
});
}
catch (z3_exception & ex) {
std::cerr << ex.msg() << "\n";