ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cadical_phases.cpp
Go to the documentation of this file.
1#include "global.h"
2
3#include "internal.hpp"
4
6
7namespace CaDiCaL {
8
10 START (copy);
11 for (auto i : vars)
12 dst[i] = phases.saved[i];
13 STOP (copy);
14}
15
17 START (copy);
18 for (auto i : vars)
19 dst[i] = 0;
20 STOP (copy);
21}
22
23void Internal::phase (int lit) {
24 const int idx = vidx (lit);
25 signed char old_forced_phase = phases.forced[idx];
26 signed char new_forced_phase = sign (lit);
27 if (old_forced_phase == new_forced_phase) {
28 LOG ("forced phase remains at %d", old_forced_phase * idx);
29 return;
30 }
31 if (old_forced_phase)
32 LOG ("overwriting old forced phase %d", old_forced_phase * idx);
33 LOG ("new forced phase %d", new_forced_phase * idx);
34 phases.forced[idx] = new_forced_phase;
35}
36
38 const int idx = vidx (lit);
39 signed char old_forced_phase = phases.forced[idx];
40 if (!old_forced_phase) {
41 LOG ("forced phase of %d already reset", lit);
42 return;
43 }
44 LOG ("clearing old forced phase %d", old_forced_phase * idx);
45 phases.forced[idx] = 0;
46}
47
48} // namespace CaDiCaL
49
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define LOG(...)
int sign(int lit)
Definition util.hpp:22
#define STOP(P)
Definition profile.hpp:158
#define START(P)
Definition profile.hpp:150
int lit
Definition satVec.h:130
int vidx(int lit) const
Definition internal.hpp:395
void unphase(int lit)
void phase(int lit)
void clear_phases(vector< signed char > &)
const Range vars
Definition internal.hpp:324
void copy_phases(vector< signed char > &)