Skip to content

Commit 8b6780c

Browse files
lcm: set level for dropped literals
We need to track causalities of dropped literals. This was not implemented in original LCM. Signed-off-by: Norbert Manthey <[email protected]>
1 parent 888a695 commit 8b6780c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pcasso-src/SolverPT.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ int SolverPT::simplifyLearntLCM(Clause& c, int vivificationConfig)
11301130
assert(c[j - 1] == impliedLit && c.size() >= j && "until here, the position of impliedLit should be fixed");
11311131
c[j - 1] = c.last(); // drop the literal "impliedLit" from the clause
11321132
c.pop();
1133+
modified = true;
11331134
npLCMimpDrop ++;
11341135
}
11351136
conflict.clear();
@@ -1152,7 +1153,7 @@ int SolverPT::simplifyLearntLCM(Clause& c, int vivificationConfig)
11521153
if (nblevels < c.lbd()) {
11531154
c.setLBD(nblevels);
11541155
}
1155-
minimized = true;
1156+
minimized = true; modified = true;
11561157
}
11571158
cancelUntil(0);
11581159

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

0 commit comments

Comments
 (0)