3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

add diagnostics for assertion violations

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2023-01-06 13:29:24 -08:00
parent b1239d5276
commit 991acb0d72
2 changed files with 18 additions and 1 deletions

View file

@ -1745,10 +1745,14 @@ namespace polysat {
return false;
if (!update_min(y_min, x_min, x_max, a2, b2, c2, d2))
return false;
//verbose_stream() << "min-max: x := v" << x << " [" << x_min << "," << x_max << "] y := v" << y << " [" << y_min << ", " << y_max << "] y0 " << y0 << "\n";
VERIFY(y_min <= y0 && y0 <= y_max);
if (!update_max(y_max, x_min, x_max, a1, b1, c1, d1))
return false;
if (!update_max(y_max, x_min, x_max, a2, b2, c2, d2))
return false;
//verbose_stream() << "min-max: x := v" << x << " [" << x_min << "," << x_max << "] y := v" << y << " [" << y_min << ", " << y_max << "] y0 " << y0 << "\n";
VERIFY(y_min <= y0 && y0 <= y_max);
// p < M iff -p > -M iff -p + M - 1 >= 0
if (!update_min(y_min, x_min, x_max, -a1, -b1, -c1, -d1 + M - 1))
return false;
@ -1758,6 +1762,7 @@ namespace polysat {
return false;
if (!update_max(y_max, x_min, x_max, -a2, -b2, -c2, -d2 + M - 1))
return false;
VERIFY(y_min <= y0 && y0 <= y_max);
// p <= q or p < q is false
// so p > q or p >= q
// p - q - 1 >= 0 or p - q >= 0
@ -1766,9 +1771,10 @@ namespace polysat {
return false;
if (!update_max(y_max, x_min, x_max, a1 - a2, b1 - b2, c1 - c2, d1 - d2 - (a_l_b.is_strict() ? 0 : 1)))
return false;
verbose_stream() << "min-max: x := v" << x << " [" << x_min << "," << x_max << "] y := v" << y << " [" << y_min << ", " << y_max << "] y0 " << y0 << "\n";
IF_VERBOSE(0, verbose_stream() << "min-max: x := v" << x << " [" << x_min << "," << x_max << "] y := v" << y << " [" << y_min << ", " << y_max << "] y0 " << y0 << "\n");
SASSERT(y_min <= y0 && y0 <= y_max);
VERIFY(y_min <= y0 && y0 <= y_max);
if (y_min == y_max)
return false;

View file

@ -977,6 +977,17 @@ namespace polysat {
appraise_lemma(lemmas.back());
}
SASSERT(best_score < lemma_score::max());
if (!best_lemma) {
for (clause* cl: lemmas) {
for (sat::literal lit : *cl) {
if (m_bvars.is_true(lit)) // may happen if we only use the clause to justify a new constraint; it is not a real lemma
verbose_stream() << "is true " << lit << "\n";
if (!m_bvars.is_assigned(lit))
verbose_stream() << lit << " is not assigned \n";
}
verbose_stream() << *cl << "\n";
}
}
VERIFY(best_lemma);
unsigned const jump_level = std::max(best_score.jump_level(), base_level());