14 for (
const auto &
lit : *c)
19 for (
const auto &
lit : *c)
24 for (
const auto &
lit : *c)
47 LOG (c,
"marking removed");
49 for (
const auto &
lit : *c)
74 LOG (c,
"marking added");
76 for (
const auto &
lit : *c)
85 const int size = (int)
clause.size ();
120 for (
int i = 0; i < size; i++)
128 stats.current.total++;
132 stats.current.redundant++;
133 stats.added.redundant++;
135 stats.irrlits += size;
136 stats.current.irredundant++;
137 stats.added.irredundant++;
142 LOG (c,
"new pointer %p", (
void *) c);
154 const int tier1limit =
tier1[
false];
155 const int tier2limit = max (tier1limit,
tier2[
false]);
160 int old_glue = c->
glue;
161 if (new_glue >= old_glue)
163 if (old_glue > tier1limit && new_glue <= tier1limit) {
164 LOG (c,
"promoting with new glue %d to tier1", new_glue);
167 }
else if (old_glue > tier2limit && new_glue <= tier2limit) {
168 LOG (c,
"promoting with new glue %d to tier2", new_glue);
170 }
else if (old_glue <= tier2limit)
171 LOG (c,
"keeping with new glue %d in tier2", new_glue);
173 LOG (c,
"keeping with new glue %d in tier3", new_glue);
174 stats.improvedglue++;
183 int old_glue = c->
glue;
184 const int tier1limit =
tier1[
false];
185 const int tier2limit = max (tier1limit,
tier2[
false]);
186 if (new_glue >= old_glue)
188 if (new_glue <= tier1limit) {
189 LOG (c,
"promoting with new glue %d to tier1", new_glue);
192 }
else if (old_glue > tier2limit && new_glue <= tier2limit) {
193 LOG (c,
"promoting with new glue %d to tier2", new_glue);
195 }
else if (old_glue <= tier2limit)
196 LOG (c,
"keeping with new glue %d in tier2", new_glue);
198 LOG (c,
"keeping with new glue %d in tier3", new_glue);
199 stats.improvedglue++;
217 int old_size = c->
size;
219#ifndef CADICAL_NDEBUG
220 for (
int i = c->
size; i < new_size; i++)
224 if (c->
pos >= new_size)
227 size_t old_bytes = c->
bytes ();
229 size_t new_bytes = c->
bytes ();
230 size_t res = old_bytes - new_bytes;
235 int delta_size = old_size - new_size;
237 stats.irrlits -= delta_size;
251 char *
p = (
char *) c;
254 LOG (c,
"deallocate pointer %p", (
void *) c);
259 LOG (c,
"delete pointer %p", (
void *) c);
260 size_t bytes = c->
bytes ();
261 stats.collected += bytes;
264 stats.garbage.bytes -= bytes;
266 stats.garbage.clauses--;
279 proof->delete_clause (c);
310 proof->delete_clause (c);
320 stats.current.total--;
322 size_t bytes = c->
bytes ();
325 stats.current.redundant--;
328 stats.current.irredundant--;
333 stats.garbage.bytes += bytes;
334 stats.garbage.clauses++;
339 LOG (c,
"marked garbage pointer %p", (
void *) c);
357 const signed char tmp =
sign (
lit);
361 const unsigned uidx =
vlit (
lit);
364 LOG (
"original unit assign %d",
lit);
372 LOG (
"propagation of original unit results in conflict");
399 unordered_set<int> learned_levels;
400 size_t unassigned = 0;
403 LOG (
"skipping clause since formula is already inconsistent");
410 LOG (
"removing duplicated literal %d",
lit);
411 }
else if (tmp < 0) {
412 LOG (
"tautological since both %d and %d occur", -
lit,
lit);
418 LOG (
"removing falsified literal %d",
lit);
421 unsigned eidx = (elit > 0) + 2u * (
unsigned) abs (elit);
427 }
else if (tmp > 0) {
428 LOG (
"satisfied since literal %d true",
lit);
446 stats.ext_prop.elearn_conf++;
455 proof->delete_external_original_clause (
id,
false,
external->eclause);
459 const size_t size =
clause.size ();
466 proof->delete_external_original_clause (
id,
false,
483 stats.ext_prop.elearn_conf++;
486 VERBOSE (1,
"found empty original clause");
488 VERBOSE (1,
"found falsified original clause");
493 }
else if (size == 1) {
518#ifndef CADICAL_NDEBUG
521 int glue = (int) (learned_levels.size () + unassigned);
544#ifndef CADICAL_NDEBUG
545 for (
size_t i = 2; i <
clause.size (); i++)
576 size_t size =
clause.size ();
587 stats.factor_added++;
595 for (
const auto &
lit : *res) {
605 bool full_watching) {
607 size_t size =
clause.size ();
624 const int new_glue = orig->
glue;
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
static size_t bytes(int size)
Clause * new_factor_clause()
void promote_clause_glue_only(Clause *, int new_glue)
Clause * new_hyper_ternary_resolved_clause_and_watch(bool red, bool)
void mark_garbage(Clause *)
bool ext_clause_forgettable
vector< int64_t > lrat_chain
Clause * new_learned_redundant_clause(int glue)
void mark_ternary(int lit)
void move_literals_to_watch()
void mark_removed(int lit)
void promote_clause(Clause *, int new_glue)
void add_new_original_clause(int64_t)
void handle_external_clause(Clause *)
void mark_garbage_external_forgettable(int64_t id)
void watch_clause(Clause *c)
void learn_empty_clause()
vector< int64_t > conclusion
signed char val(int lit) const
signed char marked(int lit) const
int64_t unit_id(int lit) const
void set_val(int lit, signed char val)
Clause * new_clause(bool red, int glue=0)
void deallocate_clause(Clause *)
void backtrack(int target_level=0)
bool is_external_forgettable(int64_t id)
unsigned vlit(int lit) const
vector< Clause * > clauses
Clause * new_resolved_irredundant_clause()
Clause * new_hyper_binary_resolved_clause(bool red, int glue)
int64_t & unit_clauses(int uidx)
size_t shrink_clause(Clause *, int new_size)
void mark_subsume(int lit)
void mark_factor(int lit)
void mark_added(int lit, int size, bool redundant)
Clause * new_clause_as(const Clause *orig)
void assign_original_unit(int64_t, int)
Clause * new_hyper_ternary_resolved_clause(bool red)
bool likely_to_be_kept_clause(Clause *c)
void delete_clause(Clause *)
int64_t redundant() const
void check_watched_literal_invariants()