57 LOG (begin, end,
"restoring external clause[%" PRId64
"]",
id);
60 for (
auto p = begin;
p != end;
p++) {
63 const auto &elit = *
p;
64 unsigned eidx = (elit > 0) + 2u * (
unsigned) abs (elit);
77 for (
const auto &elit :
eclause) {
81 internal->finish_added_clause_with_id (
id,
true);
96 int64_t weakened, satisfied, restored, removed;
98 memset (&clauses, 0,
sizeof clauses);
102 "forced to restore all clauses");
106 unsigned numtainted = 0;
112 "starting with %u tainted literals %.0f%%", numtainted,
117 auto end_of_extension =
extension.end ();
123 while (
p != end_of_extension) {
128 const auto saved = q;
138 while ((elit = *q++ = *
p++)) {
142 LOG (
"negation of witness literal %d tainted", tlit);
149 const int64_t
id = ((int64_t) (*p) << 32) + (int64_t) * (
p + 1);
150 LOG (
"id is %" PRId64,
id);
161 auto end_of_clause =
p;
162 while (end_of_clause != end_of_extension && (elit = *end_of_clause)) {
163 if (!satisfied &&
fixed (elit) > 0)
172 if (satisfied && !
internal->opts.restoreflush) {
173 LOG (
p, end_of_clause,
"forced to not remove %d satisfied",
178 if (satisfied || tlit ||
internal->opts.restoreall) {
181 LOG (
p, end_of_clause,
182 "flushing implied clause satisfied by %d from extension stack",
196 LOG (
p, end_of_clause,
"keeping clause on extension stack");
198 while (
p != end_of_clause)
207 if (clauses.satisfied)
209 "removed %" PRId64
" satisfied %.0f%% of %" PRId64
211 clauses.satisfied,
percent (clauses.satisfied, clauses.weakened),
215 "no satisfied clause removed out of %" PRId64
219 if (clauses.restored)
221 "restored %" PRId64
" clauses %.0f%% out of %" PRId64
223 clauses.restored,
percent (clauses.restored, clauses.weakened),
227 "no clause restored out of %" PRId64
" weakened clauses",
230 unsigned numtainted = 0;
236 "finishing with %u tainted literals %.0f%%", numtainted,
241 LOG (
"extension stack clean");
247 const auto begin_of_extension =
extension.begin ();
249 while (
p != begin_of_extension) {
262 while ((elit = *--
p)) {
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
void shrink_vector(std::vector< T > &v)
double percent(double a, double b)
bool marked(const vector< bool > &map, int elit) const
void restore_clause(const vector< int >::const_iterator &begin, const vector< int >::const_iterator &end, const int64_t id)
vector< int64_t > ext_units
int fixed(int elit) const
int internalize(int, bool extension=false)