mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 13:40:52 +00:00
fixes to cuts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7d8b56027f
commit
dcd4fff284
18 changed files with 75 additions and 50 deletions
|
@ -56,6 +56,7 @@ namespace sat {
|
|||
SASSERT(c.size() > 2);
|
||||
unsigned filter = get_clause_filter(c);
|
||||
s.init_visited();
|
||||
TRACE("sat_xor", tout << c << "\n";);
|
||||
bool parity = false;
|
||||
unsigned mask = 0, i = 0;
|
||||
for (literal l : c) {
|
||||
|
@ -110,6 +111,7 @@ namespace sat {
|
|||
s.set_external(l.var());
|
||||
}
|
||||
if (parity == (lits.size() % 2 == 0)) lits[0].neg();
|
||||
TRACE("sat_xor", tout << parity << ": " << lits << "\n";);
|
||||
m_on_xor(lits);
|
||||
}
|
||||
|
||||
|
@ -129,6 +131,7 @@ namespace sat {
|
|||
m_missing.push_back(i);
|
||||
}
|
||||
}
|
||||
TRACE("sat_xor", tout << l1 << " " << l2 << "\n";);
|
||||
return update_combinations(c, parity, mask);
|
||||
}
|
||||
|
||||
|
@ -136,7 +139,7 @@ namespace sat {
|
|||
bool parity2 = false;
|
||||
for (literal l : c2) {
|
||||
if (!s.is_visited(l.var())) return false;
|
||||
parity2 ^= l.sign();
|
||||
parity2 ^= !l.sign();
|
||||
}
|
||||
if (c2.size() == c.size() && parity2 != parity) {
|
||||
return false;
|
||||
|
@ -145,6 +148,7 @@ namespace sat {
|
|||
m_clauses_to_remove.push_back(&c2);
|
||||
c2.mark_used();
|
||||
}
|
||||
TRACE("sat_xor", tout << c2 << "\n";);
|
||||
// insert missing
|
||||
unsigned mask = 0;
|
||||
m_missing.reset();
|
||||
|
@ -182,7 +186,8 @@ namespace sat {
|
|||
}
|
||||
// return true if xor clause is covered.
|
||||
unsigned sz = c.size();
|
||||
for (unsigned i = 0; i < (1ul << sz); ++i) {
|
||||
for (unsigned i = 0; i < (1ul << sz); ++i) {
|
||||
TRACE("sat_xor", tout << i << ": " << parity << " " << m_parity[sz][i] << " " << get_combination(i) << "\n";);
|
||||
if (parity == m_parity[sz][i] && !get_combination(i)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue