SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
SolverTypes.h
Go to the documentation of this file.
1 /***********************************************************************************[SolverTypes.h]
2 Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
3 Copyright (c) 2007-2010, Niklas Sorensson
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6 associated documentation files (the "Software"), to deal in the Software without restriction,
7 including without limitation the rights to use, copy, modify, merge, publish, distribute,
8 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 
11 The above copyright notice and this permission notice shall be included in all copies or
12 substantial portions of the Software.
13 
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
15 NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
18 OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 **************************************************************************************************/
20 
21 
22 #ifndef Minisat_SolverTypes_h
23 #define Minisat_SolverTypes_h
24 
25 #include <assert.h>
26 
27 #include "IntTypes.h"
28 #include "Alg.h"
29 #include "Vec.h"
30 #include "Map.h"
31 #include "Alloc.h"
32 
33 namespace Minisat {
34 
35 //=================================================================================================
36 // Variables, literals, lifted booleans, clauses:
37 
38 
39 // NOTE! Variables are just integers. No abstraction here. They should be chosen from 0..N,
40 // so that they can be used as array indices.
41 
42 typedef int Var;
43 #define var_Undef (-1)
44 
45 
46 struct Lit {
47  int x;
48 
49  // Use this as a constructor:
50  friend Lit mkLit(Var var, bool sign);
51 
52  bool operator == (Lit p) const { return x == p.x; }
53  bool operator != (Lit p) const { return x != p.x; }
54  bool operator < (Lit p) const { return x < p.x; } // '<' makes p, ~p adjacent in the ordering.
55 };
56 
57 Lit mkLit(Var var, bool sign = false);
58 
59 
60 inline Lit mkLit (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
61 inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; }
62 inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (int)(unsigned int)b; return q; }
63 inline bool sign (Lit p) { return p.x & 1; }
64 inline int var (Lit p) { return p.x >> 1; }
65 inline Lit neg (Lit p) { return mkLit( var(p), !sign(p) ); }
66 
67 // Mapping Literals to and from compact integers suitable for array indexing:
68 inline int toInt (Var v) { return v; }
69 inline int toInt (Lit p) { return p.x; }
70 inline Lit toLit (int i) { Lit p; p.x = i; return p; }
71 
72 const Lit lit_Undef = { -2 }; // }- Useful special constants.
73 const Lit lit_Error = { -1 }; // }
74 
75 inline std::ostream& operator<<(std::ostream& os, const Lit& l) {
76  if (l == lit_Undef) os << "lit_Undef";
77  else if (l == lit_Error) os << "lit_Error";
78  else {
79  if (Minisat::sign(l)) os << "-";
80  os << Minisat::var(l);
81  }
82  return os;
83 };
84 
85 //const Lit lit_Undef = mkLit(var_Undef, false); // }- Useful special constants.
86 //const Lit lit_Error = mkLit(var_Undef, true ); // }
87 
88 
89 //=================================================================================================
90 // Lifted booleans:
91 //
92 // NOTE: this implementation is optimized for the case when comparisons between values are mostly
93 // between one variable and one constant. Some care had to be taken to make sure that gcc
94 // does enough constant propagation to produce sensible code, and this appears to be somewhat
95 // fragile unfortunately.
96 
97 #define l_True (Minisat::lbool((uint8_t)0)) // gcc does not do constant propagation if these are real constants.
98 #define l_False (Minisat::lbool((uint8_t)1))
99 #define l_Undef (Minisat::lbool((uint8_t)2))
100 
101 class lbool {
102  uint8_t value;
103 
104 public:
105  explicit lbool(uint8_t v) : value(v) { }
106 
107  lbool() : value(0) { }
108  explicit lbool(bool x) : value(!x) { }
109 
110  bool operator == (lbool b) const { return ((b.value&2) & (value&2)) | (!(b.value&2)&(value == b.value)); }
111  bool operator != (lbool b) const { return !(*this == b); }
112  lbool operator ^ (bool b) const { return lbool((uint8_t)(value^(uint8_t)b)); }
113 
115  uint8_t sel = ((uint8_t) (this->value << 1)) | ((uint8_t) (b.value << 3));
116  uint8_t v = (0xF7F755F4 >> sel) & 3;
117  return lbool(v); }
118 
120  uint8_t sel = ((uint8_t) (this->value << 1)) | ((uint8_t) (b.value << 3));
121  uint8_t v = (0xFCFCF400 >> sel) & 3;
122  return lbool(v); }
123 
124  friend int toInt (lbool l);
125  friend lbool toLbool(int v);
126 };
127 inline int toInt (lbool l) { return l.value; }
128 inline lbool toLbool(int v) { return lbool((uint8_t)v); }
129 
130 inline std::ostream& operator<<(std::ostream& os, Minisat::lbool b) {
131  switch (toInt(b)) {
132  case 0: return os << "true";
133  case 1: return os << "false";
134  case 2: return os << "unknown";
135  default: return os << "??? (" << toInt(b) << ")";
136  }
137 }
138 
139 //=================================================================================================
140 // Clause -- a simple class for representing a clause:
141 
142 class Clause;
144 
145 static const unsigned NORMAL_CLAUSE = 0;
146 static const unsigned LEMMA_CLAUSE = 1;
147 static const unsigned CONFLICT_CLAUSE = 2;
148 static const unsigned PERMANENT_CLAUSE = 3;
149 
150 #define BITMASK_MARK 0x03
151 #define BITMASK_TYPE 0x03
152 #define BITMASK_HASEXTRA 0x01
153 #define BITMASK_RELOCED 0x01
154 #define BITMASK_SIZE 0x3fff
155 class Clause {
156  struct {
157  unsigned mark : 2;
158  unsigned type : 2;
159  unsigned has_extra : 1;
160  unsigned reloced : 1;
161  unsigned size : 26; } header;
162  union { Lit lit; float act; uint32_t abs; CRef rel; } data[0];
163 
164  friend class ClauseAllocator;
165 
166  // NOTE: This constructor cannot be used directly (doesn't allocate enough memory).
167  template<class V>
168  Clause(const V& ps, bool use_extra, unsigned _type ) {
169  header.mark = 0;
170  header.type = _type & BITMASK_TYPE;
171  header.has_extra = use_extra;
172  header.reloced = 0;
173  header.size = (unsigned)ps.size() & BITMASK_SIZE;
174 
175  for (int i = 0; i < ps.size(); i++)
176  data[i].lit = ps[i];
177 
178  if (header.has_extra){
179  if (header.type == 1)
180  data[header.size].act = 0;
181  else
182  calcAbstraction(); }
183  }
184 
185  // -- use this function instead:
186  template<class V>
187  friend Clause* Clause_new( const V& ps, bool learnt = false )
188  {
189  assert( sizeof(Lit) == sizeof(uint32_t) );
190  assert( sizeof(float) == sizeof(uint32_t) );
191  void* mem = malloc( sizeof(Clause) + sizeof(uint32_t) * (ps.size()));
192  return new(mem)Clause( ps, true, learnt );
193  }
194 
195 public:
197  assert(header.has_extra);
198  uint32_t abstraction = 0;
199  for (int i = 0; i < size(); i++)
200  abstraction |= 1 << (var(data[i].lit) & 31);
201  data[header.size].abs = abstraction; }
202 
203 
204  int size () const { return header.size; }
205  void shrink (int i) { assert(i <= size()); if (header.has_extra) data[header.size-i] = data[header.size]; header.size = (header.size - i) & BITMASK_SIZE; }
206  void pop () { shrink(1); }
207  unsigned type () const { return header.type; }
208  bool learnt () const { return header.type > NORMAL_CLAUSE; }
209  bool has_extra () const { return header.has_extra; }
210  uint32_t mark () const { return header.mark; }
211  void mark (uint32_t m) { header.mark = m & BITMASK_MARK; }
212  const Lit& last () const { return data[header.size-1].lit; }
213 
214  bool reloced () const { return header.reloced; }
215  CRef relocation () const { return data[0].rel; }
216  void relocate (CRef c) { header.reloced = 1; data[0].rel = c; }
217 
218  // NOTE: somewhat unsafe to change the clause in-place! Must manually call 'calcAbstraction' afterwards for
219  // subsumption operations to behave correctly.
220  Lit& operator [] (int i) { return data[i].lit; }
221  Lit operator [] (int i) const { return data[i].lit; }
222  operator const Lit* (void) const { return (Lit*)data; }
223 
224  float& activity () { assert(header.has_extra); return data[header.size].act; }
225  float activity () const { assert(header.has_extra); return data[header.size].act; }
226  uint32_t abstraction () const { assert(header.has_extra); return data[header.size].abs; }
227 
228  Lit subsumes (const Clause& other) const;
229  void strengthen (Lit p);
230 };
231 
232 inline std::ostream& operator<<(std::ostream& os, const Minisat::Clause& c) {
233  os << "[";
234  for (int i = 0; i < c.size(); i++) {
235  if (i != 0) os << ", ";
236  os << c[i];
237  }
238  return os << "]";
239 }
240 
241 
242 //=================================================================================================
243 // ClauseAllocator -- a simple class for allocating memory for clauses:
244 
245 
249 class ClauseAllocator : public RegionAllocator<uint32_t>
250 {
251  static int clauseWord32Size(int size, bool has_extra){
252  return ((int)sizeof(Clause) + ((int)sizeof(Lit) * (size + (int)has_extra))) / (int)sizeof(uint32_t); }
253  public:
255 
256  ClauseAllocator(uint32_t start_cap) : RegionAllocator<uint32_t>(start_cap), extra_clause_field(false){}
258 
262 
263  template<class Lits>
264  CRef alloc(const Lits& ps, unsigned _type )
265  {
266  assert(sizeof(Lit) == sizeof(uint32_t));
267  assert(sizeof(float) == sizeof(uint32_t));
268  bool use_extra = (_type > NORMAL_CLAUSE) | extra_clause_field;
269 
270  CRef cid = RegionAllocator<uint32_t>::alloc(clauseWord32Size(ps.size(), use_extra));
271  new (lea(cid)) Clause(ps, use_extra, _type);
272 
273  return cid;
274  }
275 
276  // Deref, Load Effective Address (LEA), Inverse of LEA (AEL):
280  const Clause* lea (Ref r) const { return (Clause*)RegionAllocator<uint32_t>::lea(r); }
281  Ref ael (const Clause* t){ return RegionAllocator<uint32_t>::ael((uint32_t*)t); }
282 
283  void free(CRef cid)
284  {
285  Clause& c = operator[](cid);
287  }
288 
289  void reloc(CRef& cr, ClauseAllocator& to)
290  {
291  Clause& c = operator[](cr);
292 
293  if (c.reloced()) { cr = c.relocation(); return; }
294 
295  cr = to.alloc(c, c.learnt());
296  c.relocate(cr);
297 
298  // Copy extra data-fields:
299  // (This could be cleaned-up. Generalize Clause-constructor to be applicable here instead?)
300  to[cr].mark(c.mark());
301  if (to[cr].learnt()) to[cr].activity() = c.activity();
302  else if (to[cr].has_extra()) to[cr].calcAbstraction();
303  }
304 };
305 
306 
307 //=================================================================================================
308 // OccLists -- a class for maintaining occurence lists with lazy deletion:
309 
310 template<class Idx, class Vec, class Deleted>
311 class OccLists
312 {
316  Deleted deleted;
317 
318  public:
319  OccLists(const Deleted& d) : deleted(d) {}
320 
321  void init (const Idx& idx){ occs.growTo(toInt(idx)+1); dirty.growTo(toInt(idx)+1, 0); }
322  const Vec& operator[](const Idx& idx) const { return occs[toInt(idx)]; }
323  Vec& operator[](const Idx& idx){ return occs[toInt(idx)]; }
324  Vec& lookup (const Idx& idx){ if (dirty[toInt(idx)]) clean(idx); return occs[toInt(idx)]; }
325 
326  void cleanAll ();
327  void clean (const Idx& idx);
328  void smudge (const Idx& idx){
329  if (dirty[toInt(idx)] == 0){
330  dirty[toInt(idx)] = 1;
331  dirties.push(idx);
332  }
333  }
334 
335  void clear(bool free = true){
336  occs .clear(free);
337  dirty .clear(free);
338  dirties.clear(free);
339  }
340 };
341 
342 
343 template<class Idx, class Vec, class Deleted>
345 {
346  for (int i = 0; i < dirties.size(); i++)
347  // Dirties may contain duplicates so check here if a variable is already cleaned:
348  if (dirty[toInt(dirties[i])])
349  clean(dirties[i]);
350  dirties.clear();
351 }
352 
353 
354 template<class Idx, class Vec, class Deleted>
356 {
357  Vec& vec = occs[toInt(idx)];
358  int i, j;
359  for (i = j = 0; i < vec.size(); i++)
360  if (!deleted(vec[i]))
361  vec[j++] = vec[i];
362  vec.shrink(i - j);
363  dirty[toInt(idx)] = 0;
364 }
365 
366 
367 //=================================================================================================
368 // CMap -- a class for mapping clauses to values:
369 
370 
371 template<class T>
372 class CMap
373 {
374  struct CRefHash {
375  uint32_t operator()(CRef cr) const { return (uint32_t)cr; } };
376 
379 
380  public:
381  // Size-operations:
382  void clear () { map.clear(); }
383  int size () const { return map.elems(); }
384 
385 
386  // Insert/Remove/Test mapping:
387  void insert (CRef cr, const T& t){ map.insert(cr, t); }
388  void growTo (CRef cr, const T& t){ map.insert(cr, t); } // NOTE: for compatibility
389  void remove (CRef cr) { map.remove(cr); }
390  bool has (CRef cr, T& t) { return map.peek(cr, t); }
391 
392  // Vector interface (the clause 'c' must already exist):
393  const T& operator [] (CRef cr) const { return map[cr]; }
394  T& operator [] (CRef cr) { return map[cr]; }
395 
396  // Iteration (not transparent at all at the moment):
397  int bucket_count() const { return map.bucket_count(); }
398  const vec<typename HashTable::Pair>& bucket(int i) const { return map.bucket(i); }
399 
400  // Move contents to other map:
401  void moveTo(CMap& other){ map.moveTo(other.map); }
402 
403  // TMP debug:
404  void debug(){
405  printf(" --- size = %d, bucket_count = %d\n", size(), map.bucket_count()); }
406 };
407 
408 
409 /*_________________________________________________________________________________________________
410 |
411 | subsumes : (other : const Clause&) -> Lit
412 |
413 | Description:
414 | Checks if clause subsumes 'other', and at the same time, if it can be used to simplify 'other'
415 | by subsumption resolution.
416 |
417 | Result:
418 | lit_Error - No subsumption or simplification
419 | lit_Undef - Clause subsumes 'other'
420 | p - The literal p can be deleted from 'other'
421 |________________________________________________________________________________________________@*/
422 inline Lit Clause::subsumes(const Clause& other) const
423 {
424  //if (other.size() < size() || (extra.abst & ~other.extra.abst) != 0)
425  //if (other.size() < size() || (!learnt() && !other.learnt() && (extra.abst & ~other.extra.abst) != 0))
426  assert(header.type <= NORMAL_CLAUSE); assert(other.header.type <= NORMAL_CLAUSE);
427  assert(header.has_extra); assert(other.header.has_extra);
428  if (other.header.size < header.size || (data[header.size].abs & ~other.data[other.header.size].abs) != 0)
429  return lit_Error;
430 
431  Lit ret = lit_Undef;
432  const Lit* c = (const Lit*)(*this);
433  const Lit* d = (const Lit*)other;
434 
435  for (unsigned i = 0; i < header.size; i++) {
436  // search for c[i] or ~c[i]
437  for (unsigned j = 0; j < other.header.size; j++)
438  if (c[i] == d[j])
439  goto ok;
440  else if (ret == lit_Undef && c[i] == ~d[j]){
441  ret = c[i];
442  goto ok;
443  }
444 
445  // did not find it
446  return lit_Error;
447  ok:;
448  }
449 
450  return ret;
451 }
452 
453 inline void Clause::strengthen(Lit p)
454 {
455  remove(*this, p);
456  calcAbstraction();
457 }
458 
459 
460 
461 /// [Minisat related code]
462 struct Watcher
463 {
464  /// [Minisat related code]
466 
467  /// [Minisat related code]
469 
470  /// [Minisat related code]
472  cref( cr ),
473  blocker( p )
474  {}
475 
476  /// [Minisat related code]
477  bool operator ==( const Watcher& w ) const
478  {
479  return cref == w.cref;
480  }
481 
482  /// [Minisat related code]
483  bool operator !=( const Watcher& w ) const
484  {
485  return cref != w.cref;
486  }
487  friend std::ostream& operator<<(std::ostream& os, const Watcher& w) {
488  return os << "watch(" << w.cref << ", " << w.blocker << ")";
489  };
490 };
491 
492 //=================================================================================================
493 }
494 
495 #endif
#define BITMASK_SIZE
Definition: SolverTypes.h:154
#define BITMASK_TYPE
Definition: SolverTypes.h:151
#define BITMASK_MARK
Definition: SolverTypes.h:150
const vec< typename HashTable::Pair > & bucket(int i) const
Definition: SolverTypes.h:398
int size() const
Definition: SolverTypes.h:383
int bucket_count() const
Definition: SolverTypes.h:397
void growTo(CRef cr, const T &t)
Definition: SolverTypes.h:388
void insert(CRef cr, const T &t)
Definition: SolverTypes.h:387
const T & operator[](CRef cr) const
Definition: SolverTypes.h:393
void moveTo(CMap &other)
Definition: SolverTypes.h:401
Map< CRef, T, CRefHash > HashTable
Definition: SolverTypes.h:377
void remove(CRef cr)
Definition: SolverTypes.h:389
HashTable map
Definition: SolverTypes.h:378
bool has(CRef cr, T &t)
Definition: SolverTypes.h:390
Ref ael(const Clause *t)
Definition: SolverTypes.h:281
void moveTo(ClauseAllocator &to)
Definition: SolverTypes.h:259
void reloc(CRef &cr, ClauseAllocator &to)
Definition: SolverTypes.h:289
static int clauseWord32Size(int size, bool has_extra)
Definition: SolverTypes.h:251
const Clause & operator[](Ref r) const
Definition: SolverTypes.h:278
ClauseAllocator(uint32_t start_cap)
Definition: SolverTypes.h:256
CRef alloc(const Lits &ps, unsigned _type)
Definition: SolverTypes.h:264
const Clause * lea(Ref r) const
Definition: SolverTypes.h:280
Clause & operator[](Ref r)
Definition: SolverTypes.h:277
Clause * lea(Ref r)
Definition: SolverTypes.h:279
bool reloced() const
Definition: SolverTypes.h:214
bool learnt() const
Definition: SolverTypes.h:208
Lit & operator[](int i)
Definition: SolverTypes.h:220
void strengthen(Lit p)
Definition: SolverTypes.h:453
void mark(uint32_t m)
Definition: SolverTypes.h:211
void relocate(CRef c)
Definition: SolverTypes.h:216
int size() const
Definition: SolverTypes.h:204
unsigned reloced
Definition: SolverTypes.h:160
void shrink(int i)
Definition: SolverTypes.h:205
float & activity()
Definition: SolverTypes.h:224
union Minisat::Clause::@5 data[0]
Clause(const V &ps, bool use_extra, unsigned _type)
Definition: SolverTypes.h:168
unsigned has_extra
Definition: SolverTypes.h:159
struct Minisat::Clause::@4 header
uint32_t abstraction() const
Definition: SolverTypes.h:226
uint32_t mark() const
Definition: SolverTypes.h:210
const Lit & last() const
Definition: SolverTypes.h:212
unsigned type() const
Definition: SolverTypes.h:207
void calcAbstraction()
Definition: SolverTypes.h:196
float activity() const
Definition: SolverTypes.h:225
Lit subsumes(const Clause &other) const
Definition: SolverTypes.h:422
friend Clause * Clause_new(const V &ps, bool learnt=false)
Definition: SolverTypes.h:187
CRef relocation() const
Definition: SolverTypes.h:215
bool has_extra() const
Definition: SolverTypes.h:209
void insert(const K &k, const D &d)
Definition: Map.h:134
void moveTo(Map &other)
Definition: Map.h:176
int bucket_count() const
Definition: Map.h:173
const vec< Pair > & bucket(int i) const
Definition: Map.h:188
void remove(const K &k)
Definition: Map.h:155
int elems() const
Definition: Map.h:172
bool peek(const K &k, D &d) const
Definition: Map.h:135
void clear()
Definition: Map.h:166
const Vec & operator[](const Idx &idx) const
Definition: SolverTypes.h:322
void init(const Idx &idx)
Definition: SolverTypes.h:321
void clean(const Idx &idx)
Definition: SolverTypes.h:355
Vec & lookup(const Idx &idx)
Definition: SolverTypes.h:324
Vec & operator[](const Idx &idx)
Definition: SolverTypes.h:323
OccLists(const Deleted &d)
Definition: SolverTypes.h:319
vec< char > dirty
Definition: SolverTypes.h:314
void clear(bool free=true)
Definition: SolverTypes.h:335
vec< Idx > dirties
Definition: SolverTypes.h:315
void smudge(const Idx &idx)
Definition: SolverTypes.h:328
vec< Vec > occs
Definition: SolverTypes.h:313
void moveTo(RegionAllocator &to)
Definition: Alloc.h:112
T & operator[](Ref r)
Definition: Alloc.h:81
T * lea(Ref r)
Definition: Alloc.h:94
Ref ael(const T *t)
Definition: Alloc.h:106
Ref alloc(int size)
Definition: Alloc.h:153
void free(int size)
Definition: Alloc.h:75
bool operator!=(lbool b) const
Definition: SolverTypes.h:111
lbool(uint8_t v)
Definition: SolverTypes.h:105
friend int toInt(lbool l)
Definition: SolverTypes.h:127
lbool operator||(lbool b) const
Definition: SolverTypes.h:119
lbool operator&&(lbool b) const
Definition: SolverTypes.h:114
bool operator==(lbool b) const
Definition: SolverTypes.h:110
lbool operator^(bool b) const
Definition: SolverTypes.h:112
friend lbool toLbool(int v)
Definition: SolverTypes.h:128
void shrink(int nelems)
Definition: Vec.h:123
void growTo(int size)
Definition: Vec.h:262
int size(void) const
Definition: Vec.h:118
void clear(bool dealloc=false)
Definition: Vec.h:273
void push(void)
Definition: Vec.h:147
Definition: Alg.h:27
const CRef CRef_Undef
Definition: SolverTypes.h:246
static const unsigned PERMANENT_CLAUSE
Definition: SolverTypes.h:148
int Var
Definition: SolverTypes.h:42
const CRef CRef_TPropagation
Definition: SolverTypes.h:248
static const unsigned CONFLICT_CLAUSE
Definition: SolverTypes.h:147
Lit operator~(Lit p)
Definition: SolverTypes.h:61
int toInt(Var v)
Definition: SolverTypes.h:68
Lit toLit(int i)
Definition: SolverTypes.h:70
lbool toLbool(int v)
Definition: SolverTypes.h:128
const CRef CRef_Lazy
Definition: SolverTypes.h:247
int var(Lit p)
Definition: SolverTypes.h:64
RegionAllocator< uint32_t >::Ref CRef
Definition: SolverTypes.h:142
static const unsigned NORMAL_CLAUSE
Definition: SolverTypes.h:145
Lit neg(Lit p)
Definition: SolverTypes.h:65
Lit operator^(Lit p, bool b)
Definition: SolverTypes.h:62
const Lit lit_Error
Definition: SolverTypes.h:73
Lit mkLit(Var var, bool sign=false)
Definition: SolverTypes.h:60
bool sign(Lit p)
Definition: SolverTypes.h:63
const Lit lit_Undef
Definition: SolverTypes.h:72
static const unsigned LEMMA_CLAUSE
Definition: SolverTypes.h:146
static void remove(V &ts, const T &t)
Definition: Alg.h:36
std::ostream & operator<<(std::ostream &os, const Lit &l)
Definition: SolverTypes.h:75
uint32_t operator()(CRef cr) const
Definition: SolverTypes.h:375
bool operator<(Lit p) const
Definition: SolverTypes.h:54
bool operator==(Lit p) const
Definition: SolverTypes.h:52
bool operator!=(Lit p) const
Definition: SolverTypes.h:53
friend Lit mkLit(Var var, bool sign)
Definition: SolverTypes.h:60
[Minisat related code]
Definition: SolverTypes.h:463
Minisat::CRef cref
[Minisat related code]
Definition: SolverTypes.h:465
bool operator==(const Watcher &w) const
[Minisat related code]
Definition: SolverTypes.h:477
Watcher(Minisat::CRef cr, Minisat::Lit p)
[Minisat related code]
Definition: SolverTypes.h:471
bool operator!=(const Watcher &w) const
[Minisat related code]
Definition: SolverTypes.h:483
Minisat::Lit blocker
[Minisat related code]
Definition: SolverTypes.h:468
friend std::ostream & operator<<(std::ostream &os, const Watcher &w)
Definition: SolverTypes.h:487