Skip to content

Commit

Permalink
do not delete reason clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
krobelus committed Jun 14, 2019
1 parent c1f2f46 commit 7363e6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions sources/core/Solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ bool Solver::simplifyLearnt_x(vec<CRef>& learnts_x)
}
}
if (sat){
removeClause(cr);
if (locked(c))
learnts_x[cj++] = learnts_x[ci];
else
removeClause(cr);
}
else{
detachClause(cr, true);
Expand Down Expand Up @@ -602,7 +605,10 @@ bool Solver::simplifyLearnt_core()
}
}
if (sat){
removeClause(cr);
if (locked(c))
learnts_core[cj++] = learnts_core[ci];
else
removeClause(cr);
}
else{
detachClause(cr, true);
Expand Down Expand Up @@ -727,7 +733,10 @@ bool Solver::simplifyLearnt_tier2()
}
}
if (sat){
removeClause(cr);
if (locked(c))
learnts_tier2[cj++] = learnts_tier2[ci];
else
removeClause(cr);
}
else{
detachClause(cr, true);
Expand Down Expand Up @@ -1636,7 +1645,7 @@ void Solver::removeSatisfied(vec<CRef>& cs)
int i, j;
for (i = j = 0; i < cs.size(); i++){
Clause& c = ca[cs[i]];
if (satisfied(c))
if (satisfied(c) && !locked(c))
removeClause(cs[i]);
else
cs[j++] = cs[i];
Expand All @@ -1650,7 +1659,7 @@ void Solver::safeRemoveSatisfied(vec<CRef>& cs, unsigned valid_mark)
for (i = j = 0; i < cs.size(); i++){
Clause& c = ca[cs[i]];
if (c.mark() == valid_mark)
if (satisfied(c))
if (satisfied(c) && !locked(c))
removeClause(cs[i]);
else
cs[j++] = cs[i];
Expand Down
2 changes: 1 addition & 1 deletion sources/simp/SimpSolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ void SimpSolver::removeSatisfied()
for (i = j = 0; i < clauses.size(); i++){
const Clause& c = ca[clauses[i]];
if (c.mark() == 0)
if (satisfied(c))
if (satisfied(c) && !locked(c))
removeClause(clauses[i]);
else
clauses[j++] = clauses[i];
Expand Down

0 comments on commit 7363e6c

Please sign in to comment.