Skip to content

Commit

Permalink
adding more logging to forced unphase functions
Browse files Browse the repository at this point in the history
  • Loading branch information
arminbiere committed Jun 3, 2023
1 parent 8822a9c commit 41510f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,13 @@ void External::unphase (int elit) {
assert (elit);
assert (elit != INT_MIN);
int eidx = abs (elit);
if (eidx > max_var) return;
if (eidx > max_var) {
UNUSED:
LOG ("resetting forced phase of unused external %d ignored", elit);
return;
}
int ilit = e2i[eidx];
if (!ilit) return;
if (!ilit) goto UNUSED;
if (elit < 0) ilit = -ilit;
internal->unphase (ilit);
}
Expand Down
5 changes: 4 additions & 1 deletion src/phases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ void Internal::phase (int lit) {
void Internal::unphase (int lit) {
const int idx = vidx (lit);
signed char old_forced_phase = phases.forced[idx];
if (!old_forced_phase) return;
if (!old_forced_phase) {
LOG ("forced phase of %d already reset", lit);
return;
}
LOG ("clearing old forced phase %d", old_forced_phase * idx);
phases.forced[idx] = 0;
}
Expand Down

0 comments on commit 41510f1

Please sign in to comment.