35 int lit = s < t ? a : b;
38 for (
const auto &c :
occs (
lit)) {
41 const int *
lits = c->literals;
65 lit = (t < r) ? c : a;
67 lit = (t < s) ? c : b;
70 for (
const auto &d :
occs (
lit)) {
71 const int *
lits = d->literals;
114 LOG (
"hyper binary resolving on pivot %d", pivot);
115 LOG (c,
"1st antecedent");
116 LOG (d,
"2nd antecedent");
121 for (
const auto &
lit : *c)
124 for (
const auto &
lit : *d) {
137 size_t size =
clause.size ();
157 LOG (
"starting hyper ternary resolutions on pivot %d", pivot);
159 for (
const auto &c :
occs (pivot)) {
173 for (
const auto &
lit : *c)
181 for (
const auto &d :
occs (-pivot)) {
192 for (
const auto &
lit : *d)
202 size_t size =
clause.size ();
203 bool red = (size == 3 || (c->redundant && d->redundant));
214 LOG (r,
"hyper ternary resolved");
216 for (
const auto &
lit : *r)
219 LOG (
"hyper ternary resolvent subsumes both antecedents");
251 if (
pos <=
opts.ternaryocclim && neg <=
opts.ternaryocclim) {
252 LOG (
"index %d has %zd positive and %zd negative occurrences", idx,
253 occs (idx).size (),
occs (-idx).size ());
254 int pivot = (neg <
pos ? -idx : idx);
257 flags (idx).ternary =
false;
283 for (
const auto &c :
clauses) {
290 for (
const auto &
lit : *c) {
313 for (
const auto &
lit : *c)
318 "connected %" PRId64
" ternary %.0f%% "
319 "and %" PRId64
" binary clauses %.0f%%",
325 for (
auto idx :
vars) {
340 for (
auto idx :
vars) {
348 PHASE (
"ternary",
stats.ternary,
"%d variables remain %.0f%%", remain,
351 PHASE (
"ternary",
stats.ternary,
"completed hyper ternary resolution");
372 if (
last.ternary.marked ==
stats.mark.ternary)
390 int64_t htrs_limit =
stats.current.redundant +
stats.current.irredundant;
391 htrs_limit *=
opts.ternarymaxadd;
396 int64_t steps_limit =
stats.ticks.ternary -
limit;
406 "will run a maximum of %d rounds "
407 "limited to %" PRId64
" steps and %" PRId64
" clauses",
408 opts.ternaryrounds, steps_limit, htrs_limit);
410 bool resolved_binary_clause =
false;
411 bool completed =
false;
422 int old_htrs2 =
stats.htrs2;
423 int old_htrs3 =
stats.htrs3;
425 int delta_htrs2 =
stats.htrs2 - old_htrs2;
426 int delta_htrs3 =
stats.htrs3 - old_htrs3;
428 "derived %d ternary and %d binary resolvents", delta_htrs3,
430 report (
'3', !
opts.reportall && !(delta_htrs2 + delta_htrs2));
432 resolved_binary_clause =
true;
442 LOG (
"propagation after connecting watches results in inconsistency");
447 last.ternary.marked =
stats.mark.ternary;
451 return resolved_binary_clause;
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
#define SET_EFFORT_LIMIT(LIMIT, NAME, THRESHHOLD)
double percent(double a, double b)
#define START_SIMPLIFIER(S, M)
#define STOP_SIMPLIFIER(S, M)
int64_t cache_lines(size_t bytes)
void mark_garbage(Clause *)
vector< int64_t > lrat_chain
void report(char type, int verbose_level=0)
bool terminated_asynchronously(int factor=1)
void learn_empty_clause()
signed char val(int lit) const
bool limit(const char *name, int)
signed char marked(int lit) const
bool ternary_find_binary_clause(int, int)
bool ternary_find_ternary_clause(int, int, int)
bool ternary_round(int64_t &steps, int64_t &htrs)
vector< Clause * > clauses
void ternary_idx(int idx, int64_t &steps, int64_t &htrs)
Clause * new_hyper_ternary_resolved_clause(bool red)
bool hyper_ternary_resolve(Clause *, int, Clause *)
void ternary_lit(int pivot, int64_t &steps, int64_t &htrs)
void connect_watches(bool irredundant_only=false)