mirror of
https://github.com/Z3Prover/z3
synced 2025-05-09 16:55:47 +00:00
fix unsat core extraction code in smt_context
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d32019f4c9
commit
7346098895
3 changed files with 19 additions and 14 deletions
|
@ -1334,8 +1334,9 @@ namespace smt {
|
|||
if (!m_ctx.is_marked(var)) {
|
||||
m_ctx.set_mark(var);
|
||||
m_unmark.push_back(var);
|
||||
if (m_ctx.is_assumption(var))
|
||||
m_assumptions.push_back(antecedent);
|
||||
}
|
||||
if (m_ctx.is_assumption(var)) {
|
||||
m_assumptions.push_back(antecedent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1373,7 +1374,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
while (true) {
|
||||
TRACE("unsat_core_bug", tout << "js.get_kind(): " << js.get_kind() << ", idx: " << idx << "\n";);
|
||||
TRACE("unsat_core_bug", tout << consequent << " js.get_kind(): " << js.get_kind() << ", idx: " << idx << "\n";);
|
||||
switch (js.get_kind()) {
|
||||
case b_justification::CLAUSE: {
|
||||
clause * cls = js.get_clause();
|
||||
|
@ -1410,18 +1411,22 @@ namespace smt {
|
|||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (idx < 0)
|
||||
goto end_unsat_core;
|
||||
|
||||
if (m_ctx.is_assumption(consequent.var())) {
|
||||
m_assumptions.push_back(consequent);
|
||||
}
|
||||
while (idx >= 0) {
|
||||
literal l = m_assigned_literals[idx];
|
||||
TRACE("unsat_core_bug", tout << "l: " << l << ", get_assign_level(l): " << m_ctx.get_assign_level(l) << ", is_marked(l): " << m_ctx.is_marked(l.var()) << "\n";);
|
||||
if (m_ctx.get_assign_level(l) < search_lvl || idx == 0)
|
||||
goto end_unsat_core;
|
||||
if (m_ctx.get_assign_level(l) < search_lvl)
|
||||
goto end_unsat_core;
|
||||
if (m_ctx.is_marked(l.var()))
|
||||
break;
|
||||
idx--;
|
||||
}
|
||||
if (idx < 0) {
|
||||
goto end_unsat_core;
|
||||
}
|
||||
|
||||
SASSERT(idx >= 0);
|
||||
consequent = m_assigned_literals[idx];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue