22 #ifndef Minisat_SolverTypes_h
23 #define Minisat_SolverTypes_h
44 #if defined(MINISAT_CONSTANTS_AS_MACROS)
45 #define var_Undef (-1)
67 inline int var (
Lit p) {
return p.
x >> 1; }
83 template<
class T>
class LMap :
public IntMap<Lit, T, MkIndexLit>{};
108 uint8_t sel = (this->
value << 1) | (b.
value << 3);
109 uint8_t v = (0xF7F755F4 >> sel) & 3;
113 uint8_t sel = (this->
value << 1) | (b.
value << 3);
114 uint8_t v = (0xFCFCF400 >> sel) & 3;
123 #if defined(MINISAT_CONSTANTS_AS_MACROS)
124 #define l_True (lbool((uint8_t)0)) // gcc does not do constant propagation if these are real constants.
125 #define l_False (lbool((uint8_t)1))
126 #define l_Undef (lbool((uint8_t)2))
128 const lbool
l_True ((uint8_t)0);
129 const lbool
l_False((uint8_t)1);
130 const lbool
l_Undef((uint8_t)2);
155 header.has_extra = use_extra;
159 for (
int i = 0; i < ps.
size(); i++)
173 header.has_extra = use_extra;
175 for (
int i = 0; i < from.
size(); i++)
190 for (
int i = 0; i <
size(); i++)
231 return (
sizeof(
Clause) + (
sizeof(
Lit) * (size + (
int)has_extra))) /
sizeof(uint32_t); }
247 assert(
sizeof(
Lit) ==
sizeof(uint32_t));
248 assert(
sizeof(
float) ==
sizeof(uint32_t));
251 new (
lea(cid))
Clause(ps, use_extra, learnt);
324 template<
class K,
class Vec,
class Deleted,
class MkIndex = MkIndexDefault<K> >
333 OccLists(
const Deleted& d, MkIndex _index = MkIndex()) :
345 if (
dirty[idx] == 0){
359 template<
class K,
class Vec,
class Deleted,
class MkIndex>
362 for (
int i = 0; i < dirties.size(); i++)
364 if (dirty[dirties[i]])
370 template<
class K,
class Vec,
class Deleted,
class MkIndex>
375 for (i = j = 0; i < vec.size(); i++)
376 if (!deleted(vec[i]))
448 const Lit* c = (
const Lit*)(*
this);
449 const Lit* d = (
const Lit*)other;
451 for (
unsigned i = 0; i <
header.size; i++) {
453 for (
unsigned j = 0; j < other.
header.
size; j++)
456 else if (ret ==
lit_Undef && c[i] == ~d[j]){
bool operator==(const ClauseIterator &ci) const
RegionAllocator< uint32_t >::Ref CRef
void insert(CRef cr, const T &t)
void insert(const K &k, const D &d)
const vec< Pair > & bucket(int i) const
Clause(const Clause &from, bool use_extra)
static uint32_t clauseWord32Size(int size, bool has_extra)
const lbool l_False((uint8_t) 1)
bool operator!=(const TrailIterator &ti) const
void smudge(const K &idx)
lbool operator||(lbool b) const
IntMap< K, Vec, MkIndex > occs
Lit mkLit(Var var, bool sign=false)
bool operator==(Lit p) const
void clear(bool dispose=false)
static std::string idx(std::string str)
const Clause & operator[](CRef r) const
Map< CRef, T, CRefHash > HashTable
Vec & lookup(const K &idx)
IntMap< K, char, MkIndex > dirty
const lbool l_Undef((uint8_t) 2)
friend Lit mkLit(Var var, bool sign)
void reserve(K key, V pad)
Clause & operator[](CRef r)
friend lbool toLbool(int v)
uint32_t abstraction() const
Lit operator^(Lit p, bool b)
bool peek(const K &k, D &d) const
CRef alloc(const Clause &from)
bool operator==(lbool b) const
struct Minisat::Clause::@5 header
void moveTo(RegionAllocator &to)
ClauseIterator(const ClauseAllocator &_ca, const CRef *_crefs)
const vec< typename HashTable::Pair > & bucket(int i) const
bool operator!=(const ClauseIterator &ci) const
const Clause * lea(CRef r) const
Vec & operator[](const K &idx)
CRef ael(const Clause *t)
union Minisat::Clause::@6 data[0]
void reloc(CRef &cr, ClauseAllocator &to)
uint32_t operator()(CRef cr) const
lbool operator^(bool b) const
Clause(const vec< Lit > &ps, bool use_extra, bool learnt)
bool operator!=(Lit p) const
const lbool l_True((uint8_t) 0)
bool operator<(Lit p) const
friend int toInt(lbool l)
void clear(bool dealloc=false)
CRef alloc(const vec< Lit > &ps, bool learnt=false)
const Clause & operator*() const
void moveTo(ClauseAllocator &to)
bool operator!=(lbool b) const
Lit subsumes(const Clause &other) const
void growTo(CRef cr, const T &t)
ClauseAllocator(uint32_t start_cap)
void clear(bool free=true)
bool operator==(const TrailIterator &ti) const
const T & operator[](CRef cr) const
lbool operator&&(lbool b) const
const ClauseAllocator & ca
vec< Lit >::Size operator()(Lit l) const
TrailIterator(const Lit *_lits)
RegionAllocator< uint32_t > ra
OccLists(const Deleted &d, MkIndex _index=MkIndex())