ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
cadical_flags.cpp
Go to the documentation of this file.
1#include "global.h"
2
3#include "internal.hpp"
4
6
7namespace CaDiCaL {
8
10 if (external->fixed_listener) {
11 int elit = externalize (lit);
12 CADICAL_assert (elit);
13 const int eidx = abs (elit);
14 if (!external->ervars[eidx])
15 external->fixed_listener->notify_fixed_assignment (elit);
16 }
17 Flags &f = flags (lit);
20 LOG ("fixed %d", abs (lit));
21 stats.all.fixed++;
22 stats.now.fixed++;
23 stats.inactive++;
24 CADICAL_assert (stats.active);
25 stats.active--;
27 CADICAL_assert (f.fixed ());
28
30 // If pre/inprocessing found a fixed assignment, we want the propagator
31 // to know about it.
32 // But at that point it is not guaranteed to be already on the trail, so
33 // notification will happen only later.
35 }
36}
37
39 Flags &f = flags (lit);
42 LOG ("eliminated %d", abs (lit));
43 stats.all.eliminated++;
44 stats.now.eliminated++;
45 stats.inactive++;
46 CADICAL_assert (stats.active);
47 stats.active--;
50}
51
53 Flags &f = flags (lit);
56 LOG ("pure %d", abs (lit));
57 stats.all.pure++;
58 stats.now.pure++;
59 stats.inactive++;
60 CADICAL_assert (stats.active);
61 stats.active--;
63 CADICAL_assert (f.pure ());
64}
65
67 Flags &f = flags (lit);
70 LOG ("substituted %d", abs (lit));
71 stats.all.substituted++;
72 stats.now.substituted++;
73 stats.inactive++;
74 CADICAL_assert (stats.active);
75 stats.active--;
78}
79
81 Flags &f = flags (lit);
84 LOG ("activate %d previously unused", abs (lit));
85 CADICAL_assert (stats.inactive);
86 stats.inactive--;
87 CADICAL_assert (stats.unused);
88 stats.unused--;
89 stats.active++;
91}
92
95 Flags &f = flags (lit);
98#ifdef LOGGING
99 const char *msg = 0;
100#endif
101 switch (f.status) {
102 default:
105 CADICAL_assert (stats.now.eliminated > 0);
106 stats.now.eliminated--;
107#ifdef LOGGING
108 msg = "eliminated";
109#endif
110 break;
112#ifdef LOGGING
113 msg = "substituted";
114#endif
115 CADICAL_assert (stats.now.substituted > 0);
116 stats.now.substituted--;
117 break;
118 case Flags::PURE:
119#ifdef LOGGING
120 msg = "pure literal";
121#endif
122 CADICAL_assert (stats.now.pure > 0);
123 stats.now.pure--;
124 break;
125 }
126#ifdef LOGGING
127 CADICAL_assert (msg);
128 LOG ("reactivate previously %s %d", msg, abs (lit));
129#endif
131 f.sweep = false;
133 stats.reactivated++;
134 CADICAL_assert (stats.inactive > 0);
135 stats.inactive--;
136 stats.active++;
137}
138
139} // namespace CaDiCaL
140
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
Definition global.h:14
#define LOG(...)
const char * flags()
int lit
Definition satVec.h:130
bool eliminated() const
Definition flags.hpp:71
bool substituted() const
Definition flags.hpp:72
bool fixed() const
Definition flags.hpp:70
unsigned char status
Definition flags.hpp:56
bool pure() const
Definition flags.hpp:73
External * external
Definition internal.hpp:312
int externalize(int lit)
void mark_substituted(int)
void mark_eliminated(int)
bool active(int lit)
Definition internal.hpp:360
void reactivate(int lit)