3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00

add validation option

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-11-18 09:44:20 -08:00
parent c42f0d60e6
commit 86e22c1186
4 changed files with 14 additions and 4 deletions

View file

@ -59,6 +59,16 @@ namespace opt {
verbose_stream() << "Satisfying soft constraints\n";
display_answer(verbose_stream());
});
DEBUG_CODE(if (is_sat == l_true) {
IF_VERBOSE(0, verbose_stream() << "validating assignment\n";);
m_s->push();
commit_assignment();
VERIFY(is_sat == m_s->check_sat(0,0));
m_s->pop(1);
// TBD: check that all extensions are unsat too
});
return is_sat;
}

View file

@ -70,8 +70,8 @@ namespace opt {
lbool is_sat = l_true;
map_t::iterator it = m_maxsmts.begin(), end = m_maxsmts.end();
for (; is_sat == l_true && it != end; ++it) {
maxsmt* ms = it->m_value;
is_sat = (*ms)(s);
maxsmt& ms = *it->m_value;
is_sat = ms(s);
}
if (is_sat == l_true) {
is_sat = m_optsmt(s);
@ -160,5 +160,4 @@ namespace opt {
}
}
}

View file

@ -60,6 +60,8 @@ namespace opt {
private:
lbool optimize_pareto();
lbool optimize_box();
void validate_feasibility(maxsmt& ms);
};
}

View file

@ -921,7 +921,6 @@ namespace smt {
display(tout, c););
DEBUG_CODE(
IF_VERBOSE(0, verbose_stream() << s_debug_conflict << "\n";);
if (s_debug_conflict) {
resolve_conflict(conseq, c);
});