Skip to content

Commit

Permalink
add verbose=1 log for mbp failure
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Sep 3, 2022
1 parent 7e1e64d commit 0bdb2f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/qe/mbp/mbp_arith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ namespace mbp {
linearize(mbo, eval, mul, t3, c, fmls, ts, tids);
}
else {
IF_VERBOSE(1, verbose_stream() << "mbp failed on if: " << mk_pp(t, m) << " := " << val << "\n");
throw default_exception("mbp evaluation didn't produce a truth value");
}
}
Expand All @@ -234,8 +235,10 @@ namespace mbp {
else if (a.is_mod(t, t1, t2) && is_numeral(t2, mul1) && !mul1.is_zero()) {
rational r;
val = eval(t);
if (!a.is_numeral(val, r))
if (!a.is_numeral(val, r)) {
IF_VERBOSE(1, verbose_stream() << "mbp failed on " << mk_pp(t, m) << " := " << val << "\n");
throw default_exception("mbp evaluation didn't produce an integer");
}
c += mul * r;

rational c0(-r), mul0(1);
Expand Down Expand Up @@ -335,8 +338,10 @@ namespace mbp {
expr_ref val = eval(v);
if (!m.inc())
return false;
if (!a.is_numeral(val, r))
if (!a.is_numeral(val, r)) {
IF_VERBOSE(1, verbose_stream() << "mbp failed on " << mk_pp(v, m) << " := " << val << "\n");
throw default_exception("evaluation did not produce a numeral");
}
TRACE("qe", tout << mk_pp(v, m) << " " << val << "\n";);
tids.insert(v, mbo.add_var(r, a.is_int(v)));
}
Expand Down Expand Up @@ -623,6 +628,7 @@ namespace mbp {
expr_ref val = eval(v);
if (!a.is_numeral(val, r)) {
TRACE("qe", tout << eval.get_model() << "\n";);
IF_VERBOSE(1, verbose_stream() << "mbp failed on " << mk_pp(v, m) << " := " << val << "\n");
throw default_exception("mbp evaluation was only partial");
}
id = mbo.add_var(r, a.is_int(v));
Expand Down
4 changes: 3 additions & 1 deletion src/qe/mbp/mbp_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ namespace mbp {
bool project_plugin::is_true(model_evaluator& eval, expr* e) {
expr_ref val = eval(e);
bool tt = m.is_true(val);
if (!tt && !m.is_false(val) && contains_uninterpreted(val))
if (!tt && !m.is_false(val) && contains_uninterpreted(val)) {
IF_VERBOSE(1, verbose_stream() << "mbp failed on " << mk_pp(e, m) << " := " << val << "\n");
throw default_exception("could not evaluate Boolean in model");
}
SASSERT(tt || m.is_false(val));
return tt;
}
Expand Down

0 comments on commit 0bdb2f1

Please sign in to comment.