mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 00:18:45 +00:00
extend invariant check
This commit is contained in:
parent
c55d316c6a
commit
181995a4fb
2 changed files with 10 additions and 5 deletions
|
@ -210,7 +210,7 @@ namespace polysat {
|
||||||
linear_propagate();
|
linear_propagate();
|
||||||
SASSERT(wlist_invariant());
|
SASSERT(wlist_invariant());
|
||||||
SASSERT(bool_watch_invariant());
|
SASSERT(bool_watch_invariant());
|
||||||
SASSERT(assignment_invariant());
|
SASSERT(eval_invariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1486,7 +1486,7 @@ namespace polysat {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check that boolean assignment and constraint evaluation are consistent */
|
/** Check that boolean assignment and constraint evaluation are consistent */
|
||||||
bool solver::assignment_invariant() const {
|
bool solver::eval_invariant() const {
|
||||||
if (is_conflict())
|
if (is_conflict())
|
||||||
return true;
|
return true;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
@ -1510,11 +1510,16 @@ namespace polysat {
|
||||||
if (is_conflict())
|
if (is_conflict())
|
||||||
return true;
|
return true;
|
||||||
uint_set active;
|
uint_set active;
|
||||||
|
bool ok = true;
|
||||||
for (pvar v : m_free_pvars)
|
for (pvar v : m_free_pvars)
|
||||||
active.insert(v);
|
active.insert(v);
|
||||||
for (auto const& [v, val] : assignment())
|
for (auto const& [v, val] : get_assignment()) {
|
||||||
|
if (active.contains(v)) {
|
||||||
|
ok = false;
|
||||||
|
LOG("Variable v" << v << " is in free var queue despite already assigned " << assignment_pp(*this, v, val));
|
||||||
|
}
|
||||||
active.insert(v);
|
active.insert(v);
|
||||||
bool ok = true;
|
}
|
||||||
for (pvar v = 0; v < num_vars(); ++v) {
|
for (pvar v = 0; v < num_vars(); ++v) {
|
||||||
if (!active.contains(v)) {
|
if (!active.contains(v)) {
|
||||||
ok = false;
|
ok = false;
|
||||||
|
|
|
@ -314,7 +314,7 @@ namespace polysat {
|
||||||
static bool invariant(signed_constraints const& cs);
|
static bool invariant(signed_constraints const& cs);
|
||||||
bool wlist_invariant() const;
|
bool wlist_invariant() const;
|
||||||
bool bool_watch_invariant() const;
|
bool bool_watch_invariant() const;
|
||||||
bool assignment_invariant() const;
|
bool eval_invariant() const;
|
||||||
bool var_queue_invariant() const;
|
bool var_queue_invariant() const;
|
||||||
bool verify_sat();
|
bool verify_sat();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue