Skip to content

Commit

Permalink
fix regression found by fuzzers fix #6271
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Aug 14, 2022
1 parent 1d87592 commit 138f0d2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/qe/mbp/mbp_arith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,13 @@ namespace mbp {
if (!a.is_numeral(val, r))
throw default_exception("mbp evaluation didn't produce an integer");
c += mul * r;
// t1 mod mul1 == r
vars coeffs;
rational c0 = add_def(t1, mul1, coeffs);
mbo.add_divides(coeffs, c0 - r, mul1);

rational c0(-r), mul0(1);
obj_map<expr, rational> ts0;
linearize(mbo, eval, mul0, t1, c0, fmls, ts0, tids);
vars coeffs;
extract_coefficients(mbo, eval, ts0, tids, coeffs);
mbo.add_divides(coeffs, c0, mul1);
}
else if (false && a.is_mod(t, t1, t2) && is_numeral(t2, mul1) && mul1 > 0) {
// v = t1 mod mul1
Expand Down

0 comments on commit 138f0d2

Please sign in to comment.