27 if (
stats.inprobingphases &&
last.inprobe.reductions ==
stats.reductions)
29 return lim.inprobe <=
stats.conflicts;
62 for (
auto &chain : field) {
73 const size_t size = 2 * (1 + (size_t)
max_var);
75 for (
size_t i = 0; i < size; i++) {
120 LOG (reason,
"probe dominator LRAT for %d from", dom);
121 for (
const auto lit : *reason) {
124 const auto other = -
lit;
135 LOG (
"this may be a problem %d", other);
161 if (u->
trail > v->trail)
162 swap (l, k), swap (u, v);
167 v = &
var (k = parent);
170 LOG (
"dominator %d of %d and %d", l, a, b);
229#ifndef CADICAL_NDEBUG
232 for (k =
lits + 1; k != end; k++)
236 LOG (reason,
"hyper binary resolving");
240 int dom = -
lit, non_root_level_literals = 0;
241 for (k =
lits + 2; k != end; k++) {
242 const int other = -*k;
247 non_root_level_literals++;
250 if (non_root_level_literals &&
opts.probehbr) {
257 LOG (
"new %s hyper binary resolvent %d %d",
258 (red ?
"redundant" :
"irredundant"), -dom,
lits[0]);
273 LOG (reason,
"subsumed original");
276 }
else if (non_root_level_literals &&
lrat) {
314 const signed char tmp =
sign (
lit);
329 LOG (
"probe assign %d parent %d",
lit, parent);
331 LOG (
"probe assign %d probe",
lit);
333 LOG (
"probe assign %d negated failed literal UIP",
lit);
361 LOG (
"building chain for units");
365 if (
lit == reason_lit)
368 if (!
val (reason_lit))
370 const int signed_reason_lit =
val (reason_lit) * reason_lit;
371 int64_t
id =
unit_id (signed_reason_lit);
389 int64_t &ticks =
stats.ticks.probe;
392 LOG (
"probe propagating %d over binary clauses", -
lit);
395 for (
const auto &w : ws) {
398 const signed char b =
val (w.blit);
421 int64_t &ticks =
stats.ticks.probe;
427 LOG (
"probe propagating %d over large clauses", -
lit);
432 while (i != ws.
size ()) {
433 const Watch w = ws[j++] = ws[i++];
436 const signed char b =
val (w.
blit);
445 const signed char u =
val (other);
447 ws[j - 1].blit = other;
455 while (k != end && (v =
val (r = *k)) < 0)
460 while (k != middle && (v =
val (r = *k)) < 0)
498 while (i != ws.
size ())
506 stats.propagations.probe += delta;
519 LOG (
"analyzing failed literal probe %d",
failed);
531 LOG (
conflict,
"analyzing failed literal conflict");
535 const int other = -
lit;
546 LOG (
"found probing UIP %d", uip);
552 while (parent !=
failed) {
556 work.push_back (parent);
572 const int parent = work[j++];
573 const signed char tmp =
val (parent);
577 LOG (
"clashing failed parent %d", parent);
579 }
else if (tmp == 0) {
581 LOG (
"found unassigned failed parent %d", parent);
604 int first = 0, second = 0;
605 for (
const auto &
lit : *c) {
606 const signed char tmp =
val (
lit);
620 a = first, b = second;
641 int64_t &ticks =
stats.ticks.probe;
649 for (
const auto &c :
clauses) {
658 for (
auto idx :
vars) {
671 const bool have_pos_bin_occs =
noccs (idx) > 0;
672 const bool have_neg_bin_occs =
noccs (-idx) > 0;
674 if (have_pos_bin_occs == have_neg_bin_occs)
677 int probe = have_neg_bin_occs ? idx : -idx;
684 LOG (
"scheduling probe %d negated occs %" PRId64
"",
probe,
695 "scheduled %zd literals %.0f%%",
probes.size (),
705 int64_t &ticks =
stats.ticks.probe;
709 for (
const auto &c :
clauses) {
718 const auto eop =
probes.end ();
720 for (
auto i = j; i != eop; i++) {
725 const bool have_pos_bin_occs =
noccs (
lit) > 0;
726 const bool have_neg_bin_occs =
noccs (-
lit) > 0;
727 if (have_pos_bin_occs == have_neg_bin_occs)
729 if (have_pos_bin_occs)
734 LOG (
"keeping probe %d negated occs %" PRId64
"",
lit,
noccs (-
lit));
737 size_t remain = j -
probes.begin ();
739 size_t flushed =
probes.size () - remain;
749 "flushed %zd literals %.0f%% remaining %zd", flushed,
750 percent (flushed, remain + flushed), remain);
765 while (!
probes.empty ()) {
803 stats.probingrounds++;
812 "probing limit of %" PRId64
" propagations ",
limit);
814 int old_failed =
stats.failed;
816 int64_t old_probed =
stats.probed;
818 int64_t old_hbrs =
stats.hbrs;
827 for (
auto idx :
vars)
848 LOG (
"probing derived empty clause");
850 LOG (
"probing produced %zd units",
853 LOG (
"propagating units after probing results in empty clause");
861 int64_t probed =
stats.probed - old_probed;
863 int64_t hbrs =
stats.hbrs - old_hbrs;
866 "probed %" PRId64
" and found %d failed literals", probed,
failed);
870 "found %" PRId64
" hyper binary resolvents", hbrs);
929 stats.inprobingphases++;
934 const int before =
active ();
935 const int before_extended =
stats.variables_extension;
964 const int after =
active ();
965 const int after_extended =
stats.variables_extension;
966 const int diff_extended = after_extended - before_extended;
968 const int removed = before - after + diff_extended;
972 stats.inprobesuccess++;
974 "successfully removed %d active variables %.0f%%", removed,
978 "could not remove any active variable");
980 const int64_t delta =
981 25 *
opts.inprobeint * log10 (
stats.inprobingphases + 9);
982 lim.inprobe =
stats.conflicts + delta;
985 "new limit at %" PRId64
" conflicts after %" PRId64
" conflicts",
988 last.inprobe.reductions =
stats.reductions;
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
#define SET_EFFORT_LIMIT(LIMIT, NAME, THRESHHOLD)
void shrink_vector(std::vector< T > &v)
Watches::const_iterator const_watch_iterator
bool contained(int64_t c, int64_t l, int64_t u)
const int * const_literal_iterator
void erase_vector(std::vector< T > &v)
double percent(double a, double b)
void rsort(I first, I last, Rank rank)
#define START_SIMPLIFIER(S, M)
#define STOP_SIMPLIFIER(S, M)
void mark_duplicated_binary_clauses_as_garbage()
void watch_literal(int lit, int blit, Clause *c)
int64_t cache_lines(size_t bytes)
void inprobe(bool update_limits=true)
void mark_garbage(Clause *)
vector< int64_t > lrat_chain
bool is_binary_clause(Clause *c, int &, int &)
void report(char type, int verbose_level=0)
bool terminated_asynchronously(int factor=1)
void clean_probehbr_lrat()
void learn_empty_clause()
void probe_assign_unit(int lit)
signed char val(int lit) const
bool limit(const char *name, int)
int64_t unit_id(int lit) const
void set_val(int lit, signed char val)
void set_parent_reason_literal(int lit, int reason)
void failed_literal(int lit)
void probe_assign(int lit, int parent)
void backtrack(int target_level=0)
unsigned vlit(int lit) const
void init_probehbr_lrat()
void probe_assign_decision(int lit)
vector< Clause * > clauses
vector< vector< vector< int64_t > > > probehbr_chains
Clause * new_hyper_binary_resolved_clause(bool red, int glue)
void clear_analyzed_literals()
int probe_dominator(int a, int b)
void require_mode(Mode m) const
void get_probehbr_lrat(int lit, int uip)
int get_parent_reason_literal(int lit)
void probe_lrat_for_units(int lit)
void learn_unit_clause(int lit)
void probe_dominator_lrat(int dom, Clause *reason)
void set_probehbr_lrat(int lit, int uip)
int hyper_binary_resolve(Clause *)
probe_negated_noccs_rank(Internal *i)
Type operator()(int a) const