mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
fix drat generation in asymmetric branch simplification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f835a3c2b2
commit
dc5e4ca1c5
3 changed files with 32 additions and 11 deletions
|
@ -342,7 +342,10 @@ namespace sat {
|
|||
break;
|
||||
default:
|
||||
if (!m_to_delete.contains(lit)) {
|
||||
c[j++] = lit;
|
||||
if (i != j) {
|
||||
std::swap(c[i], c[j]);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -406,12 +409,13 @@ namespace sat {
|
|||
|
||||
bool asymm_branch::re_attach(scoped_detach& scoped_d, clause& c, unsigned new_sz) {
|
||||
VERIFY(s.m_trail.size() == s.m_qhead);
|
||||
m_elim_literals += c.size() - new_sz;
|
||||
unsigned old_sz = c.size();
|
||||
m_elim_literals += old_sz - new_sz;
|
||||
if (c.is_learned()) {
|
||||
m_elim_learned_literals += c.size() - new_sz;
|
||||
m_elim_learned_literals += old_sz - new_sz;
|
||||
}
|
||||
|
||||
switch(new_sz) {
|
||||
switch (new_sz) {
|
||||
case 0:
|
||||
s.set_conflict(justification());
|
||||
return false;
|
||||
|
@ -430,8 +434,12 @@ namespace sat {
|
|||
return false;
|
||||
default:
|
||||
c.shrink(new_sz);
|
||||
if (s.m_config.m_drat) s.m_drat.add(c, true);
|
||||
// if (s.m_config.m_drat) s.m_drat.del(c0); // TBD
|
||||
if (s.m_config.m_drat && new_sz < old_sz) {
|
||||
s.m_drat.add(c, true);
|
||||
c.restore(old_sz);
|
||||
s.m_drat.del(c);
|
||||
c.shrink(new_sz);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -585,8 +585,21 @@ namespace sat {
|
|||
|
||||
void drat::del(clause& c) {
|
||||
|
||||
#if 0
|
||||
// check_duplicates:
|
||||
for (literal lit : c) {
|
||||
VERIFY(!m_seen[lit.index()]);
|
||||
m_seen[lit.index()] = true;
|
||||
}
|
||||
for (literal lit : c) {
|
||||
m_seen[lit.index()] = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE("sat", tout << "del: " << c << "\n";);
|
||||
if (m_out) dump(c.size(), c.begin(), status::deleted);
|
||||
if (m_out) {
|
||||
dump(c.size(), c.begin(), status::deleted);
|
||||
}
|
||||
if (m_check) {
|
||||
clause* c1 = s.alloc_clause(c.size(), c.begin(), c.is_learned());
|
||||
append(*c1, status::deleted);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue