yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Minisat Namespace Reference

Data Structures

class  RegionAllocator
 
class  Heap
 
struct  MkIndexDefault
 
class  IntMap
 
class  IntSet
 
struct  Hash
 
struct  Equal
 
struct  DeepHash
 
struct  DeepEqual
 
class  Map
 
class  Option
 
struct  IntRange
 
struct  Int64Range
 
struct  DoubleRange
 
class  DoubleOption
 
class  IntOption
 
class  Int64Option
 
class  StringOption
 
class  BoolOption
 
class  StreamBuffer
 
class  Queue
 
class  SimpSolver
 
class  Solver
 
struct  Lit
 
struct  MkIndexLit
 
class  VMap
 
class  LMap
 
class  LSet
 
class  lbool
 
class  Clause
 
class  ClauseAllocator
 
class  ClauseIterator
 
class  TrailIterator
 
class  OccLists
 
class  CMap
 
struct  LessThan_default
 
class  vec
 
class  OutOfMemoryException
 

Typedefs

typedef int Var
 
typedef RegionAllocator
< uint32_t >::Ref 
CRef
 

Functions

template<class V , class T >
static void remove (V &ts, const T &t)
 
template<class V , class T >
static bool find (V &ts, const T &t)
 
template<class T >
static void copy (const T &from, T &to)
 
template<class T >
static void copy (const vec< T > &from, vec< T > &to, bool append=false)
 
template<class T >
static void append (const vec< T > &from, vec< T > &to)
 
template<class B , class Solver >
static void readClause (B &in, Solver &S, vec< Lit > &lits)
 
template<class B , class Solver >
static void parse_DIMACS_main (B &in, Solver &S, bool strictp=false)
 
template<class Solver >
static void parse_DIMACS (gzFile input_stream, Solver &S, bool strictp=false)
 
static uint32_t hash (uint32_t x)
 
static uint32_t hash (uint64_t x)
 
static uint32_t hash (int32_t x)
 
static uint32_t hash (int64_t x)
 
void parseOptions (int &argc, char **argv, bool strict=false)
 
void printUsageAndExit (int argc, char **argv, bool verbose=false)
 
void setUsageHelp (const char *str)
 
void setHelpPrefixStr (const char *str)
 
static bool isEof (StreamBuffer &in)
 
static bool isEof (const char *in)
 
template<class B >
static void skipWhitespace (B &in)
 
template<class B >
static void skipLine (B &in)
 
template<class B >
static int parseInt (B &in)
 
template<class B >
static bool match (B &in, const char *str)
 
template<class B >
static bool eagerMatch (B &in, const char *str)
 
static double drand (double &seed)
 
static int irand (double &seed, int size)
 
template<class T >
static void randomShuffle (double &seed, vec< T > &xs)
 
template<class T >
static void randomShuffle (double &seed, vec< vec< T > > &xs)
 
Lit mkLit (Var var, bool sign=false)
 
Lit operator~ (Lit p)
 
Lit operator^ (Lit p, bool b)
 
bool sign (Lit p)
 
int var (Lit p)
 
int toInt (Var v)
 
int toInt (Lit p)
 
Lit toLit (int i)
 
int toInt (lbool l)
 
lbool toLbool (int v)
 
const lbool l_True ((uint8_t) 0)
 
const lbool l_False ((uint8_t) 1)
 
const lbool l_Undef ((uint8_t) 2)
 
template<class T , class LessThan >
void selectionSort (T *array, int size, LessThan lt)
 
template<class T >
static void selectionSort (T *array, int size)
 
template<class T , class LessThan >
void sort (T *array, int size, LessThan lt)
 
template<class T >
static void sort (T *array, int size)
 
template<class T , class LessThan >
void sort (vec< T > &v, LessThan lt)
 
template<class T >
void sort (vec< T > &v)
 
static double cpuTime (void)
 
double memUsed ()
 
double memUsedPeak (bool strictlyPeak=false)
 
void setX86FPUPrecision ()
 
void limitMemory (uint64_t max_mem_mb)
 
void limitTime (uint32_t max_cpu_time)
 
void sigTerm (void handler(int))
 
static void * xrealloc (void *ptr, size_t size)
 

Variables

static const int nprimes = 25
 
static const int primes [nprimes] = { 31, 73, 151, 313, 643, 1291, 2593, 5233, 10501, 21013, 42073, 84181, 168451, 337219, 674701, 1349473, 2699299, 5398891, 10798093, 21596719, 43193641, 86387383, 172775299, 345550609, 691101253 }
 
const Var var_Undef = -1
 
const Lit lit_Undef = { -2 }
 
const Lit lit_Error = { -1 }
 
const CRef CRef_Undef = RegionAllocator<uint32_t>::Ref_Undef
 

Typedef Documentation

typedef RegionAllocator<uint32_t>::Ref Minisat::CRef

Definition at line 137 of file SolverTypes.h.

typedef int Minisat::Var

Definition at line 43 of file SolverTypes.h.

Function Documentation

template<class T >
static void Minisat::append ( const vec< T > &  from,
vec< T > &  to 
)
inlinestatic

Definition at line 79 of file Alg.h.

79 { copy(from, to, true); }
static void copy(const vec< T > &from, vec< T > &to, bool append=false)
Definition: Alg.h:68

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
static void Minisat::copy ( const T &  from,
T &  to 
)
inlinestatic

Definition at line 61 of file Alg.h.

62 {
63  to = from;
64 }

+ Here is the caller graph for this function:

template<class T >
static void Minisat::copy ( const vec< T > &  from,
vec< T > &  to,
bool  append = false 
)
inlinestatic

Definition at line 68 of file Alg.h.

69 {
70  if (!append)
71  to.clear();
72  for (int i = 0; i < from.size(); i++){
73  to.push();
74  copy(from[i], to.last());
75  }
76 }
static void append(const vec< T > &from, vec< T > &to)
Definition: Alg.h:79
const T & last(void) const
Definition: Vec.h:84
void push(void)
Definition: Vec.h:74
Size size(void) const
Definition: Vec.h:64
void clear(bool dealloc=false)
Definition: Vec.h:125
static void copy(const vec< T > &from, vec< T > &to, bool append=false)
Definition: Alg.h:68

+ Here is the call graph for this function:

static double Minisat::cpuTime ( void  )
inlinestatic

Definition at line 65 of file System.h.

65  {
66  struct rusage ru;
67  getrusage(RUSAGE_SELF, &ru);
68  return (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec / 1000000; }

+ Here is the caller graph for this function:

static double Minisat::drand ( double &  seed)
inlinestatic

Definition at line 27 of file Rnd.h.

28 {
29  seed *= 1389796;
30  int q = (int)(seed / 2147483647);
31  seed -= (double)q * 2147483647;
32  return seed / 2147483647;
33 }

+ Here is the caller graph for this function:

template<class B >
static bool Minisat::eagerMatch ( B &  in,
const char *  str 
)
static

Definition at line 109 of file ParseUtils.h.

109  {
110  for (; *str != '\0'; ++str, ++in)
111  if (*str != *in)
112  return false;
113  return true; }

+ Here is the caller graph for this function:

template<class V , class T >
static bool Minisat::find ( V &  ts,
const T &  t 
)
inlinestatic

Definition at line 47 of file Alg.h.

48 {
49  int j = 0;
50  for (; j < (int)ts.size() && ts[j] != t; j++);
51  return j < (int)ts.size();
52 }

+ Here is the caller graph for this function:

static uint32_t Minisat::hash ( uint32_t  x)
inlinestatic

Definition at line 38 of file Map.h.

38 { return x; }

+ Here is the caller graph for this function:

static uint32_t Minisat::hash ( uint64_t  x)
inlinestatic

Definition at line 39 of file Map.h.

39 { return (uint32_t)x; }
static uint32_t Minisat::hash ( int32_t  x)
inlinestatic

Definition at line 40 of file Map.h.

40 { return (uint32_t)x; }
static uint32_t Minisat::hash ( int64_t  x)
inlinestatic

Definition at line 41 of file Map.h.

41 { return (uint32_t)x; }
static int Minisat::irand ( double &  seed,
int  size 
)
inlinestatic

Definition at line 37 of file Rnd.h.

37 { return (int)(drand(seed) * size); }
static double drand(double &seed)
Definition: Rnd.h:27

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool Minisat::isEof ( StreamBuffer &  in)
inlinestatic

Definition at line 58 of file ParseUtils.h.

58 { return *in == EOF; }

+ Here is the caller graph for this function:

static bool Minisat::isEof ( const char *  in)
inlinestatic

Definition at line 59 of file ParseUtils.h.

59 { return *in == '\0'; }
const lbool Minisat::l_False ( (uint8_t)  1)

+ Here is the caller graph for this function:

const lbool Minisat::l_True ( (uint8_t)  0)

+ Here is the caller graph for this function:

const lbool Minisat::l_Undef ( (uint8_t)  2)

+ Here is the caller graph for this function:

void Minisat::limitMemory ( uint64_t  max_mem_mb)

Definition at line 112 of file System.cc.

113 {
114 // FIXME: OpenBSD does not support RLIMIT_AS. Not sure how well RLIMIT_DATA works instead.
115 #if defined(__OpenBSD__)
116 #define RLIMIT_AS RLIMIT_DATA
117 #endif
118 
119  // Set limit on virtual memory:
120  if (max_mem_mb != 0){
121  rlim_t new_mem_lim = (rlim_t)max_mem_mb * 1024*1024;
122  rlimit rl;
123  getrlimit(RLIMIT_AS, &rl);
124  if (rl.rlim_max == RLIM_INFINITY || new_mem_lim < rl.rlim_max){
125  rl.rlim_cur = new_mem_lim;
126  if (setrlimit(RLIMIT_AS, &rl) == -1)
127  printf("WARNING! Could not set resource limit: Virtual memory.\n");
128  }
129  }
130 
131 #if defined(__OpenBSD__)
132 #undef RLIMIT_AS
133 #endif
134 }
void Minisat::limitTime ( uint32_t  max_cpu_time)

Definition at line 144 of file System.cc.

145 {
146  if (max_cpu_time != 0){
147  rlimit rl;
148  getrlimit(RLIMIT_CPU, &rl);
149  if (rl.rlim_max == RLIM_INFINITY || (rlim_t)max_cpu_time < rl.rlim_max){
150  rl.rlim_cur = max_cpu_time;
151  if (setrlimit(RLIMIT_CPU, &rl) == -1)
152  printf("WARNING! Could not set resource limit: CPU-time.\n");
153  }
154  }
155 }
template<class B >
static bool Minisat::match ( B &  in,
const char *  str 
)
static

Definition at line 96 of file ParseUtils.h.

96  {
97  int i;
98  for (i = 0; str[i] != '\0'; i++)
99  if (in[i] != str[i])
100  return false;
101 
102  in += i;
103 
104  return true;
105 }

+ Here is the caller graph for this function:

double Minisat::memUsed ( )

Definition at line 95 of file System.cc.

95 { return 0; }
double Minisat::memUsedPeak ( bool  strictlyPeak = false)

Definition at line 96 of file System.cc.

96 { return 0; }

+ Here is the caller graph for this function:

Lit Minisat::mkLit ( Var  var,
bool  sign = false 
)
inline

Definition at line 63 of file SolverTypes.h.

63 { Lit p; p.x = var + var + (int)sign; return p; }
int var(Lit p)
Definition: SolverTypes.h:67
bool sign(Lit p)
Definition: SolverTypes.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Lit Minisat::operator^ ( Lit  p,
bool  b 
)
inline

Definition at line 65 of file SolverTypes.h.

65 { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
Lit Minisat::operator~ ( Lit  p)
inline

Definition at line 64 of file SolverTypes.h.

64 { Lit q; q.x = p.x ^ 1; return q; }
template<class Solver >
static void Minisat::parse_DIMACS ( gzFile  input_stream,
Solver &  S,
bool  strictp = false 
)
static

Definition at line 80 of file Dimacs.h.

80  {
81  StreamBuffer in(input_stream);
82  parse_DIMACS_main(in, S, strictp); }
static void parse_DIMACS_main(B &in, Solver &S, bool strictp=false)
Definition: Dimacs.h:48

+ Here is the call graph for this function:

template<class B , class Solver >
static void Minisat::parse_DIMACS_main ( B &  in,
Solver &  S,
bool  strictp = false 
)
static

Definition at line 48 of file Dimacs.h.

48  {
49  vec<Lit> lits;
50  int vars = 0;
51  int clauses = 0;
52  int cnt = 0;
53  for (;;){
54  skipWhitespace(in);
55  if (*in == EOF) break;
56  else if (*in == 'p'){
57  if (eagerMatch(in, "p cnf")){
58  vars = parseInt(in);
59  clauses = parseInt(in);
60  // SATRACE'06 hack
61  // if (clauses > 4000000)
62  // S.eliminate(true);
63  }else{
64  printf("PARSE ERROR! Unexpected char: %c\n", *in), exit(3);
65  }
66  } else if (*in == 'c' || *in == 'p')
67  skipLine(in);
68  else{
69  cnt++;
70  readClause(in, S, lits);
71  S.addClause_(lits); }
72  }
73  if (strictp && cnt != clauses)
74  printf("PARSE ERROR! DIMACS header mismatch: wrong number of clauses\n");
75 }
static bool eagerMatch(B &in, const char *str)
Definition: ParseUtils.h:109
static void readClause(B &in, Solver &S, vec< Lit > &lits)
Definition: Dimacs.h:35
static int parseInt(B &in)
Definition: ParseUtils.h:80
static void skipWhitespace(B &in)
Definition: ParseUtils.h:66
static void skipLine(B &in)
Definition: ParseUtils.h:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class B >
static int Minisat::parseInt ( B &  in)
static

Definition at line 80 of file ParseUtils.h.

80  {
81  int val = 0;
82  bool neg = false;
83  skipWhitespace(in);
84  if (*in == '-') neg = true, ++in;
85  else if (*in == '+') ++in;
86  if (*in < '0' || *in > '9') fprintf(stderr, "PARSE ERROR! Unexpected char: %c\n", *in), exit(3);
87  while (*in >= '0' && *in <= '9')
88  val = val*10 + (*in - '0'),
89  ++in;
90  return neg ? -val : val; }
static void skipWhitespace(B &in)
Definition: ParseUtils.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Minisat::parseOptions ( int &  argc,
char **  argv,
bool  strict = false 
)

Definition at line 28 of file Options.cc.

29 {
30  int i, j;
31  for (i = j = 1; i < argc; i++){
32  const char* str = argv[i];
33  if (match(str, "--") && match(str, Option::getHelpPrefixString()) && match(str, "help")){
34  if (*str == '\0')
35  printUsageAndExit(argc, argv);
36  else if (match(str, "-verb"))
37  printUsageAndExit(argc, argv, true);
38  } else {
39  bool parsed_ok = false;
40 
41  for (int k = 0; !parsed_ok && k < Option::getOptionList().size(); k++){
42  parsed_ok = Option::getOptionList()[k]->parse(argv[i]);
43 
44  // fprintf(stderr, "checking %d: %s against flag <%s> (%s)\n", i, argv[i], Option::getOptionList()[k]->name, parsed_ok ? "ok" : "skip");
45  }
46 
47  if (!parsed_ok){
48  if (strict && match(argv[i], "-"))
49  fprintf(stderr, "ERROR! Unknown flag \"%s\". Use '--%shelp' for help.\n", argv[i], Option::getHelpPrefixString()), exit(1);
50  else
51  argv[j++] = argv[i];
52  }
53  }
54  }
55 
56  argc -= (i - j);
57 }
static bool match(B &in, const char *str)
Definition: ParseUtils.h:96
void printUsageAndExit(int argc, char **argv, bool verbose=false)
Definition: Options.cc:62

+ Here is the call graph for this function:

void Minisat::printUsageAndExit ( int  argc,
char **  argv,
bool  verbose = false 
)

Definition at line 62 of file Options.cc.

63 {
64  const char* usage = Option::getUsageString();
65  if (usage != NULL)
66  fprintf(stderr, usage, argv[0]);
67 
68  sort(Option::getOptionList(), Option::OptionLt());
69 
70  const char* prev_cat = NULL;
71  const char* prev_type = NULL;
72 
73  for (int i = 0; i < Option::getOptionList().size(); i++){
74  const char* cat = Option::getOptionList()[i]->category;
75  const char* type = Option::getOptionList()[i]->type_name;
76 
77  if (cat != prev_cat)
78  fprintf(stderr, "\n%s OPTIONS:\n\n", cat);
79  else if (type != prev_type)
80  fprintf(stderr, "\n");
81 
82  Option::getOptionList()[i]->help(verbose);
83 
84  prev_cat = Option::getOptionList()[i]->category;
85  prev_type = Option::getOptionList()[i]->type_name;
86  }
87 
88  fprintf(stderr, "\nHELP OPTIONS:\n\n");
89  fprintf(stderr, " --%shelp Print help message.\n", Option::getHelpPrefixString());
90  fprintf(stderr, " --%shelp-verb Print verbose help message.\n", Option::getHelpPrefixString());
91  fprintf(stderr, "\n");
92  exit(0);
93 }
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:57
#define NULL

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
static void Minisat::randomShuffle ( double &  seed,
vec< T > &  xs 
)
static

Definition at line 42 of file Rnd.h.

43 {
44  for (int i = 0; i < xs.size(); i++){
45  int pick = i + irand(seed, xs.size() - i);
46  T tmp = xs[i];
47  xs[i] = xs[pick];
48  xs[pick] = tmp;
49  }
50 }
Size size(void) const
Definition: Vec.h:64
static int irand(double &seed, int size)
Definition: Rnd.h:37

+ Here is the call graph for this function:

template<class T >
static void Minisat::randomShuffle ( double &  seed,
vec< vec< T > > &  xs 
)
static

Definition at line 54 of file Rnd.h.

55 {
56  for (int i = 0; i < xs.size(); i++){
57  int pick = i + irand(seed, xs.size() - i);
58  vec<T> tmp; xs[i].moveTo(tmp);
59  xs[pick].moveTo(xs[i]);
60  tmp.moveTo(xs[pick]);
61  }
62 }
static int irand(double &seed, int size)
Definition: Rnd.h:37

+ Here is the call graph for this function:

template<class B , class Solver >
static void Minisat::readClause ( B &  in,
Solver &  S,
vec< Lit > &  lits 
)
static

Definition at line 35 of file Dimacs.h.

35  {
36  int parsed_lit, var;
37  lits.clear();
38  for (;;){
39  parsed_lit = parseInt(in);
40  if (parsed_lit == 0) break;
41  var = abs(parsed_lit)-1;
42  while (var >= S.nVars()) S.newVar();
43  lits.push( (parsed_lit > 0) ? mkLit(var) : ~mkLit(var) );
44  }
45 }
Lit mkLit(Var var, bool sign=false)
Definition: SolverTypes.h:63
int var(Lit p)
Definition: SolverTypes.h:67
static int parseInt(B &in)
Definition: ParseUtils.h:80
void push(void)
Definition: Vec.h:74
void clear(bool dealloc=false)
Definition: Vec.h:125

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class V , class T >
static void Minisat::remove ( V &  ts,
const T &  t 
)
inlinestatic

Definition at line 36 of file Alg.h.

37 {
38  int j = 0;
39  for (; j < (int)ts.size() && ts[j] != t; j++);
40  assert(j < (int)ts.size());
41  for (; j < (int)ts.size()-1; j++) ts[j] = ts[j+1];
42  ts.pop();
43 }
template<class T , class LessThan >
void Minisat::selectionSort ( T *  array,
int  size,
LessThan  lt 
)

Definition at line 39 of file Sort.h.

40 {
41  int i, j, best_i;
42  T tmp;
43 
44  for (i = 0; i < size-1; i++){
45  best_i = i;
46  for (j = i+1; j < size; j++){
47  if (lt(array[j], array[best_i]))
48  best_i = j;
49  }
50  tmp = array[i]; array[i] = array[best_i]; array[best_i] = tmp;
51  }
52 }

+ Here is the caller graph for this function:

template<class T >
static void Minisat::selectionSort ( T *  array,
int  size 
)
inlinestatic

Definition at line 53 of file Sort.h.

53  {
54  selectionSort(array, size, LessThan_default<T>()); }
static void selectionSort(T *array, int size)
Definition: Sort.h:53

+ Here is the call graph for this function:

void Minisat::setHelpPrefixStr ( const char *  str)

Definition at line 61 of file Options.cc.

61 { Option::getHelpPrefixString() = str; }

+ Here is the call graph for this function:

void Minisat::setUsageHelp ( const char *  str)

Definition at line 60 of file Options.cc.

60 { Option::getUsageString() = str; }

+ Here is the call graph for this function:

void Minisat::setX86FPUPrecision ( )

Definition at line 100 of file System.cc.

101 {
102 #if defined(__linux__) && defined(_FPU_EXTENDED) && defined(_FPU_DOUBLE) && defined(_FPU_GETCW)
103  // Only correct FPU precision on Linux architectures that needs and supports it:
104  fpu_control_t oldcw, newcw;
105  _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
106  printf("WARNING: for repeatability, setting FPU to use double precision\n");
107 #endif
108 }
bool Minisat::sign ( Lit  p)
inline

Definition at line 66 of file SolverTypes.h.

66 { return p.x & 1; }

+ Here is the caller graph for this function:

void Minisat::sigTerm ( void   handlerint)

Definition at line 164 of file System.cc.

165 {
166  signal(SIGINT, handler);
167  signal(SIGTERM,handler);
168 #ifdef SIGXCPU
169  signal(SIGXCPU,handler);
170 #endif
171 }
template<class B >
static void Minisat::skipLine ( B &  in)
static

Definition at line 72 of file ParseUtils.h.

72  {
73  for (;;){
74  if (isEof(in)) return;
75  if (*in == '\n') { ++in; return; }
76  ++in; } }
static bool isEof(const char *in)
Definition: ParseUtils.h:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class B >
static void Minisat::skipWhitespace ( B &  in)
static

Definition at line 66 of file ParseUtils.h.

66  {
67  while ((*in >= 9 && *in <= 13) || *in == 32)
68  ++in; }

+ Here is the caller graph for this function:

template<class T , class LessThan >
void Minisat::sort ( T *  array,
int  size,
LessThan  lt 
)

Definition at line 57 of file Sort.h.

58 {
59  if (size <= 15)
60  selectionSort(array, size, lt);
61 
62  else{
63  T pivot = array[size / 2];
64  T tmp;
65  int i = -1;
66  int j = size;
67 
68  for(;;){
69  do i++; while(lt(array[i], pivot));
70  do j--; while(lt(pivot, array[j]));
71 
72  if (i >= j) break;
73 
74  tmp = array[i]; array[i] = array[j]; array[j] = tmp;
75  }
76 
77  sort(array , i , lt);
78  sort(&array[i], size-i, lt);
79  }
80 }
void sort(vec< T > &v)
Definition: Sort.h:91
static void selectionSort(T *array, int size)
Definition: Sort.h:53

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
static void Minisat::sort ( T *  array,
int  size 
)
inlinestatic

Definition at line 81 of file Sort.h.

81  {
82  sort(array, size, LessThan_default<T>()); }
void sort(vec< T > &v)
Definition: Sort.h:91

+ Here is the call graph for this function:

template<class T , class LessThan >
void Minisat::sort ( vec< T > &  v,
LessThan  lt 
)

Definition at line 89 of file Sort.h.

89  {
90  sort((T*)v, v.size(), lt); }
Size size(void) const
Definition: Vec.h:64
void sort(vec< T > &v)
Definition: Sort.h:91

+ Here is the call graph for this function:

template<class T >
void Minisat::sort ( vec< T > &  v)

Definition at line 91 of file Sort.h.

91  {
92  sort(v, LessThan_default<T>()); }
void sort(vec< T > &v)
Definition: Sort.h:91

+ Here is the call graph for this function:

int Minisat::toInt ( Var  v)
inline

Definition at line 70 of file SolverTypes.h.

70 { return v; }

+ Here is the caller graph for this function:

int Minisat::toInt ( Lit  p)
inline

Definition at line 71 of file SolverTypes.h.

71 { return p.x; }
int Minisat::toInt ( lbool  l)
inline

Definition at line 120 of file SolverTypes.h.

120 { return l.value; }
lbool Minisat::toLbool ( int  v)
inline

Definition at line 121 of file SolverTypes.h.

121 { return lbool((uint8_t)v); }
Lit Minisat::toLit ( int  i)
inline

Definition at line 72 of file SolverTypes.h.

72 { Lit p; p.x = i; return p; }

+ Here is the caller graph for this function:

int Minisat::var ( Lit  p)
inline

Definition at line 67 of file SolverTypes.h.

67 { return p.x >> 1; }

+ Here is the caller graph for this function:

static void* Minisat::xrealloc ( void *  ptr,
size_t  size 
)
inlinestatic

Definition at line 33 of file XAlloc.h.

34 {
35  void* mem = realloc(ptr, size);
36  if (mem == NULL && errno == ENOMEM){
37  throw OutOfMemoryException();
38  }else
39  return mem;
40 }
#define NULL

+ Here is the caller graph for this function:

Variable Documentation

const CRef Minisat::CRef_Undef = RegionAllocator<uint32_t>::Ref_Undef

Definition at line 225 of file SolverTypes.h.

const Lit Minisat::lit_Error = { -1 }

Definition at line 78 of file SolverTypes.h.

const Lit Minisat::lit_Undef = { -2 }

Definition at line 77 of file SolverTypes.h.

const int Minisat::nprimes = 25
static

Definition at line 48 of file Map.h.

const int Minisat::primes[nprimes] = { 31, 73, 151, 313, 643, 1291, 2593, 5233, 10501, 21013, 42073, 84181, 168451, 337219, 674701, 1349473, 2699299, 5398891, 10798093, 21596719, 43193641, 86387383, 172775299, 345550609, 691101253 }
static

Definition at line 49 of file Map.h.

const Var Minisat::var_Undef = -1

Definition at line 47 of file SolverTypes.h.