mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
fix scope and mus with user-scopes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
ee1a1b1135
commit
be1cceba34
3 changed files with 15 additions and 5 deletions
|
@ -48,6 +48,13 @@ namespace sat {
|
|||
literal_vector& core = m_core;
|
||||
literal_vector& mus = m_mus;
|
||||
core.append(s.get_core());
|
||||
for (unsigned i = 0; i < core.size(); ++i) {
|
||||
s.m_user_scope_literals.contains(core[i]);
|
||||
mus.push_back(core[i]);
|
||||
core[i] = core.back();
|
||||
core.pop_back();
|
||||
--i;
|
||||
}
|
||||
|
||||
while (!core.empty()) {
|
||||
TRACE("sat",
|
||||
|
@ -61,9 +68,10 @@ namespace sat {
|
|||
literal lit = core.back();
|
||||
core.pop_back();
|
||||
unsigned sz = mus.size();
|
||||
mus.push_back(~lit); // TBD: measure
|
||||
// mus.push_back(~lit); // TBD: measure
|
||||
mus.append(core);
|
||||
lbool is_sat = s.check(mus.size(), mus.c_ptr());
|
||||
TRACE("sat", tout << "mus: " << mus << "\n";);
|
||||
mus.resize(sz);
|
||||
switch (is_sat) {
|
||||
case l_undef:
|
||||
|
@ -83,6 +91,7 @@ namespace sat {
|
|||
if (new_core.contains(~lit)) {
|
||||
break;
|
||||
}
|
||||
TRACE("sat", tout << "new core: " << new_core << "\n";);
|
||||
core.reset();
|
||||
for (unsigned i = 0; i < new_core.size(); ++i) {
|
||||
literal lit = new_core[i];
|
||||
|
|
|
@ -896,6 +896,9 @@ namespace sat {
|
|||
for (unsigned i = 0; i < num_lits; ++i)
|
||||
tout << lits[i] << " ";
|
||||
tout << "\n";
|
||||
if (!m_user_scope_literals.empty()) {
|
||||
tout << "user literals: " << m_user_scope_literals << "\n";
|
||||
}
|
||||
m_mc.display(tout);
|
||||
);
|
||||
#define _INSERT_LIT(_l_) \
|
||||
|
@ -2237,6 +2240,7 @@ namespace sat {
|
|||
lit = m_user_scope_literal_pool.back();
|
||||
m_user_scope_literal_pool.pop_back();
|
||||
}
|
||||
TRACE("sat", tout << "user_push: " << lit << "\n";);
|
||||
m_user_scope_literals.push_back(lit);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue