mirror of
https://github.com/Z3Prover/z3
synced 2025-08-05 19:00:25 +00:00
Tidy
This commit is contained in:
parent
80041d7131
commit
8915d0a21f
1 changed files with 43 additions and 40 deletions
|
@ -1044,16 +1044,17 @@ namespace sat {
|
||||||
clause_use_list::iterator it = occs.mk_iterator();
|
clause_use_list::iterator it = occs.mk_iterator();
|
||||||
while (!it.at_end()) {
|
while (!it.at_end()) {
|
||||||
clause & c = it.curr();
|
clause & c = it.curr();
|
||||||
it.next();
|
if (!c.is_blocked()) {
|
||||||
if (c.is_blocked()) continue;
|
m_counter -= c.size();
|
||||||
m_counter -= c.size();
|
SASSERT(c.contains(l));
|
||||||
SASSERT(c.contains(l));
|
s.mark_all_but(c, l);
|
||||||
s.mark_all_but(c, l);
|
if (all_tautology(l)) {
|
||||||
if (all_tautology(l)) {
|
block_clause(c, l, new_entry);
|
||||||
block_clause(c, l, new_entry);
|
s.m_num_blocked_clauses++;
|
||||||
s.m_num_blocked_clauses++;
|
}
|
||||||
|
s.unmark_all(c);
|
||||||
}
|
}
|
||||||
s.unmark_all(c);
|
it.next();
|
||||||
}
|
}
|
||||||
for (clause* c : m_to_remove)
|
for (clause* c : m_to_remove)
|
||||||
s.block_clause(*c);
|
s.block_clause(*c);
|
||||||
|
@ -1086,31 +1087,32 @@ namespace sat {
|
||||||
while (!it.at_end()) {
|
while (!it.at_end()) {
|
||||||
bool tautology = false;
|
bool tautology = false;
|
||||||
clause & c = it.curr();
|
clause & c = it.curr();
|
||||||
it.next();
|
if (!c.is_blocked()) {
|
||||||
if (c.is_blocked()) continue;
|
for (literal lit : c) {
|
||||||
for (literal lit : c) {
|
if (s.is_marked(~lit) && lit != ~l) {
|
||||||
if (s.is_marked(~lit) && lit != ~l) {
|
tautology = true;
|
||||||
tautology = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!tautology) {
|
|
||||||
if (first) {
|
|
||||||
for (literal lit : c) {
|
|
||||||
if (lit != ~l && !s.is_marked(lit)) inter.push_back(lit);
|
|
||||||
}
|
}
|
||||||
first = false;
|
|
||||||
if (inter.empty()) return false;
|
|
||||||
}
|
}
|
||||||
else {
|
if (!tautology) {
|
||||||
unsigned j = 0;
|
if (first) {
|
||||||
for (literal lit : inter)
|
for (literal lit : c) {
|
||||||
if (c.contains(lit))
|
if (lit != ~l && !s.is_marked(lit)) inter.push_back(lit);
|
||||||
inter[j++] = lit;
|
}
|
||||||
inter.shrink(j);
|
first = false;
|
||||||
if (j == 0) return false;
|
if (inter.empty()) return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unsigned j = 0;
|
||||||
|
for (literal lit : inter)
|
||||||
|
if (c.contains(lit))
|
||||||
|
inter[j++] = lit;
|
||||||
|
inter.shrink(j);
|
||||||
|
if (j == 0) return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
it.next();
|
||||||
}
|
}
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
|
@ -1360,17 +1362,18 @@ namespace sat {
|
||||||
clause_use_list::iterator it = neg_occs.mk_iterator();
|
clause_use_list::iterator it = neg_occs.mk_iterator();
|
||||||
while (!it.at_end()) {
|
while (!it.at_end()) {
|
||||||
clause & c = it.curr();
|
clause & c = it.curr();
|
||||||
it.next();
|
if (!c.is_blocked()) {
|
||||||
if (c.is_blocked()) continue;
|
m_counter -= c.size();
|
||||||
m_counter -= c.size();
|
unsigned sz = c.size();
|
||||||
unsigned sz = c.size();
|
unsigned i;
|
||||||
unsigned i;
|
for (i = 0; i < sz; i++) {
|
||||||
for (i = 0; i < sz; i++) {
|
if (s.is_marked(~c[i]))
|
||||||
if (s.is_marked(~c[i]))
|
break;
|
||||||
break;
|
}
|
||||||
|
if (i == sz)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (i == sz)
|
it.next();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.s.m_ext) {
|
if (s.s.m_ext) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue