ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
SimpSolver2.cpp
Go to the documentation of this file.
1/***********************************************************************************[SimpSolver.cc]
2Copyright (c) 2006, Niklas Een, Niklas Sorensson
3Copyright (c) 2007-2010, Niklas Sorensson
4
5Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6associated documentation files (the "Software"), to deal in the Software without restriction,
7including without limitation the rights to use, copy, modify, merge, publish, distribute,
8sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all copies or
12substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
15NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
18OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19**************************************************************************************************/
20
21#include "sat/glucose2/Sort.h"
23#include "sat/glucose2/System.h"
24
26
27using namespace Gluco2;
28
29//=================================================================================================
30// Options:
31
32
33static const char* _cat = "SIMP";
34
35static BoolOption opt_use_asymm (_cat, "asymm", "Shrink clauses by asymmetric branching.", false);
36static BoolOption opt_use_rcheck (_cat, "rcheck", "Check if a clause is already implied. (costly)", false);
37static BoolOption opt_use_elim (_cat, "elim", "Perform variable elimination.", true);
38static IntOption opt_grow (_cat, "grow", "Allow a variable elimination step to grow by a number of clauses.", 0);
39static IntOption opt_clause_lim (_cat, "cl-lim", "Variables are not eliminated if it produces a resolvent with a length above this limit. -1 means no limit", 20, IntRange(-1, INT32_MAX));
40static IntOption opt_subsumption_lim (_cat, "sub-lim", "Do not check if subsumption against a clause larger than this. -1 means no limit.", 1000, IntRange(-1, INT32_MAX));
41static DoubleOption opt_simp_garbage_frac(_cat, "simp-gc-frac", "The fraction of wasted memory allowed before a garbage collection is triggered during simplification.", 0.5, DoubleRange(0, false, HUGE_VAL, false));
42
43
44//=================================================================================================
45// Constructor/Destructor:
46
47
49 grow (opt_grow)
50 , clause_lim (opt_clause_lim)
51 , subsumption_lim (opt_subsumption_lim)
52 , simp_garbage_frac (opt_simp_garbage_frac)
53 , use_asymm (opt_use_asymm)
54 , use_rcheck (opt_use_rcheck)
55 , use_elim (opt_use_elim)
56 , merges (0)
57 , asymm_lits (0)
58 , eliminated_vars (0)
60 , elimorder (1)
64 , bwdsub_assigns (0)
65 , n_touched (0)
66{
67 vec<Lit> dummy(1,lit_Undef);
68 ca.extra_clause_field = true; // NOTE: must happen before allocating the dummy clause below.
69 bwdsub_tmpunit = ca.alloc(dummy);
70 remove_satisfied = false;
71 parsing = 0;
72}
73
74
78
79
80Var SimpSolver::newVar(bool sign, bool dvar) {
81 Var v = Solver::newVar(sign, dvar);
82
83 frozen .push((char)false);
84 eliminated.push((char)false);
85
87 n_occ .push(0);
88 n_occ .push(0);
89 occurs .init(v);
90 touched .push(0);
91 elim_heap .insert(v);
92 }
93 return v; }
94
95
96
97lbool SimpSolver::solve_(bool do_simp, bool turn_off_simp)
98{
99 vec<Var> extra_frozen;
100 lbool result = l_True;
101
102 do_simp &= use_simplification;
103
104 if (do_simp){
105 // Assumptions must be temporarily frozen to run variable elimination:
106 for (int i = 0; i < assumptions.size(); i++){
107 Var v = var(assumptions[i]);
108
109 // If an assumption has been eliminated, remember it.
110 assert(!isEliminated(v));
111
112 if (!frozen[v]){
113 // Freeze and store.
114 setFrozen(v, true);
115 extra_frozen.push(v);
116 } }
117
118 result = lbool(eliminate(turn_off_simp));
119 }
120
121 if (result == l_True)
122 result = Solver::solve_();
123 else if (verbosity >= 1)
124 printf("===============================================================================\n");
125
126 if (result == l_True)
127 extendModel();
128
129 if (do_simp)
130 // Unfreeze the assumptions that were frozen:
131 for (int i = 0; i < extra_frozen.size(); i++)
132 setFrozen(extra_frozen[i], false);
133
134 return result;
135}
136
137
138
140{
141#ifndef NDEBUG
142 for (int i = 0; i < ps.size(); i++)
143 assert(!isEliminated(var(ps[i])));
144#endif
145 int nclauses = clauses.size();
146
147 if (use_rcheck && implied(ps))
148 return true;
149
150 if (!Solver::addClause_(ps))
151 return false;
152
153 if(!parsing && certifiedUNSAT) {
154 for (int i = 0; i < ps.size(); i++)
155 fprintf(certifiedOutput, "%i " , (var(ps[i]) + 1) * (-2 * sign(ps[i]) + 1) );
156 fprintf(certifiedOutput, "0\n");
157 }
158
159 if (use_simplification && clauses.size() == nclauses + 1){
160 CRef cr = clauses.last();
161 const Clause& c = ca[cr];
162
163 // NOTE: the clause is added to the queue immediately and then
164 // again during 'gatherTouchedClauses()'. If nothing happens
165 // in between, it will only be checked once. Otherwise, it may
166 // be checked twice unnecessarily. This is an unfortunate
167 // consequence of how backward subsumption is used to mimic
168 // forward subsumption.
169 subsumption_queue.insert(cr);
170 for (int i = 0; i < c.size(); i++){
171 occurs[var(c[i])].push(cr);
172 n_occ[toInt(c[i])]++;
173 touched[var(c[i])] = 1;
174 n_touched++;
175 if (elim_heap.inHeap(var(c[i])))
176 elim_heap.increase(var(c[i]));
177 }
178 }
179
180 return true;
181}
182
183
185{
186 const Clause& c = ca[cr];
187
189 for (int i = 0; i < c.size(); i++){
190 n_occ[toInt(c[i])]--;
191 updateElimHeap(var(c[i]));
192 occurs.smudge(var(c[i]));
193 }
194
196}
197
198
200{
201 Clause& c = ca[cr];
202 assert(decisionLevel() == 0);
204
205 // FIX: this is too inefficient but would be nice to have (properly implemented)
206 // if (!find(subsumption_queue, &c))
207 subsumption_queue.insert(cr);
208
209 if (certifiedUNSAT) {
210 for (int i = 0; i < c.size(); i++)
211 if (c[i] != l) fprintf(certifiedOutput, "%i " , (var(c[i]) + 1) * (-2 * sign(c[i]) + 1) );
212 fprintf(certifiedOutput, "0\n");
213 }
214
215 if (c.size() == 2){
216 removeClause(cr);
217 c.strengthen(l);
218 }else{
219 if (certifiedUNSAT) {
220 fprintf(certifiedOutput, "d ");
221 for (int i = 0; i < c.size(); i++)
222 fprintf(certifiedOutput, "%i " , (var(c[i]) + 1) * (-2 * sign(c[i]) + 1) );
223 fprintf(certifiedOutput, "0\n");
224 }
225
226 detachClause(cr, true);
227 c.strengthen(l);
228 attachClause(cr);
229 remove(occurs[var(l)], cr);
230 n_occ[toInt(l)]--;
232 }
233
234 return c.size() == 1 ? enqueue(c[0]) && propagate() == CRef_Undef : true;
235}
236
237
238// Returns FALSE if clause is always satisfied ('out_clause' should not be used).
239bool SimpSolver::merge(const Clause& _ps, const Clause& _qs, Var v, vec<Lit>& out_clause)
240{
241 merges++;
242 out_clause.clear();
243
244 bool ps_smallest = _ps.size() < _qs.size();
245 const Clause& ps = ps_smallest ? _qs : _ps;
246 const Clause& qs = ps_smallest ? _ps : _qs;
247
248 int i, j;
249 for (i = 0; i < qs.size(); i++){
250 if (var(qs[i]) != v){
251 for (j = 0; j < ps.size(); j++)
252 if (var(ps[j]) == var(qs[i])) {
253 if (ps[j] == ~qs[i])
254 return false;
255 else
256 goto next;
257 }
258 out_clause.push(qs[i]);
259 }
260 next:;
261 }
262
263 for (i = 0; i < ps.size(); i++)
264 if (var(ps[i]) != v)
265 out_clause.push(ps[i]);
266
267 return true;
268}
269
270
271// Returns FALSE if clause is always satisfied.
272bool SimpSolver::merge(const Clause& _ps, const Clause& _qs, Var v, int& size)
273{
274 merges++;
275
276 bool ps_smallest = _ps.size() < _qs.size();
277 const Clause& ps = ps_smallest ? _qs : _ps;
278 const Clause& qs = ps_smallest ? _ps : _qs;
279 const Lit* __ps = (const Lit*)ps;
280 const Lit* __qs = (const Lit*)qs;
281
282 size = ps.size()-1;
283
284 for (int i = 0; i < qs.size(); i++){
285 if (var(__qs[i]) != v){
286 for (int j = 0; j < ps.size(); j++)
287 if (var(__ps[j]) == var(__qs[i])) {
288 if (__ps[j] == ~__qs[i])
289 return false;
290 else
291 goto next;
292 }
293 size++;
294 }
295 next:;
296 }
297
298 return true;
299}
300
301
303{
304 if (n_touched == 0) return;
305
306 int i,j;
307 for (i = j = 0; i < subsumption_queue.size(); i++)
308 if (ca[subsumption_queue[i]].mark() == 0)
309 ca[subsumption_queue[i]].mark(2);
310
311 for (i = 0; i < touched.size(); i++)
312 if (touched[i]){
313 const vec<CRef>& cs = occurs.lookup(i);
314 for (j = 0; j < cs.size(); j++)
315 if (ca[cs[j]].mark() == 0){
316 subsumption_queue.insert(cs[j]);
317 ca[cs[j]].mark(2);
318 }
319 touched[i] = 0;
320 }
321
322 for (i = 0; i < subsumption_queue.size(); i++)
323 if (ca[subsumption_queue[i]].mark() == 2)
324 ca[subsumption_queue[i]].mark(0);
325
326 n_touched = 0;
327}
328
329
331{
332 assert(decisionLevel() == 0);
333
334 trail_lim.push(trail.size());
335 for (int i = 0; i < c.size(); i++)
336 if (value(c[i]) == l_True){
337 cancelUntil(0);
338 return false;
339 }else if (value(c[i]) != l_False){
340 assert(value(c[i]) == l_Undef);
341 uncheckedEnqueue(~c[i]);
342 }
343
344 bool result = propagate() != CRef_Undef;
345 cancelUntil(0);
346 return result;
347}
348
349
350// Backward subsumption + backward subsumption resolution
352{
353 int cnt = 0;
354 int subsumed = 0;
355 int deleted_literals = 0;
356 assert(decisionLevel() == 0);
357
358 while (subsumption_queue.size() > 0 || bwdsub_assigns < trail.size()){
359
360 // Empty subsumption queue and return immediately on user-interrupt:
361 if (asynch_interrupt){
362 subsumption_queue.clear();
363 bwdsub_assigns = trail.size();
364 break; }
365
366 // Check top-level assignments by creating a dummy clause and placing it in the queue:
367 if (subsumption_queue.size() == 0 && bwdsub_assigns < trail.size()){
368 Lit l = trail[bwdsub_assigns++];
369 ca[bwdsub_tmpunit][0] = l;
370 ca[bwdsub_tmpunit].calcAbstraction();
372
373 CRef cr = subsumption_queue.peek(); subsumption_queue.pop();
374 Clause& c = ca[cr];
375
376 if (c.mark()) continue;
377
378 if (verbose && verbosity >= 2 && cnt++ % 1000 == 0)
379 printf("subsumption left: %10d (%10d subsumed, %10d deleted literals)\r", subsumption_queue.size(), subsumed, deleted_literals);
380
381 assert(c.size() > 1 || value(c[0]) == l_True); // Unit-clauses should have been propagated before this point.
382
383 // Find best variable to scan:
384 Var best = var(c[0]);
385 for (int i = 1; i < c.size(); i++)
386 if (occurs[var(c[i])].size() < occurs[best].size())
387 best = var(c[i]);
388
389 // Search all candidates:
390 vec<CRef>& _cs = occurs.lookup(best);
391 CRef* cs = (CRef*)_cs;
392
393 for (int j = 0; j < _cs.size(); j++)
394 if (c.mark())
395 break;
396 else if (!ca[cs[j]].mark() && cs[j] != cr && (subsumption_lim == -1 || ca[cs[j]].size() < subsumption_lim)){
397 Lit l = c.subsumes(ca[cs[j]]);
398
399 if (l == lit_Undef)
400 subsumed++, removeClause(cs[j]);
401 else if (l != lit_Error){
402 deleted_literals++;
403
404 if (!strengthenClause(cs[j], ~l))
405 return false;
406
407 // Did current candidate get deleted from cs? Then check candidate at index j again:
408 if (var(l) == best)
409 j--;
410 }
411 }
412 }
413
414 return true;
415}
416
417
419{
420 Clause& c = ca[cr];
421 assert(decisionLevel() == 0);
422
423 if (c.mark() || satisfied(c)) return true;
424
425 trail_lim.push(trail.size());
426 Lit l = lit_Undef;
427 for (int i = 0; i < c.size(); i++)
428 if (var(c[i]) != v && value(c[i]) != l_False)
429 uncheckedEnqueue(~c[i]);
430 else
431 l = c[i];
432
433 if (propagate() != CRef_Undef){
434 cancelUntil(0);
435 asymm_lits++;
436 if (!strengthenClause(cr, l))
437 return false;
438 }else
439 cancelUntil(0);
440
441 return true;
442}
443
444
446{
448
449 const vec<CRef>& cls = occurs.lookup(v);
450
451 if (value(v) != l_Undef || cls.size() == 0)
452 return true;
453
454 for (int i = 0; i < cls.size(); i++)
455 if (!asymm(v, cls[i]))
456 return false;
457
459}
460
461
462static void mkElimClause(vec<uint32_t>& elimclauses, Lit x)
463{
464 elimclauses.push(toInt(x));
465 elimclauses.push(1);
466}
467
468
469static void mkElimClause(vec<uint32_t>& elimclauses, Var v, Clause& c)
470{
471 int first = elimclauses.size();
472 int v_pos = -1;
473
474 // Copy clause to elimclauses-vector. Remember position where the
475 // variable 'v' occurs:
476 for (int i = 0; i < c.size(); i++){
477 elimclauses.push(toInt(c[i]));
478 if (var(c[i]) == v)
479 v_pos = i + first;
480 }
481 assert(v_pos != -1);
482
483 // Swap the first literal with the 'v' literal, so that the literal
484 // containing 'v' will occur first in the clause:
485 uint32_t tmp = elimclauses[v_pos];
486 elimclauses[v_pos] = elimclauses[first];
487 elimclauses[first] = tmp;
488
489 // Store the length of the clause last:
490 elimclauses.push(c.size());
491}
492
493
494
496{
497 int i, j;
498 assert(!frozen[v]);
499 assert(!isEliminated(v));
500 assert(value(v) == l_Undef);
501
502 // Split the occurrences into positive and negative:
503 //
504 const vec<CRef>& cls = occurs.lookup(v);
505 vec<CRef> pos, neg;
506 for (i = 0; i < cls.size(); i++)
507 (find(ca[cls[i]], mkLit(v)) ? pos : neg).push(cls[i]);
508
509 // Check wether the increase in number of clauses stays within the allowed ('grow'). Moreover, no
510 // clause must exceed the limit on the maximal clause size (if it is set):
511 //
512 int cnt = 0;
513 int clause_size = 0;
514
515 for (i = 0; i < pos.size(); i++)
516 for (j = 0; j < neg.size(); j++)
517 if (merge(ca[pos[i]], ca[neg[j]], v, clause_size) &&
518 (++cnt > cls.size() + grow || (clause_lim != -1 && clause_size > clause_lim)))
519 return true;
520
521 // Delete and store old clauses:
522 eliminated[v] = true;
523 setDecisionVar(v, false);
525
526 if (pos.size() > neg.size()){
527 for (i = 0; i < neg.size(); i++)
528 mkElimClause(elimclauses, v, ca[neg[i]]);
529 mkElimClause(elimclauses, mkLit(v));
530 eliminated_clauses += neg.size();
531 }else{
532 for (i = 0; i < pos.size(); i++)
533 mkElimClause(elimclauses, v, ca[pos[i]]);
534 mkElimClause(elimclauses, ~mkLit(v));
535 eliminated_clauses += pos.size();
536 }
537
538
539 // Produce clauses in cross product:
540 vec<Lit>& resolvent = add_tmp;
541 for (i = 0; i < pos.size(); i++)
542 for (j = 0; j < neg.size(); j++)
543 if (merge(ca[pos[i]], ca[neg[j]], v, resolvent) && !addClause_(resolvent))
544 return false;
545
546 for (i = 0; i < cls.size(); i++)
547 removeClause(cls[i]);
548
549 // Free occurs list for this variable:
550 occurs[v].clear(true);
551
552 // Free watchers lists for this variable, if possible:
553 if (watches[ mkLit(v)].size() == 0) watches[ mkLit(v)].clear(true);
554 if (watches[~mkLit(v)].size() == 0) watches[~mkLit(v)].clear(true);
555
557}
558
559
561{
562 assert(!frozen[v]);
563 assert(!isEliminated(v));
564 assert(value(v) == l_Undef);
565
566 if (!ok) return false;
567
568 eliminated[v] = true;
569 setDecisionVar(v, false);
570 const vec<CRef>& cls = occurs.lookup(v);
571
572 vec<Lit>& subst_clause = add_tmp;
573 for (int i = 0; i < cls.size(); i++){
574 Clause& c = ca[cls[i]];
575
576 subst_clause.clear();
577 for (int j = 0; j < c.size(); j++){
578 Lit p = c[j];
579 subst_clause.push(var(p) == v ? x ^ sign(p) : p);
580 }
581
582
583 if (!addClause_(subst_clause))
584 return ok = false;
585
586 removeClause(cls[i]);
587
588 }
589
590 return true;
591}
592
593
595{
596 int i, j;
597 Lit x;
598
599 for (i = elimclauses.size()-1; i > 0; i -= j){
600 for (j = elimclauses[i--]; j > 1; j--, i--)
602 goto next;
603
604 x = toLit(elimclauses[i]);
605 model[var(x)] = lbool(!sign(x));
606 next:;
607 }
608}
609
610
611bool SimpSolver::eliminate(bool turn_off_elim)
612{
613 //abctime clk = Abc_Clock();
614 if (!simplify())
615 return false;
616 else if (!use_simplification)
617 return true;
618
619 // Main simplification loop:
620 //
621
622 int toPerform = clauses.size()<=4800000;
623
624 if(!toPerform) {
625 printf("c Too many clauses... No preprocessing\n");
626 }
627
628 while (toPerform && (n_touched > 0 || bwdsub_assigns < trail.size() || elim_heap.size() > 0)){
629
631 // printf(" ## (time = %6.2f s) BWD-SUB: queue = %d, trail = %d\n", cpuTime(), subsumption_queue.size(), trail.size() - bwdsub_assigns);
632 if ((subsumption_queue.size() > 0 || bwdsub_assigns < trail.size()) &&
634 ok = false; goto cleanup; }
635
636 // Empty elim_heap and return immediately on user-interrupt:
637 if (asynch_interrupt){
638 assert(bwdsub_assigns == trail.size());
639 assert(subsumption_queue.size() == 0);
640 assert(n_touched == 0);
641 elim_heap.clear();
642 goto cleanup; }
643
644 // printf(" ## (time = %6.2f s) ELIM: vars = %d\n", cpuTime(), elim_heap.size());
645 for (int cnt = 0; !elim_heap.empty(); cnt++){
646 Var elim = elim_heap.removeMin();
647
648 if (asynch_interrupt) break;
649
650 if (isEliminated(elim) || value(elim) != l_Undef) continue;
651
652 if (verbosity >= 2 && cnt % 100 == 0)
653 printf("elimination left: %10d\r", elim_heap.size());
654
655 if (use_asymm){
656 // Temporarily freeze variable. Otherwise, it would immediately end up on the queue again:
657 bool was_frozen = frozen[elim] != 0;
658 frozen[elim] = true;
659 if (!asymmVar(elim)){
660 ok = false; goto cleanup; }
661 frozen[elim] = was_frozen; }
662
663 // At this point, the variable may have been set by assymetric branching, so check it
664 // again. Also, don't eliminate frozen variables:
665 if (use_elim && value(elim) == l_Undef && !frozen[elim] && !eliminateVar(elim)){
666 ok = false; goto cleanup; }
667
669 }
670
671 assert(subsumption_queue.size() == 0);
672 }
673 cleanup:
674
675 // If no more simplification is needed, free all simplification-related data structures:
676 if (turn_off_elim){
677 touched .clear(true);
678 occurs .clear(true);
679 n_occ .clear(true);
680 elim_heap.clear(true);
681 subsumption_queue.clear(true);
682
683 use_simplification = false;
684 remove_satisfied = true;
685 ca.extra_clause_field = false;
686
687 // Force full cleanup (this is safe and desirable since it only happens once):
690 }else{
691 // Cheaper cleanup:
692 cleanUpClauses(); // TODO: can we make 'cleanUpClauses()' not be linear in the problem size somehow?
693 checkGarbage();
694 }
695
696 if (verbosity >= 1 && elimclauses.size() > 0)
697 printf("c | Eliminated clauses: %10.2f Mb |\n",
698 double(elimclauses.size() * sizeof(uint32_t)) / (1024*1024));
699 return ok;
700}
701
702
704{
705 occurs.cleanAll();
706 int i,j;
707 for (i = j = 0; i < clauses.size(); i++)
708 if (ca[clauses[i]].mark() == 0)
709 clauses[j++] = clauses[i];
710 clauses.shrink_(i - j);
711}
712
713
714//=================================================================================================
715// Garbage Collection methods:
716
717
719{
720 int i;
721 if (!use_simplification) return;
722
723 // All occurs lists:
724 //
725 for (i = 0; i < nVars(); i++){
726 vec<CRef>& cs = occurs[i];
727 for (int j = 0; j < cs.size(); j++)
728 ca.reloc(cs[j], to);
729 }
730
731 // Subsumption queue:
732 //
733 for (i = 0; i < subsumption_queue.size(); i++)
734 ca.reloc(subsumption_queue[i], to);
735
736 // Temporary clause:
737 //
738 ca.reloc(bwdsub_tmpunit, to);
739}
740
741
743{
744 // Initialize the next region to a size corresponding to the estimated utilization degree. This
745 // is not precise but should avoid some unnecessary reallocations for the new region:
746 ClauseAllocator to(ca.size() - ca.wasted());
747
749 to.extra_clause_field = ca.extra_clause_field; // NOTE: this is important to keep (or lose) the extra fields.
750 relocAll(to);
752 if (verbosity >= 2)
753 printf("| Garbage collection: %12d bytes => %12d bytes |\n",
755 to.moveTo(ca);
756}
757
759{
761 grow = opt_grow;
763
764 subsumption_queue.clear(false);
765 vec<Lit> dummy(1,lit_Undef);
766 ca.extra_clause_field = true; // NOTE: must happen before allocating the dummy clause below.
767 bwdsub_tmpunit = ca.alloc(dummy);
768 remove_satisfied = false;
769
770 occurs.clear(false);
771
772 touched .shrink_( touched .size() );
773 n_occ .shrink_( n_occ .size() );
774 eliminated .shrink_( eliminated .size() );
775 frozen .shrink_( frozen .size() );
776 elimclauses .shrink_( elimclauses .size() );
777
778 elim_heap .clear_(false);
779}
780
unsigned int uint32_t
Definition Fxch.h:32
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
#define l_True
Definition bmcBmcS.c:35
#define l_Undef
Definition bmcBmcS.c:34
#define l_False
Definition bmcBmcS.c:36
#define INT32_MAX
Definition pstdint.h:415
ABC_NAMESPACE_IMPL_START typedef signed char value
void moveTo(ClauseAllocator &to)
void strengthen(Lit p)
Lit subsumes(const Clause &other) const
uint32_t size() const
Definition Alloc.h:58
virtual void reset()
void updateElimHeap(Var v)
Definition SimpSolver.h:191
bool substitute(Var v, Lit x)
void removeClause(CRef cr)
Heap< ElimLt > elim_heap
Definition SimpSolver.h:153
bool implied(const vec< Lit > &c)
vec< char > touched
Definition SimpSolver.h:149
bool eliminate(bool turn_off_elim=false)
vec< char > frozen
Definition SimpSolver.h:155
bool strengthenClause(CRef cr, Lit l)
bool eliminateVar(Var v)
Var newVar(bool polarity=true, bool dvar=true)
bool asymm(Var v, CRef cr)
bool merge(const Clause &_ps, const Clause &_qs, Var v, vec< Lit > &out_clause)
bool addClause_(vec< Lit > &ps)
vec< uint32_t > elimclauses
Definition SimpSolver.h:148
virtual void garbageCollect()
Queue< CRef > subsumption_queue
Definition SimpSolver.h:154
bool backwardSubsumptionCheck(bool verbose=false)
void relocAll(ClauseAllocator &to)
OccLists< Var, vec< CRef >, ClauseDeleted > occurs
Definition SimpSolver.h:151
void setFrozen(Var v, bool b)
Definition SimpSolver.h:203
vec< char > eliminated
Definition SimpSolver.h:156
bool isEliminated(Var v) const
Definition SimpSolver.h:190
bool addClause_(vec< Lit > &ps)
Definition Glucose2.cpp:268
vec< Lit > trail
Definition Solver.h:249
bool enqueue(Lit p, CRef from=CRef_Undef)
Definition Solver.h:531
void cancelUntil(int level)
Definition Glucose2.cpp:515
OccLists< Lit, vec< Watcher >, WatcherDeleted > watches
Definition Solver.h:240
void relocAll(ClauseAllocator &to)
ClauseAllocator ca
Definition Solver.h:267
vec< Lit > add_tmp
Definition Solver.h:282
void removeClause(CRef cr)
Definition Glucose2.cpp:377
bool asynch_interrupt
Definition Solver.h:294
int nVars() const
Definition Solver.h:569
virtual void reset()
void setDecisionVar(Var v, bool b, bool use_oheap=true)
Definition Solver.h:573
void detachClause(CRef cr, bool strict=false)
Definition Glucose2.cpp:350
void rebuildOrderHeap()
vec< CRef > clauses
Definition Solver.h:243
int decisionLevel() const
Definition Solver.h:560
bool certifiedUNSAT
Definition Solver.h:195
void attachClause(CRef cr)
Definition Glucose2.cpp:333
FILE * certifiedOutput
Definition Solver.h:194
void checkGarbage()
Definition Solver.h:525
bool remove_satisfied
Definition Solver.h:259
vec< lbool > model
Definition Solver.h:158
lbool modelValue(Var x) const
Definition Solver.h:564
Var newVar(bool polarity=true, bool dvar=true)
Definition Glucose2.cpp:223
vec< int > trail_lim
Definition Solver.h:251
vec< Lit > assumptions
Definition Solver.h:256
void uncheckedEnqueue(Lit p, CRef from=CRef_Undef)
Definition Glucose2.cpp:925
lbool value(Var x) const
Definition Solver.h:562
bool satisfied(const Clause &c) const
Definition Glucose2.cpp:396
void push(void)
Definition Vec.h:77
void clear(bool dealloc=false)
Definition Vec.h:141
int size(void) const
Definition Vec.h:65
bool pos
Definition globals.c:30
Cube * p
Definition exorList.c:222
Definition Alg.h:28
Lit mkLit(Var var, bool sign=false)
Definition SolverTypes.h:69
bool sign(Lit p)
Definition SolverTypes.h:72
int var(Lit p)
Definition SolverTypes.h:73
const CRef CRef_Undef
int Var
Definition SolverTypes.h:54
const Lit lit_Undef
Definition SolverTypes.h:83
RegionAllocator< uint32_t >::Ref CRef
int toInt(Var v)
Definition SolverTypes.h:76
Lit toLit(int i)
Definition SolverTypes.h:78
const Lit lit_Error
Definition SolverTypes.h:84
#define true
Definition place_base.h:28
signed char lbool
Definition satVec.h:135
#define assert(ex)
Definition util_old.h:213
#define HUGE_VAL
Definition util_old.h:295
signed char mark
Definition value.h:8