18 for (
const auto &
lit : *c) {
21 LOG (c,
"root level satisfied literal %d in",
lit);
25 LOG (c,
"root level falsified literal %d in",
lit);
47 int num_non_false = 0;
48 for (i = c->
begin (); num_non_false < 2 && i != end; i++)
51 if (num_non_false < 2)
58 proof->flush_clause (c);
61 for (i = j; i != end; i++) {
79 if (
last.collect.fixed >=
stats.all.fixed)
83 LOG (
"marking satisfied clauses and removing falsified literals");
108 LOG (
"protecting reason clauses of all assigned variables on trail");
124 LOG (reason,
"protecting assigned %d reason %p",
lit, (
void *) reason);
131 LOG (
"protected %zd reason clauses referenced on trail", count);
141 LOG (
"unprotecting reasons clauses of all assigned variables on trail");
157 LOG (reason,
"unprotecting assigned %d reason %p",
lit,
165 LOG (
"unprotected %zd reason clauses referenced on trail", count);
183 for (i = j; i != end; i++) {
191 os.resize (j - os.begin ());
208 for (i = j; i != end; i++) {
217 LOG (c,
"clause in flush_watch starting from %d",
lit);
225 ws.resize (j - ws.begin ());
226 for (
const auto &w : saved)
234 for (
auto idx :
vars)
239 for (
auto idx :
vars)
247 LOG (
"update assigned reason references");
260 LOG (c,
"updating assigned %d reason",
lit);
269 LOG (
"updated %zd assigned reason references", count);
283 LOG (
"deleting garbage clauses");
285 int64_t collected_bytes = 0, collected_clauses = 0;
287 const auto end =
clauses.end ();
288 auto j =
clauses.begin (), i = j;
294 collected_bytes += c->
bytes ();
304 "collected %" PRId64
" bytes of %" PRId64
" garbage clauses",
305 collected_bytes, collected_clauses);
318 char *
p = (
char *) c;
322 LOG (
"copied clause[%" PRId64
"] from %p to %p", c->
id, (
void *) c,
330 size_t collected_clauses = 0, collected_bytes = 0;
331 size_t moved_clauses = 0, moved_bytes = 0;
337 moved_bytes += c->bytes (), moved_clauses++;
339 collected_bytes += c->bytes (), collected_clauses++;
342 "moving %zd bytes %.0f%% of %zd non garbage clauses", moved_bytes,
343 percent (moved_bytes, collected_bytes + moved_bytes),
345 (void) moved_clauses, (
void) collected_clauses, (void) collected_bytes;
348 arena.prepare (moved_bytes);
352 if (
opts.arenacompact)
354 if (!c->collect () &&
arena.contains (c))
373 if (!c->moved && !c->collect ())
376 }
else if (
opts.arenatype == 2) {
384 for (
auto idx :
vars)
386 if (!w.clause->moved && !w.clause->collect ())
400 for (
int idx =
queue.last; idx; idx =
link (idx).prev)
402 if (!w.clause->moved && !w.clause->collect ())
410 if (!c->collect () && !c->moved)
418 const auto end =
clauses.end ();
419 auto j =
clauses.begin (), i = j;
420 for (; i != end; i++) {
439 "collected %zd bytes %.0f%% of %zd garbage clauses",
441 percent (collected_bytes, collected_bytes + moved_bytes),
453#ifndef CADICAL_NDEBUG
455 for (
const auto &c :
clauses) {
484 int backtrack_level =
level + 1;
486 for (
auto v :
vars) {
487 for (
auto lit : {-v, v}) {
493 for (i = j; i != end; i++) {
505 LOG (
"need to backtrack to before level %d", backtrack_level);
511 LOG (c,
"removing from watch list");
514 ws.resize (j - ws.begin ());
520 if (backtrack_level - 1 <
level)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
void shrink_vector(std::vector< T > &v)
Watches::const_iterator const_watch_iterator
Occs::iterator occs_iterator
void shrink_occs(Occs &os)
Occs::const_iterator const_occs_iterator
const int * const_literal_iterator
double percent(double a, double b)
void rsort(I first, I last, Rank rank)
Watches::iterator watch_iterator
static size_t bytes(int size)
void delete_garbage_clauses()
void check_clause_stats()
void remove_garbage_binaries()
int64_t irredundant() const
void copy_clause(Clause *)
void garbage_collection()
void mark_garbage(Clause *)
void flush_watches(int lit, Watches &)
void copy_non_garbage_clauses()
void report(char type, int verbose_level=0)
void mark_garbage_external_forgettable(int64_t id)
void remove_falsified_literals(Clause *)
signed char val(int lit) const
int clause_contains_fixed_literal(Clause *)
int likely_phase(int idx)
void deallocate_clause(Clause *)
void backtrack(int target_level=0)
bool is_external_forgettable(int64_t id)
void update_reason_references()
vector< Clause * > clauses
void flush_all_occs_and_watches()
void mark_satisfied_clauses_as_garbage()
size_t shrink_clause(Clause *, int new_size)
Watches & watches(int lit)
void delete_clause(Clause *)
int64_t redundant() const
size_t flush_occs(int lit)