54 coveror.
extend.push_back (0);
57 for (
const auto &other : coveror.
covered)
61 coveror.
extend.push_back (other);
73 LOG (
"covered literal addition %d", other);
76 coveror.
covered.push_back (other);
77 coveror.
added.push_back (other);
89 LOG (
"initial asymmetric literal addition %d",
lit);
107 stats.propagations.cover++;
109 bool subsumed =
false;
110 LOG (
"asymmetric literal propagation of %d",
lit);
115 while (!subsumed && i != eow) {
116 const Watch w = *j++ = *i++;
119 const signed char b =
val (w.
blit);
134 const signed char u =
val (other);
144 while (k != end && (v =
val (r = *k)) < 0)
149 while (k != middle && (v =
val (r = *k)) < 0)
177 ws.resize (j - ws.begin ());
190 LOG (
"no covered propagation on frozen literal %d",
lit);
194 stats.propagations.cover++;
196 LOG (
"covered propagation of %d",
lit);
200 const auto end = os.end ();
209 for (
auto i = os.begin (); i != end; i++) {
217 bool blocked =
false;
218 for (
const auto &other : *c) {
221 const signed char tmp =
val (other);
238 for (
const auto &other : *c) {
241 const signed char tmp =
val (other);
255 for (
const auto &other : *c) {
258 signed char tmp =
val (other);
271 for (
auto k = j; k != end; k++) {
272 const int other = *j++ = *k;
273 const int tmp =
marked (other);
280 const size_t new_size = j - coveror.
intersection.begin ();
290 auto begin = os.begin ();
304 LOG (
"all resolution candidates with %d blocked", -
lit);
309 LOG (
"empty intersection of resolution candidate literals");
312 "non-empty intersection of resolution candidate literals");
332 LOG (c,
"trying covered clauses elimination on");
334 for (
const auto &
lit : *c)
339 LOG (c,
"clause already satisfied");
350 LOG (
"assuming literals of candidate clause");
351 for (
const auto &
lit : *c) {
358 bool tautological =
false;
362 while (!tautological) {
374 if (coveror.
extend.empty ()) {
375 stats.cover.asymmetric++;
377 LOG (c,
"asymmetric tautological");
379 stats.cover.blocked++;
383 bool already_pushed =
false;
385 LOG (c,
"covered tautological");
388 for (
const auto &other : coveror.
extend) {
391 if (already_pushed) {
394 for (
auto i = 0, j = 0; i < c->
size; ++i, ++j) {
396 if (j >= (
int) coveror.
covered.size () ||
399 LOG (
"adding lit %d not needed for ATA",
lit);
401 external->push_clause_literal_on_extension_stack (
lit);
405 if (
proof && already_pushed) {
408 LOG (
"LEARNING clause with id %" PRId64, last_id);
414 external->push_zero_on_extension_stack ();
415 external->push_witness_literal_on_extension_stack (other);
416 external->push_zero_on_extension_stack ();
417 external->push_id_on_extension_stack (last_id);
418 external->push_zero_on_extension_stack ();
420 already_pushed =
true;
423 external->push_clause_literal_on_extension_stack (other);
433 for (
auto i = 0, j = 0; i < c->
size; ++i, ++j) {
435 if (j >= (
int) coveror.
covered.size () ||
438 LOG (
"adding lit %d not needed for ATA",
lit);
440 external->push_clause_literal_on_extension_stack (
lit);
458 for (
const auto &
lit : coveror.
added)
464 coveror.
added.clear ();
491 int64_t delta =
stats.propagations.search;
492 delta *= 1e-3 *
opts.covereffort;
493 if (delta <
opts.covermineff)
494 delta =
opts.covermineff;
495 if (delta >
opts.covermaxeff)
496 delta =
opts.covermaxeff;
497 delta = max (delta, ((int64_t) 2) *
active ());
500 "covered clause elimination limit of %" PRId64
" propagations",
503 int64_t
limit =
stats.propagations.cover + delta;
522 bool satisfied =
false, allfrozen =
true;
523 for (
const auto &
lit : *c)
537 for (
const auto &
lit : *c)
539 if (c->size <
opts.coverminclslim)
541 if (c->size >
opts.covermaxclslim)
545 schedule.push_back (c);
551 if (schedule.empty ()) {
553 PHASE (
"cover",
stats.cover.count,
"no previously untried clause left");
564 if (c->size <
opts.coverminclslim)
566 if (c->size >
opts.covermaxclslim)
570 schedule.push_back (c);
583 if (c->size <
opts.coverminclslim)
585 if (c->size >
opts.covermaxclslim)
589 schedule.push_back (c);
593 stable_sort (schedule.begin (), schedule.end (),
597 const size_t scheduled = schedule.
size ();
599 "scheduled %zd clauses %.0f%% with %" PRId64
" untried %.0f%%",
600 scheduled,
percent (scheduled,
stats.current.irredundant), untried,
621 Clause *c = schedule.back ();
622 schedule.pop_back ();
629 const size_t remain = schedule.
size ();
630 const size_t tried = scheduled - remain;
632 "eliminated %" PRId64
" covered clauses out of %zd tried %.0f%%",
633 covered, tried,
percent (covered, tried));
636 "remaining %zu clauses %.0f%% untried", remain,
639 PHASE (
"cover",
stats.cover.count,
"all scheduled clauses tried");
657 if (!
stats.current.irredundant)
671 if (
opts.restoreflush)
688 LOG (
"elimination produced %zd units",
691 LOG (
"propagating units before covered clause elimination "
692 "results in empty clause");
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
Watches::const_iterator const_watch_iterator
const int * const_literal_iterator
double percent(double a, double b)
Watches::iterator watch_iterator
#define START_SIMPLIFIER(S, M)
#define STOP_SIMPLIFIER(S, M)
std::vector< int > covered
struct CaDiCaL::Coveror::@205155162354335127052365031027306272263210135257 next
std::vector< int > intersection
std::vector< int > extend
bool cover_clause(Clause *c, Coveror &)
void watch_literal(int lit, int blit, Clause *c)
void covered_literal_addition(int lit, Coveror &)
void mark_garbage(Clause *)
vector< int64_t > lrat_chain
void report(char type, int verbose_level=0)
bool terminated_asynchronously(int factor=1)
void cover_push_extension(int lit, Coveror &)
void learn_empty_clause()
signed char val(int lit) const
bool limit(const char *name, int)
signed char marked(int lit) const
void set_val(int lit, signed char val)
void asymmetric_literal_addition(int lit, Coveror &)
bool cover_propagate_asymmetric(int lit, Clause *ignore, Coveror &)
bool cover_propagate_covered(int lit, Coveror &)
vector< Clause * > clauses
void require_mode(Mode m) const
void connect_watches(bool irredundant_only=false)
bool operator()(const Clause *a, const Clause *b)