Skip to content

Commit

Permalink
lcm: set level for dropped literals
Browse files Browse the repository at this point in the history
We need to track causalities of dropped literals. This was not
implemented in original LCM.

Signed-off-by: Norbert Manthey <[email protected]>
  • Loading branch information
conp-solutions committed Apr 12, 2020
1 parent 888a695 commit 8b6780c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pcasso-src/SolverPT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ int SolverPT::simplifyLearntLCM(Clause& c, int vivificationConfig)
assert(c[j - 1] == impliedLit && c.size() >= j && "until here, the position of impliedLit should be fixed");
c[j - 1] = c.last(); // drop the literal "impliedLit" from the clause
c.pop();
modified = true;
npLCMimpDrop ++;
}
conflict.clear();
Expand All @@ -1152,7 +1153,7 @@ int SolverPT::simplifyLearntLCM(Clause& c, int vivificationConfig)
if (nblevels < c.lbd()) {
c.setLBD(nblevels);
}
minimized = true;
minimized = true; modified = true;
}
cancelUntil(0);

Expand Down Expand Up @@ -1193,6 +1194,7 @@ bool SolverPT::simplifyClause_viviLCM(const CRef cr, int LCMconfig, bool fullySi
}
}
if (!sat) {
unsigned int newPTLevel = c.getPTLevel();
for (i = 2; i < c.size(); i++) {
if (value(c[i]) != l_False) {
c[j++] = c[i]; // TODO FIXME: has to end up in drat proof!
Expand All @@ -1201,9 +1203,11 @@ bool SolverPT::simplifyClause_viviLCM(const CRef cr, int LCMconfig, bool fullySi
break;
}
} else {
newPTLevel = newPTLevel > getLiteralPTLevel(c[i]) ? newPTLevel : getLiteralPTLevel(c[i]);
;
}
}
if(i!=j) c.setPTLevel(newPTLevel); // update level based on literals that have been dropped
nbLCMfalsified += (i - j);
c.shrink(i - j);
// set worst case PT level, as we currently do not have a good way to track the actual level
Expand Down

0 comments on commit 8b6780c

Please sign in to comment.