mirror of
https://github.com/Z3Prover/z3
synced 2025-07-31 08:23:17 +00:00
fix conflict reset condition
This commit is contained in:
parent
4e9db7c4d9
commit
51025a75b4
3 changed files with 42 additions and 9 deletions
|
@ -192,6 +192,7 @@ namespace polysat {
|
|||
}
|
||||
|
||||
unsigned conflict::effective_level() const {
|
||||
SASSERT(!empty());
|
||||
// If m_dep is set, the corresponding constraint was asserted at m_level and is not valid earlier.
|
||||
if (m_dep != null_dependency)
|
||||
return m_level;
|
||||
|
@ -207,6 +208,22 @@ namespace polysat {
|
|||
return lvl;
|
||||
}
|
||||
|
||||
bool conflict::is_valid() const {
|
||||
SASSERT(!empty());
|
||||
// If m_dep is set, the corresponding constraint was asserted at m_level and is not valid earlier.
|
||||
if (m_dep != null_dependency)
|
||||
return m_level <= s.m_level;
|
||||
// All conflict constraints must be bool-assigned.
|
||||
for (unsigned lit_idx : m_literals)
|
||||
if (!s.m_bvars.is_assigned(sat::to_literal(lit_idx)))
|
||||
return false;
|
||||
// All conflict variables must be assigned.
|
||||
for (pvar v : m_vars)
|
||||
if (!s.is_assigned(v))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void conflict::init_at_base_level(dependency dep) {
|
||||
SASSERT(empty());
|
||||
SASSERT(s.at_base_level());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue