3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00

fix xor handling, and defaults for cardinality

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-03-09 22:44:41 +01:00
parent ac59e7b6d3
commit 5f5819f029
8 changed files with 119 additions and 50 deletions

View file

@ -270,7 +270,6 @@ namespace opt {
#endif
solver& s = get_solver();
s.assert_expr(m_hard_constraints);
display_benchmark();
IF_VERBOSE(1, verbose_stream() << "(optimize:check-sat)\n";);
lbool is_sat = s.check_sat(0,0);
TRACE("opt", tout << "initial search result: " << is_sat << "\n";);
@ -1002,8 +1001,9 @@ namespace opt {
TRACE("opt", tout << "Term does not evaluate " << term << "\n";);
return false;
}
if (!m_arith.is_numeral(val, r)) {
TRACE("opt", tout << "model does not evaluate objective to a value\n";);
unsigned bv_size;
if (!m_arith.is_numeral(val, r) && !m_bv.is_numeral(val, r, bv_size)) {
TRACE("opt", tout << "model does not evaluate objective to a value, but to " << val << "\n";);
return false;
}
if (r != v) {
@ -1199,6 +1199,9 @@ namespace opt {
}
void context::display_benchmark() {
display(verbose_stream());
return;
if (opt_params(m_params).dump_benchmarks() &&
sat_enabled() &&
m_objectives.size() == 1 &&
@ -1208,6 +1211,8 @@ namespace opt {
unsigned sz = o.m_terms.size();
inc_sat_display(verbose_stream(), get_solver(), sz, o.m_terms.c_ptr(), o.m_weights.c_ptr());
}
}
void context::display(std::ostream& out) {