3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 12:58:44 +00:00

fix overflow bug exposed by #2476

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-08-29 22:33:25 -03:00
parent a8bfab3273
commit de43e05102

View file

@ -1597,6 +1597,9 @@ namespace smt {
value += coeff;
}
}
if (value >= 0) {
display_resolved_lemma(verbose_stream() << "not validated\n");
}
// std::cout << "bound: " << m_bound << " value " << value << " coeffs: " << m_active_vars.size() << " lemma is " << (value >= 0 ? "sat" : "unsat") << "\n";
return value < 0;
}
@ -1804,8 +1807,8 @@ namespace smt {
}
if (g >= 2) {
normalize_active_coeffs();
for (unsigned i = 0; i < m_active_vars.size(); ++i) {
m_coeffs[m_active_vars[i]] /= g;
for (auto v : m_active_vars) {
m_coeffs[v] /= static_cast<int>(g);
}
m_bound = (m_bound + g - 1) / g;
TRACE("pb", display_resolved_lemma(tout << "cut\n"););