49 LOG (c,
"trying to block on %d",
lit);
62 LOG (
"resolving against at most %zd clauses with %d", os.
size (), -
lit);
68 const auto end_of_os = os.end ();
73 for (; i != end_of_os; i++) {
86 LOG (d,
"resolving on %d against",
lit);
96 for (l = d->
begin (); l != end_of_d; l++) {
101 const int other = *l;
110 LOG (
"found tautological literal %d", other);
117 LOG (
"no tautological literal found");
123 while (l-- != begin_of_d) {
124 const int other = *l;
140 const auto boc = os.begin ();
156 for (
const auto &c :
clauses) {
162 if (c->size <=
opts.blockmaxclslim)
165 for (
const auto &
lit : *c)
171 for (
const auto &c :
clauses) {
178 for (
const auto &
lit : *c) {
210 for (
auto idx :
vars) {
231 LOG (
"scheduling %d with %" PRId64
" positive and %" PRId64
232 " negative occurrences",
239 "scheduled %zd candidate literals %.2f%% (%d skipped %.2f%%)",
240 blocker.schedule.
size (),
262#ifndef CADICAL_NDEBUG
263 for (
const auto &c : nos)
266 stats.blockpurelits++;
267 LOG (
"found pure literal %d",
lit);
271 for (
const auto &c :
pos) {
275 LOG (c,
"pure literal %d in",
lit);
276 blocker.reschedule.push_back (c);
278 proof->weaken_minus (c);
293 LOG (
"blocking %" PRId64
" clauses on pure literal %d", pured,
lit);
313 for (
const auto &c : nos) {
318#ifndef CADICAL_NDEBUG
326 if (d && d->
size >
opts.blockmaxclslim) {
327 LOG (d,
"skipped common antecedent");
335 LOG (d,
"common %d antecedent",
lit);
345 const auto eop =
pos.end ();
346 auto j =
pos.begin (), i = j;
348 for (; i != eop; i++) {
355 if (c->
size >
opts.blockmaxclslim) {
361 if (c->
size <
opts.blockminclslim) {
368 LOG (c,
"trying to block on %d",
lit);
380 for (l = c->
begin (); l != end_of_c; l++) {
381 const int other = *l;
390 LOG (
"found tautological literal %d", other);
397 LOG (
"no tautological literal found");
402 while (l-- != begin_of_c) {
403 const int other = *l;
414 proof->weaken_minus (c);
417 blocker.reschedule.push_back (c);
421 if (j ==
pos.begin ())
424 pos.resize (j -
pos.begin ());
426 stats.blocked += blocked;
427 LOG (
"blocked %" PRId64
" clauses on %d (skipped %" PRId64
")", blocked,
452 for (
const auto &c : nos)
455 const auto eop =
pos.end ();
456 auto j =
pos.begin (), i = j;
458 for (; i != eop; i++) {
471 for (l = c->
begin (); l != eoc; l++) {
472 const int other = *l;
482 blocker.candidates.push_back (c);
484 if (j ==
pos.begin ())
487 pos.resize (j -
pos.begin ());
491 for (
const auto &c : nos)
494 return blocker.candidates.size ();
508 for (
const auto &c : blocker.candidates)
514 for (
const auto &c : nos) {
520 for (l = c->begin (); l != eoc; l++) {
521 const int other = *l;
534 for (
const auto &c : blocker.candidates)
538 LOG (res,
"common non-tautological resolvent producing");
539 blocker.candidates.clear ();
564 const auto eon = nos.end ();
565 auto j = nos.begin (), i = j;
566 for (; i != eon; i++) {
570 else if (c->
size > max_size)
573 if (j == nos.begin ())
576 nos.resize (j - nos.begin ());
584 if (max_size >
opts.blockmaxclslim) {
585 LOG (
"maximum size %d of clauses with %d exceeds clause size limit %d",
586 max_size, -
lit,
opts.blockmaxclslim);
590 LOG (
"maximum size %d of clauses with %d", max_size, -
lit);
599 LOG (
"no candidate clauses found");
603 LOG (
"found %zd candidate clauses", candidates);
610 LOG (
"impossible to block any candidate clause on %d",
lit);
615 LOG (
"trying to block %zd clauses out of %" PRId64
" with literal %d",
622 for (
const auto &c : blocker.candidates) {
630 proof->weaken_minus (c);
633 blocker.reschedule.push_back (c);
637 LOG (
"blocked %" PRId64
638 " clauses on %d out of %zd candidates in %zd occurrences",
639 blocked,
lit, blocker.candidates.size (),
occs (
lit).size ());
641 blocker.candidates.clear ();
642 stats.blocked += blocked;
658 for (
const auto &other : *c) {
660 int64_t &n =
noccs (other);
664 LOG (
"updating %d with %" PRId64
" positive and %" PRId64
665 " negative occurrences",
671 LOG (
"rescheduling to block clauses on %d", -other);
685 while (!blocker.reschedule.empty ()) {
686 Clause *c = blocker.reschedule.back ();
687 blocker.reschedule.pop_back ();
710 LOG (
"blocking literal candidate %d "
711 "with %" PRId64
" positive and %" PRId64
" negative occurrences",
747 if (!
stats.current.irredundant)
757 LOG (
"propagating units results in empty clause");
771 LOG (
"block-%" PRId64
"",
stats.blockings);
785 int64_t blocked =
stats.blocked;
786 int64_t resolutions =
stats.blockres;
787 int64_t purelits =
stats.blockpurelits;
788 int64_t pured =
stats.blockpured;
801 resolutions =
stats.blockres - resolutions;
802 blocked =
stats.blocked - blocked;
805 "blocked %" PRId64
" clauses in %" PRId64
" resolutions", blocked,
808 pured =
stats.blockpured - pured;
809 purelits =
stats.blockpurelits - purelits;
816 "found %" PRId64
" pure literals in %" PRId64
" clauses",
819 PHASE (
"block",
stats.blockings,
"no pure literals found");
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
bool contains(unsigned e) const
void push_back(unsigned e)
const int * const_literal_iterator
void erase_vector(std::vector< T > &v)
double percent(double a, double b)
#define START_SIMPLIFIER(S, M)
#define STOP_SIMPLIFIER(S, M)
bool is_blocked_clause(Clause *c, int pivot)
bool marked_block(int lit) const
void block_reschedule_clause(Blocker &, int lit, Clause *)
void block_literal_with_at_least_two_negative_occs(Blocker &, int lit)
void mark_garbage(Clause *)
void report(char type, int verbose_level=0)
void mark_redundant_clauses_with_eliminated_variables_as_garbage()
void block_literal(Blocker &, int lit)
bool terminated_asynchronously(int factor=1)
Clause * block_impossible(Blocker &, int lit)
void learn_empty_clause()
bool marked_skip(int lit)
void block_pure_literal(Blocker &, int lit)
void block_reschedule(Blocker &, int lit)
void unmark_block(int lit)
signed char val(int lit) const
signed char marked(int lit) const
void block_literal_with_one_negative_occ(Blocker &, int lit)
unsigned vlit(int lit) const
void block_schedule(Blocker &)
vector< Clause * > clauses
size_t block_candidates(Blocker &, int lit)
bool marked2(int lit) const
void mark_satisfied_clauses_as_garbage()
size_t flush_occs(int lit)
void connect_watches(bool irredundant_only=false)
bool operator()(unsigned a, unsigned b)