21 for (
auto idx :
vars) {
33 for (
const auto &c : os) {
36 if (
opts.instantiateonce && c->instantiated)
38 if (c->size <
opts.instantiateclslim)
42 for (
const auto &other : *c) {
43 const signed char tmp =
val (other);
55 "instantiation candidate literal %d "
56 "with %zu negative occurrences in",
69 LOG (
"instantiate assign %d",
lit);
88 LOG (
"instantiate propagating %d", -
lit);
94 const Watch w = *j++ = *i++;
95 const signed char b =
val (w.
blit);
116 const signed char u =
val (other);
126 while (k != end && (v =
val (r = *k)) < 0)
131 while (k != middle && (v =
val (r = *k)) < 0)
166 ws.resize (j - ws.begin ());
170 stats.propagations.instantiate += delta;
184 bool found =
false,
satisfied =
false, inactive =
false;
186 for (
const auto &other : *c) {
189 const signed char tmp =
val (other);
194 if (!tmp && !
active (other)) {
209 size_t before =
trail.size ();
213 LOG (c,
"trying to instantiate %d in",
lit);
219 for (
const auto &other : *c) {
222 const signed char tmp =
val (other);
238 for (
const auto &other : *reason) {
245 while (
trail.size () > before) {
246 const int other =
trail.back ();
247 LOG (
"instantiate unassign %d", other);
258 for (
const auto &other : *reason) {
275 for (
const auto &other : *c) {
297 LOG (
"instantiation failed");
306 LOG (
"instantiation succeeded");
307 stats.instantiated++;
321 const int64_t candidates = instantiator.candidates.
size ();
324 int64_t instantiated = 0;
329 LOG (
"propagation after connecting watches failed");
335 "attempting to instantiate %" PRId64
336 " candidate literal clause pairs",
339 !instantiator.candidates.empty ()) {
340 Instantiator::Candidate cand = instantiator.candidates.back ();
341 instantiator.candidates.pop_back ();
348 "trying to instantiate %d with "
349 "%zd negative occurrences in",
350 cand.lit, cand.negoccs);
355 "instantiation %" PRId64
" (%.1f%%) succeeded "
356 "(%.1f%%) with %zd negative occurrences in size %d clause",
357 tried,
percent (tried, candidates),
358 percent (instantiated, tried), cand.negoccs, cand.size);
361 "instantiated %" PRId64
" candidate successfully "
362 "out of %" PRId64
" tried %.1f%%",
363 instantiated, tried,
percent (instantiated, tried));
364 report (
'I', !instantiated);
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define CADICAL_assert(ignore)
void candidate(int l, Clause *c, int s, size_t n)
Watches::const_iterator const_watch_iterator
const int * const_literal_iterator
double percent(double a, double b)
Watches::iterator watch_iterator
void watch_literal(int lit, int blit, Clause *c)
void unwatch_clause(Clause *c)
vector< int64_t > lrat_chain
void report(char type, int verbose_level=0)
bool terminated_asynchronously(int factor=1)
void watch_clause(Clause *c)
void learn_empty_clause()
void elim(bool update_limits=true)
signed char val(int lit) const
vector< Clause * > inst_chain
int64_t unit_id(int lit) const
void collect_instantiation_candidates(Instantiator &)
void set_val(int lit, signed char val)
void strengthen_clause(Clause *, int)
void inst_assign(int lit)
void clear_analyzed_literals()
bool instantiate_candidate(int lit, Clause *)
void instantiate(Instantiator &)
void connect_watches(bool irredundant_only=false)