mirror of
https://github.com/Z3Prover/z3
synced 2025-04-30 04:15:51 +00:00
#fix #5328
in-processing for "pure" PB constraints isn't model preserving and therefore removed.
This commit is contained in:
parent
85b672ee85
commit
1fd6b66ecc
2 changed files with 13 additions and 39 deletions
|
@ -132,7 +132,6 @@ namespace pb {
|
|||
remove_constraint(p, "is tight");
|
||||
}
|
||||
else {
|
||||
|
||||
unsigned sz = p.size();
|
||||
clear_watch(p);
|
||||
unsigned j = 0;
|
||||
|
@ -1470,7 +1469,6 @@ namespace pb {
|
|||
return true;
|
||||
}
|
||||
else if (c.lit() != sat::null_literal && value(c.lit()) != l_true) {
|
||||
// else if (c.lit() != sat::null_literal && value(c.lit()) == l_false) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
|
@ -2025,7 +2023,7 @@ namespace pb {
|
|||
unit_strengthen();
|
||||
cleanup_clauses();
|
||||
cleanup_constraints();
|
||||
update_pure();
|
||||
|
||||
count++;
|
||||
}
|
||||
while (count < 10 && (m_simplify_change || trail_sz < s().init_trail_size()));
|
||||
|
@ -2047,41 +2045,6 @@ namespace pb {
|
|||
// if (s().m_clauses.size() < 80000) lp_lookahead_reduction();
|
||||
}
|
||||
|
||||
/*
|
||||
* ~lit does not occur in clauses
|
||||
* ~lit is only in one constraint use list
|
||||
* lit == C
|
||||
* -> ignore assignments to ~lit for C
|
||||
*
|
||||
* ~lit does not occur in clauses
|
||||
* lit is only in one constraint use list
|
||||
* lit == C
|
||||
* -> negate: ~lit == ~C
|
||||
*/
|
||||
void solver::update_pure() {
|
||||
//return;
|
||||
for (constraint* cp : m_constraints) {
|
||||
literal lit = cp->lit();
|
||||
if (lit != sat::null_literal &&
|
||||
!cp->is_pure() &&
|
||||
value(lit) == l_undef &&
|
||||
get_wlist(~lit).size() == 1 &&
|
||||
m_clause_use_list.get(lit).empty()) {
|
||||
clear_watch(*cp);
|
||||
cp->negate();
|
||||
lit.neg();
|
||||
}
|
||||
if (lit != sat::null_literal &&
|
||||
!cp->is_pure() &&
|
||||
m_cnstr_use_list[(~lit).index()].size() == 1 &&
|
||||
get_wlist(lit).size() == 1 &&
|
||||
m_clause_use_list.get(~lit).empty()) {
|
||||
cp->set_pure();
|
||||
get_wlist(~lit).erase(sat::watched(cp->cindex())); // just ignore assignments to false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void solver::mutex_reduction() {
|
||||
literal_vector lits;
|
||||
for (unsigned v = 0; v < s().num_vars(); ++v) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue