mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
add validation option
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c42f0d60e6
commit
86e22c1186
4 changed files with 14 additions and 4 deletions
|
@ -59,6 +59,16 @@ namespace opt {
|
||||||
verbose_stream() << "Satisfying soft constraints\n";
|
verbose_stream() << "Satisfying soft constraints\n";
|
||||||
display_answer(verbose_stream());
|
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;
|
return is_sat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ namespace opt {
|
||||||
lbool is_sat = l_true;
|
lbool is_sat = l_true;
|
||||||
map_t::iterator it = m_maxsmts.begin(), end = m_maxsmts.end();
|
map_t::iterator it = m_maxsmts.begin(), end = m_maxsmts.end();
|
||||||
for (; is_sat == l_true && it != end; ++it) {
|
for (; is_sat == l_true && it != end; ++it) {
|
||||||
maxsmt* ms = it->m_value;
|
maxsmt& ms = *it->m_value;
|
||||||
is_sat = (*ms)(s);
|
is_sat = ms(s);
|
||||||
}
|
}
|
||||||
if (is_sat == l_true) {
|
if (is_sat == l_true) {
|
||||||
is_sat = m_optsmt(s);
|
is_sat = m_optsmt(s);
|
||||||
|
@ -160,5 +160,4 @@ namespace opt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,8 @@ namespace opt {
|
||||||
private:
|
private:
|
||||||
lbool optimize_pareto();
|
lbool optimize_pareto();
|
||||||
lbool optimize_box();
|
lbool optimize_box();
|
||||||
|
|
||||||
|
void validate_feasibility(maxsmt& ms);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -921,7 +921,6 @@ namespace smt {
|
||||||
display(tout, c););
|
display(tout, c););
|
||||||
|
|
||||||
DEBUG_CODE(
|
DEBUG_CODE(
|
||||||
IF_VERBOSE(0, verbose_stream() << s_debug_conflict << "\n";);
|
|
||||||
if (s_debug_conflict) {
|
if (s_debug_conflict) {
|
||||||
resolve_conflict(conseq, c);
|
resolve_conflict(conseq, c);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue