ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
substitute.c
Go to the documentation of this file.
1#include "substitute.h"
2#include "allocate.h"
3#include "backtrack.h"
4#include "inline.h"
5#include "print.h"
6#include "proprobe.h"
7#include "report.h"
8#include "terminate.h"
9#include "trail.h"
10#include "weaken.h"
11
12#include <string.h>
13
15
16static void assign_and_propagate_units (kissat *solver, unsigneds *units) {
17 if (EMPTY_STACK (*units))
18 return;
19 LOG ("assigning and propagating %zu units", SIZE_STACK (*units));
20 while (!solver->inconsistent && !EMPTY_STACK (*units)) {
21 const unsigned unit = POP_STACK (*units);
22 LOG ("trying to assign and propagate unit %s now", LOGLIT (unit));
23 const value value = VALUE (unit);
24 if (value > 0) {
25 LOG ("skipping satisfied unit %s", LOGLIT (unit));
26 } else if (value < 0) {
27 LOG ("inconsistent unit %s", LOGLIT (unit));
30 solver->inconsistent = true;
31 } else {
33 INC (substitute_units);
34 KISSAT_assert (!solver->level);
35 (void) kissat_probing_propagate (solver, 0, false);
36 }
37 }
38}
39
40static void determine_representatives (kissat *solver, unsigned *repr) {
41 size_t bytes = LITS * sizeof (unsigned);
42 unsigned *mark = (unsigned*)kissat_calloc (solver, LITS, sizeof *mark);
43 unsigned *reach = (unsigned*)kissat_malloc (solver, LITS * sizeof *reach);
44 watches *all_watches = solver->watches;
45 const flags *const flags = solver->flags;
46 unsigned reached = 0;
47 unsigneds scc;
48 unsigneds work;
49 unsigneds units;
50 INIT_STACK (scc);
51 INIT_STACK (work);
52 INIT_STACK (units);
53#ifdef LOGGING
54 unsigned trivial_sccs = 0;
55 unsigned non_trivial_sccs = 0;
56#endif
57 bool inconsistent = false;
58 uint64_t ticks = 0;
59 for (all_literals (root)) {
60 if (inconsistent)
61 break;
62 if (mark[root])
63 continue;
64 if (!ACTIVE (IDX (root)))
65 continue;
68 LOG ("substitute root %s", LOGLIT (root));
69 PUSH_STACK (work, root);
70 bool failed = false;
71 const unsigned mark_root = reached + 1;
72 while (!inconsistent && !EMPTY_STACK (work)) {
73 unsigned lit = TOP_STACK (work);
74 if (lit == INVALID_LIT) {
75 (void) POP_STACK (work);
76 lit = POP_STACK (work);
77 const unsigned not_lit = NOT (lit);
78 unsigned reach_lit = reach[lit];
79 unsigned mark_lit = mark[lit];
80 KISSAT_assert (reach_lit == mark_lit);
81 KISSAT_assert (repr[lit] == INVALID_LIT);
82 watches *watches = all_watches + not_lit;
83 const size_t size_watches = SIZE_WATCHES (*watches);
84 ticks += 1 + kissat_cache_lines (size_watches, sizeof (watch));
86 if (!watch.type.binary)
87 continue;
88 const unsigned other = watch.binary.lit;
89 const unsigned idx_other = IDX (other);
90 if (!flags[idx_other].active)
91 continue;
92 KISSAT_assert (mark[other]);
93 unsigned reach_other = reach[other];
94 if (reach_other < reach_lit)
95 reach_lit = reach_other;
96 }
97 if (reach_lit != mark_lit) {
98 LOG ("reach[%s] = %u", LOGLIT (lit), reach_lit);
99 reach[lit] = reach_lit;
100 continue;
101 }
102 unsigned *end_scc = END_STACK (scc);
103 unsigned *begin_scc = end_scc;
104 do
105 KISSAT_assert (begin_scc != BEGIN_STACK (scc));
106 while (*--begin_scc != lit);
107 SET_END_OF_STACK (scc, begin_scc);
108 const size_t size_scc = end_scc - begin_scc;
109 unsigned min_lit = lit;
110 if (size_scc > 1) {
111 for (const unsigned *p = begin_scc; p != end_scc; p++) {
112 const unsigned other = *p;
113 if (other < min_lit)
114 min_lit = other;
115 }
116#ifdef LOGGING
117 non_trivial_sccs++;
118#endif
119 LOG ("size %zu SCC entered trough %s representative %s", size_scc,
120 LOGLIT (lit), LOGLIT (min_lit));
121 } else {
122#ifdef LOGGING
123 trivial_sccs++;
124#endif
125 LOG ("trivial size one SCC with %s", LOGLIT (lit));
126 KISSAT_assert (min_lit == lit);
127 }
128 for (const unsigned *p = begin_scc; p != end_scc; p++) {
129 const unsigned other = *p;
130 LOG ("substitute repr[%s] = %s", LOGLIT (other),
131 LOGLIT (min_lit));
132 repr[other] = min_lit;
133 reach[other] = UINT_MAX;
134
135 const unsigned not_other = NOT (other);
136 const unsigned repr_not_other = repr[not_other];
137 if (repr_not_other == INVALID_LIT)
138 continue;
139 if (min_lit == repr_not_other) {
140 LOG ("clashing literals %s and %s in same SCC", LOGLIT (other),
141 LOGLIT (not_other));
142 PUSH_STACK (units, min_lit);
143 inconsistent = true;
144 break;
145 }
146 KISSAT_assert (NOT (min_lit) == repr_not_other);
147 if (failed)
148 continue;
149 const unsigned mark_not_other = mark[not_other];
150 KISSAT_assert (mark_not_other != INVALID_LIT);
151 KISSAT_assert (mark[root] == mark_root);
152 if (mark_root > mark_not_other)
153 continue;
154 LOG ("root %s implies both %s and %s", LOGLIT (root),
155 LOGLIT (other), LOGLIT (not_other));
156 const unsigned unit = NOT (root);
157 PUSH_STACK (units, unit);
158 failed = true;
159 }
160 if (inconsistent)
161 break;
162 } else if (!mark[lit]) {
163 PUSH_STACK (work, INVALID_LIT);
164 PUSH_STACK (scc, lit);
165 mark[lit] = reach[lit] = ++reached;
166 LOG ("substitute mark[%s] = %u", LOGLIT (lit), reached);
167 const unsigned not_lit = NOT (lit);
168 watches *watches = all_watches + not_lit;
169 const size_t size_watches = SIZE_WATCHES (*watches);
170 ticks += 1 + kissat_cache_lines (size_watches, sizeof (watch));
172 if (!watch.type.binary)
173 continue;
174 const unsigned other = watch.binary.lit;
175 const unsigned idx_other = IDX (other);
176 if (!flags[idx_other].active)
177 continue;
178 if (!mark[other])
179 PUSH_STACK (work, other);
180 }
181 } else
182 (void) POP_STACK (work);
183 }
184 }
185 RELEASE_STACK (work);
186 RELEASE_STACK (scc);
188 "determining substitution "
189 "representatives took %" PRIu64
190 " 'substitute_ticks'",
191 ticks);
192 ADD (substitute_ticks, ticks);
193 LOG ("reached %u literals", reached);
194 LOG ("found %u non-trivial SCCs", non_trivial_sccs);
195 LOG ("found %u trivial SCCs", trivial_sccs);
196 LOG ("found %zu units", SIZE_STACK (units));
197 assign_and_propagate_units (solver, &units);
198 KISSAT_assert (!inconsistent || solver->inconsistent);
199 RELEASE_STACK (units);
200 kissat_free (solver, reach, bytes);
201 kissat_free (solver, mark, bytes);
202 for (all_literals (lit))
203 if (repr[lit] == INVALID_LIT)
204 repr[lit] = lit;
205}
206
207static bool *add_representative_equivalences (kissat *solver,
208 unsigned *repr) {
209 if (solver->inconsistent)
210 return 0;
211 bool *eliminate = (bool*)kissat_calloc (solver, VARS, sizeof *eliminate);
212 for (all_variables (idx)) {
213 if (!ACTIVE (idx))
214 continue;
215 const unsigned lit = LIT (idx);
216 const unsigned other = repr[lit];
217 if (lit == other)
218 continue;
219 KISSAT_assert (other < lit);
220#ifdef CHECKING_OR_PROVING
221 const unsigned not_lit = NOT (lit);
222 const unsigned not_other = NOT (other);
223
224 CHECK_AND_ADD_BINARY (not_lit, other);
225 ADD_BINARY_TO_PROOF (not_lit, other);
226
227 CHECK_AND_ADD_BINARY (lit, not_other);
228 ADD_BINARY_TO_PROOF (lit, not_other);
229#endif
230 eliminate[idx] = true;
231 }
232 return eliminate;
233}
234
235static void remove_representative_equivalences (kissat *solver,
236 unsigned *repr,
237 bool *eliminate) {
238 if (!solver->inconsistent) {
239 value *values = solver->values;
240 const bool incremental = GET_OPTION (incremental);
241 for (all_variables (idx)) {
242 if (!eliminate[idx])
243 continue;
244
245 KISSAT_assert (ACTIVE (idx));
246
247 const unsigned lit = LIT (idx);
248 const unsigned other = repr[lit];
249 const unsigned not_lit = NOT (lit);
250 const unsigned not_other = NOT (other);
251 KISSAT_assert (other < lit);
252 KISSAT_assert (not_other < not_lit);
253
254 REMOVE_CHECKER_BINARY (not_lit, other);
255 DELETE_BINARY_FROM_PROOF (not_lit, other);
256
257 REMOVE_CHECKER_BINARY (lit, not_other);
258 DELETE_BINARY_FROM_PROOF (lit, not_other);
259
260 INC (substituted);
262 const value other_value = values[other];
263 if (incremental || other_value) {
264 if (other_value <= 0)
265 kissat_weaken_binary (solver, not_lit, other);
266 if (other_value >= 0)
267 kissat_weaken_binary (solver, lit, not_other);
268 } else {
269 kissat_weaken_binary (solver, not_lit, other);
271 }
272 }
273 }
274 if (eliminate)
275 kissat_dealloc (solver, eliminate, VARS, sizeof *eliminate);
276}
277
278static void substitute_binaries (kissat *solver, unsigned *repr) {
279 if (solver->inconsistent)
280 return;
281 KISSAT_assert (sizeof (watch) == sizeof (unsigned));
282 statches *delayed_watched = (statches *) &solver->delayed;
283 watches *all_watches = solver->watches;
284#ifdef LOGGING
285 size_t removed = 0;
286 size_t substituted = 0;
287#endif
288 unsigneds units;
289 INIT_STACK (units);
290 litwatches delayed_deleted;
291 INIT_STACK (delayed_deleted);
292#ifdef CHECKING_OR_PROVING
293 litpairs delayed_removed;
294 INIT_STACK (delayed_removed);
295#endif
296 for (all_literals (lit)) {
297 const unsigned repr_lit = repr[lit];
298 const unsigned not_repr_lit = NOT (repr_lit);
299 KISSAT_assert (EMPTY_STACK (*delayed_watched));
300 watches *watches = all_watches + lit;
301 watch *begin = BEGIN_WATCHES (*watches), *q = begin;
302 const watch *const end = END_WATCHES (*watches), *p = q;
303 while (p != end) {
304 const watch src = *p++;
305 if (!src.type.binary)
306 continue;
307 const unsigned other = src.binary.lit;
308 const unsigned repr_other = repr[other];
309 LOGBINARY (lit, other, "substituting");
310 const litwatch litwatch = {lit, src};
311 if (repr_other == not_repr_lit) {
312 LOGBINARY (repr_other, repr_lit, "becomes tautological");
313 if (lit < other) {
314#ifdef LOGGING
315 removed++;
316#endif
317 PUSH_STACK (delayed_deleted, litwatch);
318 }
319 } else if (repr_other == repr_lit) {
320 const unsigned unit = repr_lit;
321 LOG ("simplifies to unit %s", LOGLIT (unit));
322 if (lit < other) {
323#ifdef LOGGING
324 removed++;
325#endif
326 PUSH_STACK (units, unit);
327 PUSH_STACK (delayed_deleted, litwatch);
328 }
329 } else {
330 watch dst = src;
331 dst.binary.lit = repr_other;
332 if (lit == repr_lit && other == repr_other) {
333 LOGBINARY (lit, other, "unchanged");
334 *q++ = dst;
335 } else {
336 if (lit == repr_lit) {
337 LOGBINARY (repr_lit, repr_other, "substituted in place");
338 *q++ = dst;
339 } else {
340 LOGBINARY (repr_lit, repr_other, "delayed substituted");
341 PUSH_STACK (*delayed_watched, dst);
342 }
343
344 if (lit < other) {
345#ifdef LOGGING
346 substituted++;
347#endif
348#ifdef CHECKING_OR_PROVING
349 ADD_BINARY_TO_PROOF (repr_lit, repr_other);
350 CHECK_AND_ADD_BINARY (repr_lit, repr_other);
351 const litpair litpair = {{lit, other}};
352 PUSH_STACK (delayed_removed, litpair);
353#endif
354 }
355 }
356 }
357 }
359 if (lit == repr_lit)
360 continue;
361 watches = all_watches + repr_lit;
362 for (all_stack (watch, watch, *delayed_watched))
364 CLEAR_STACK (*delayed_watched);
365 }
366 assign_and_propagate_units (solver, &units);
367 RELEASE_STACK (units);
368 for (all_stack (litwatch, litwatch, delayed_deleted)) {
369 const unsigned lit = litwatch.lit;
370 const watch watch = litwatch.watch;
372 const unsigned other = watch.binary.lit;
374 }
375 RELEASE_STACK (delayed_deleted);
376#ifdef CHECKING_OR_PROVING
377 for (all_stack (litpair, litpair, delayed_removed)) {
378 const unsigned lit = litpair.lits[0];
379 const unsigned other = litpair.lits[1];
381 REMOVE_CHECKER_BINARY (lit, other);
382 }
383 RELEASE_STACK (delayed_removed);
384#endif
385 LOG ("substituted %zu binary clauses", substituted);
386 LOG ("removed %zu binary clauses", removed);
387}
388
389static void substitute_clauses (kissat *solver, unsigned *repr) {
390 if (solver->inconsistent)
391 return;
392 const value *const values = solver->values;
393 value *marks = solver->marks;
394#ifdef LOGGING
395 size_t substituted = 0;
396 size_t removed = 0;
397#endif
398 unsigneds units;
399 INIT_STACK (units);
400 references delayed_garbage;
401 INIT_STACK (delayed_garbage);
402 for (all_clauses (c)) {
403 if (c->garbage)
404 continue;
405 LOGCLS (c, "substituting");
406 KISSAT_assert (EMPTY_STACK (solver->clause));
407 bool shrink = false;
408 bool satisfied = false;
409 bool substitute = false;
410 bool tautological = false;
411 for (all_literals_in_clause (lit, c)) {
412 const value lit_value = values[lit];
413 if (lit_value < 0) {
414 LOG ("dropping falsified %s", LOGLIT (lit));
415 shrink = true;
416 continue;
417 }
418 if (lit_value > 0) {
419 LOGCLS (c, "satisfied by %s", LOGLIT (lit));
420 satisfied = true;
421 break;
422 }
423 const unsigned repr_lit = repr[lit];
424 const value repr_value = values[repr_lit];
425 if (repr_value < 0) {
426 LOG ("dropping falsified substituted %s (was %s)",
427 LOGLIT (repr_lit), LOGLIT (lit));
428 shrink = true;
429 continue;
430 }
431 if (repr_value > 0) {
432 LOGCLS (c, "satisfied by substituted %s (was %s)",
433 LOGLIT (repr_lit), LOGLIT (lit));
434 satisfied = true;
435 break;
436 }
437 if (lit != repr_lit) {
438 KISSAT_assert (!values[repr_lit]);
439 LOG ("substituted literal %s (was %s)", LOGLIT (repr_lit),
440 LOGLIT (lit));
441 substitute = true;
442 } else
443 LOG ("copying literal %s", LOGLIT (lit));
444 if (marks[repr_lit]) {
445 shrink = true;
446 LOG ("skipping duplicated %s", LOGLIT (repr_lit));
447 continue;
448 }
449 const unsigned not_repr_lit = NOT (repr_lit);
450 if (marks[not_repr_lit]) {
451 LOG ("substituted clause tautological "
452 "containing both %s and %s",
453 LOGLIT (not_repr_lit), LOGLIT (repr_lit));
454 tautological = true;
455 break;
456 }
457 marks[repr_lit] = true;
458 PUSH_STACK (solver->clause, repr_lit);
459 }
460 if (satisfied || tautological) {
462#ifdef LOGGING
463 removed++;
464#endif
465 } else if (substitute || shrink) {
466 const unsigned size = SIZE_STACK (solver->clause);
467 if (!size) {
468 LOG ("simplifies to empty clause");
469
472
473 solver->inconsistent = true;
474 break;
475 } else if (size == 1) {
476 KISSAT_assert (shrink);
477#ifdef LOGGING
478 removed++;
479#endif
480 const unsigned unit = PEEK_STACK (solver->clause, 0);
481 LOGCLS (c, "simplifies to unit %s", LOGLIT (unit));
482 PUSH_STACK (units, unit);
483 const reference ref = kissat_reference_clause (solver, c);
484 PUSH_STACK (delayed_garbage, ref);
485 } else if (size == 2) {
486 KISSAT_assert (shrink);
487#ifdef LOGGING
488 substituted++;
489#endif
490 const unsigned first = PEEK_STACK (solver->clause, 0);
491 const unsigned second = PEEK_STACK (solver->clause, 1);
492 LOGCLS (c, "unsubstituted");
493 LOGBINARY (first, second, "substituted");
494 kissat_new_binary_clause (solver, first, second);
496 } else {
497#ifdef LOGGING
498 substituted++;
499#endif
500 LOGCLS (c, "unsubstituted");
501
502 const unsigned new_size = SIZE_STACK (solver->clause);
503 unsigned *new_lits = BEGIN_STACK (solver->clause);
504
505 ADD_LITS_TO_PROOF (new_size, new_lits);
506 CHECK_AND_ADD_LITS (new_size, new_lits);
507
510
511 const unsigned old_size = c->size;
512 unsigned *old_lits = c->lits;
513
514 KISSAT_assert (new_size <= old_size);
515 memcpy (old_lits, new_lits, new_size * sizeof *old_lits);
516
517 KISSAT_assert (shrink == (new_size < old_size));
518 if (new_size < old_size) {
519 c->size = new_size;
520 c->searched = 2;
521 if (!c->shrunken) {
522 c->shrunken = true;
523 KISSAT_assert (c->lits == old_lits);
524 old_lits[old_size - 1] = INVALID_LIT;
525 }
526 }
527 LOGCLS (c, "unsorted substituted");
528 }
529 } else
530 LOGCLS (c, "unchanged");
531 for (all_stack (unsigned, lit, solver->clause))
532 marks[lit] = 0;
533 CLEAR_STACK (solver->clause);
534 }
535 assign_and_propagate_units (solver, &units);
536 RELEASE_STACK (units);
537 for (all_stack (reference, ref, delayed_garbage)) {
538 clause *c = kissat_dereference_clause (solver, ref);
540 }
541 RELEASE_STACK (delayed_garbage);
542 LOG ("substituted %zu large clauses", substituted);
543 LOG ("removed %zu substituted large clauses", removed);
544}
545
546static bool substitute_round (kissat *solver, unsigned round) {
547 KISSAT_assert (!solver->inconsistent);
548 const unsigned active = solver->active;
549 size_t bytes = LITS * sizeof (unsigned);
550 unsigned *repr = (unsigned*)kissat_malloc (solver, bytes);
551 memset (repr, 0xff, bytes);
552 determine_representatives (solver, repr);
553 bool *eliminate = add_representative_equivalences (solver, repr);
554 substitute_binaries (solver, repr);
555 substitute_clauses (solver, repr);
556 remove_representative_equivalences (solver, repr, eliminate);
557 kissat_dealloc (solver, repr, LITS, sizeof *repr);
558 unsigned removed = active - solver->active;
559 kissat_phase (solver, "substitute", GET (substitutions),
560 "round %u removed %u variables %.0f%%", round, removed,
561 kissat_percent (removed, active));
563 REPORT (!removed, 'd');
564#ifdef KISSAT_QUIET
565 (void) round;
566#endif
567 return !solver->inconsistent && removed;
568}
569
570static void substitute_rounds (kissat *solver, bool complete) {
571 START (substitute);
572 INC (substitutions);
573 const unsigned maxrounds = GET_OPTION (substituterounds);
574 for (unsigned round = 1; round <= maxrounds; round++) {
575 const uint64_t before = solver->statistics_.substitute_ticks;
576 if (!substitute_round (solver, round))
577 break;
578 const uint64_t after = solver->statistics_.substitute_ticks;
579 const uint64_t ticks = after - before;
580 if (!complete) {
581 const uint64_t reference =
582 solver->statistics_.search_ticks - solver->last.ticks.probe;
583 const double fraction = GET_OPTION (substituteeffort) * 1e-3;
584 const uint64_t limit = fraction * reference;
585 if (ticks > limit) {
587 solver,
588 "last substitute round took %" PRIu64 " 'substitute_ticks' "
589 "> limit %" PRIu64 " = %g * %" PRIu64 " 'search_ticks'",
590 ticks, limit, fraction, reference);
591 break;
592 }
593 }
594 }
595 if (!solver->inconsistent) {
597 LOG ("now all large clauses are watched after binary clauses");
598 solver->large_clauses_watched_after_binary_clauses = true;
599 kissat_reset_propagate (solver);
600 KISSAT_assert (!solver->level);
601 (void) kissat_probing_propagate (solver, 0, true);
602 }
603 STOP (substitute);
604}
605
606void kissat_substitute (kissat *solver, bool complete) {
607 if (solver->inconsistent)
608 return;
609 KISSAT_assert (solver->probing);
610 KISSAT_assert (solver->watching);
611 KISSAT_assert (!solver->level);
612 LOG ("assuming not all large clauses watched after binary clauses");
613 solver->large_clauses_watched_after_binary_clauses = false;
614 if (!GET_OPTION (substitute))
615 return;
617 return;
618 substitute_rounds (solver, complete);
619}
620
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void * kissat_malloc(kissat *solver, size_t bytes)
Definition allocate.c:49
void * kissat_calloc(kissat *solver, size_t n, size_t size)
Definition allocate.c:97
void kissat_free(kissat *solver, void *ptr, size_t bytes)
Definition allocate.c:61
void kissat_dealloc(kissat *solver, void *ptr, size_t n, size_t size)
Definition allocate.c:114
void kissat_learned_unit(kissat *solver, unsigned lit)
Definition assign.c:18
#define BEGIN_STACK(S)
Definition stack.h:46
#define POP_STACK(S)
Definition stack.h:37
#define all_stack(T, E, S)
Definition stack.h:94
#define SIZE_STACK(S)
Definition stack.h:19
#define EMPTY_STACK(S)
Definition stack.h:18
#define SET_END_OF_STACK(S, P)
Definition stack.h:62
#define RELEASE_STACK(S)
Definition stack.h:71
#define CLEAR_STACK(S)
Definition stack.h:50
#define PUSH_STACK(S, E)
Definition stack.h:39
#define PEEK_STACK(S, N)
Definition stack.h:29
#define TOP_STACK(S)
Definition stack.h:27
#define INIT_STACK(S)
Definition stack.h:22
#define END_STACK(S)
Definition stack.h:48
#define INVALID_LIT
#define ADD(NAME, DELTA)
#define INC(NAME)
#define LOG(...)
ABC_NAMESPACE_IMPL_START typedef signed char value
#define REMOVE_CHECKER_CLAUSE(...)
Definition check.h:167
#define CHECK_AND_ADD_LITS(...)
Definition check.h:149
#define CHECK_AND_ADD_EMPTY(...)
Definition check.h:146
#define CHECK_AND_ADD_BINARY(...)
Definition check.h:137
#define REMOVE_CHECKER_BINARY(...)
Definition check.h:161
void kissat_mark_clause_as_garbage(kissat *solver, clause *c)
Definition clause.c:164
void kissat_new_binary_clause(kissat *solver, unsigned first, unsigned second)
Definition clause.c:122
void kissat_delete_binary(kissat *solver, unsigned a, unsigned b)
Definition clause.c:181
#define ACTIVE
Definition espresso.h:129
Cube * p
Definition exorList.c:222
void kissat_mark_eliminated_variable(kissat *solver, unsigned idx)
Definition flags.c:79
#define VARS
Definition internal.h:250
#define all_variables(IDX)
Definition internal.h:269
#define all_literals(LIT)
Definition internal.h:274
#define all_clauses(C)
Definition internal.h:279
#define LITS
Definition internal.h:251
#define all_literals_in_clause(LIT, C)
Definition clause.h:47
#define KISSAT_assert(ignore)
Definition global.h:13
#define solver
Definition kitten.c:211
#define LOGBINARY(...)
Definition logging.h:442
#define LOGCLS(...)
Definition logging.h:415
#define LOGLIT(...)
Definition logging.hpp:99
unsigned long long size
Definition giaNewBdd.h:39
unsigned short ref
Definition giaNewBdd.h:38
#define GET_OPTION(N)
Definition options.h:295
#define kissat_extremely_verbose(...)
Definition print.h:53
#define kissat_phase(...)
Definition print.h:48
#define STOP(P)
Definition profile.hpp:158
#define START(P)
Definition profile.hpp:150
#define ADD_EMPTY_TO_PROOF(...)
Definition proof.h:135
#define ADD_BINARY_TO_PROOF(...)
Definition proof.h:123
#define DELETE_CLAUSE_FROM_PROOF(...)
Definition proof.h:155
#define ADD_LITS_TO_PROOF(...)
Definition proof.h:132
#define DELETE_BINARY_FROM_PROOF(...)
Definition proof.h:149
clause * kissat_probing_propagate(kissat *solver, clause *ignore, bool flush)
Definition proprobe.c:37
ABC_NAMESPACE_HEADER_START typedef unsigned reference
Definition reference.h:9
#define REPORT(...)
Definition report.h:10
int lit
Definition satVec.h:130
#define LIT(IDX)
Definition literal.h:31
#define IDX(LIT)
Definition literal.h:28
#define NOT(LIT)
Definition literal.h:33
#define kissat_check_statistics(...)
Definition statistics.h:464
#define GET(NAME)
Definition statistics.h:416
Definition flags.h:11
unsigned lits[2]
Definition watch.h:65
unsigned lit
Definition watch.h:60
watch watch
Definition watch.h:61
void kissat_substitute(kissat *solver, bool complete)
Definition substitute.c:606
#define substitute_terminated_1
Definition terminate.h:69
#define TERMINATED(BIT)
Definition terminate.h:42
Definition watch.h:41
watch_type type
Definition watch.h:42
binary_watch binary
Definition watch.h:43
char * memcpy()
char * memset()
signed char mark
Definition value.h:8
#define VALUE(LIT)
Definition value.h:10
void kissat_watch_large_clauses(kissat *solver)
Definition watch.c:145
#define SIZE_WATCHES(W)
Definition watch.h:104
#define BEGIN_WATCHES(WS)
Definition watch.h:115
#define PUSH_WATCHES(W, E)
Definition watch.h:106
#define END_WATCHES(WS)
Definition watch.h:118
#define all_binary_blocking_watches(WATCH, WATCHES)
Definition watch.h:151
#define SET_END_OF_WATCHES(WS, P)
Definition watch.h:128
vector watches
Definition watch.h:49
void kissat_weaken_binary(kissat *solver, unsigned lit, unsigned other)
Definition weaken.c:48
void kissat_weaken_unit(kissat *solver, unsigned lit)
Definition weaken.c:56