mirror of
https://github.com/Z3Prover/z3
synced 2025-07-19 10:52:02 +00:00
bailout quick
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
6ffcea0bde
commit
705fd0d01d
1 changed files with 17 additions and 17 deletions
|
@ -242,6 +242,9 @@ namespace polysat {
|
||||||
// - cjust_v contains true constraints
|
// - cjust_v contains true constraints
|
||||||
// - core contains both false and true constraints (originally only false ones, but additional true ones may come from saturation)
|
// - core contains both false and true constraints (originally only false ones, but additional true ones may come from saturation)
|
||||||
|
|
||||||
|
if (is_bailout())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (conflict_var() == v) {
|
if (conflict_var() == v) {
|
||||||
clause_builder lemma(s());
|
clause_builder lemma(s());
|
||||||
forbidden_intervals fi;
|
forbidden_intervals fi;
|
||||||
|
@ -250,30 +253,27 @@ namespace polysat {
|
||||||
m_bailout_lemma = std::move(lemma);
|
m_bailout_lemma = std::move(lemma);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// TODO: add a dummy value for v?
|
||||||
}
|
}
|
||||||
|
|
||||||
m_vars.remove(v);
|
m_vars.remove(v);
|
||||||
|
|
||||||
for (auto c : cjust_v)
|
for (auto c : cjust_v)
|
||||||
insert(c);
|
insert(c);
|
||||||
|
|
||||||
if (!is_bailout()) {
|
for (auto* engine : ex_engines)
|
||||||
for (auto* engine : ex_engines)
|
if (engine->try_explain(v, *this))
|
||||||
if (engine->try_explain(v, *this))
|
return true;
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
set_bailout();
|
||||||
m_vars.insert(v);
|
m_vars.insert(v);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue