mirror of
https://github.com/Z3Prover/z3
synced 2025-06-21 05:13:39 +00:00
Handle bailouts in conflict_core
This commit is contained in:
parent
79d7ae5417
commit
f1ce0e233a
2 changed files with 16 additions and 22 deletions
|
@ -262,18 +262,23 @@ namespace polysat {
|
||||||
for (auto c : cjust_v)
|
for (auto c : cjust_v)
|
||||||
insert(c);
|
insert(c);
|
||||||
|
|
||||||
for (auto* engine : ex_engines)
|
if (!is_bailout()) {
|
||||||
if (engine->try_explain(v, *this))
|
for (auto* engine : ex_engines)
|
||||||
return true;
|
if (engine->try_explain(v, *this))
|
||||||
|
return true;
|
||||||
|
|
||||||
// No value resolution method was successful => fall back to saturation and variable elimination
|
// No value resolution method was successful => fall back to saturation and variable elimination
|
||||||
while (s().inc()) {
|
while (s().inc()) {
|
||||||
// TODO: as a last resort, substitute v by m_value[v]?
|
// TODO: as a last resort, substitute v by m_value[v]?
|
||||||
if (try_eliminate(v))
|
if (try_eliminate(v))
|
||||||
return true;
|
return true;
|
||||||
if (!try_saturate(v))
|
if (!try_saturate(v))
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_bailout();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_vars.insert(v);
|
m_vars.insert(v);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,18 +496,7 @@ namespace polysat {
|
||||||
|
|
||||||
/** Conflict resolution case where propagation 'v := ...' is on top of the stack */
|
/** Conflict resolution case where propagation 'v := ...' is on top of the stack */
|
||||||
void solver::resolve_value(pvar v) {
|
void solver::resolve_value(pvar v) {
|
||||||
if (m_conflict.is_bailout()) {
|
m_conflict.resolve_value(v, m_cjust[v]);
|
||||||
for (auto c : m_cjust[v])
|
|
||||||
m_conflict.insert(c);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Value Resolution
|
|
||||||
if (!m_conflict.resolve_value(v, m_cjust[v])) {
|
|
||||||
// Failed to resolve => bail out
|
|
||||||
++m_stats.m_num_bailouts;
|
|
||||||
m_conflict.set_bailout();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Conflict resolution case where boolean literal 'lit' is on top of the stack */
|
/** Conflict resolution case where boolean literal 'lit' is on top of the stack */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue