ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
Minisat Namespace Reference

Classes

class  BoolOption
 
class  Clause
 
class  ClauseAllocator
 
class  CMap
 
struct  DeepEqual
 
struct  DeepHash
 
class  DoubleOption
 
struct  DoubleRange
 
struct  Equal
 
struct  Hash
 
class  Heap
 
struct  Int64Range
 
class  IntOption
 
struct  IntRange
 
class  lbool
 
struct  LessThan_default
 
struct  Lit
 
class  Map
 
class  OccLists
 
class  Option
 
class  OutOfMemoryException
 
class  Queue
 
class  RegionAllocator
 
class  SimpSolver
 
class  Solver
 
class  StreamBuffer
 
class  StringOption
 
class  vec
 

Typedefs

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

Functions

int parseOptions (int &argc, char **argv, bool strict=false)
 
int printUsageAndExit (int argc, char **argv, bool verbose=false)
 
void setUsageHelp (const char *str)
 
void setHelpPrefixStr (const char *str)
 
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)
 
template<class T, class LessThan>
void selectionSort (T *array, int size, LessThan lt)
 
template<class T, class LessThan>
void sort (T *array, int size, LessThan lt)
 
template<class T, class LessThan>
void sort (vec< T > &v, LessThan lt)
 
template<class T>
void sort (vec< T > &v)
 
double memUsed ()
 
double memUsedPeak ()
 

Variables

const Lit lit_Undef = { -2 }
 
const Lit lit_Error = { -1 }
 
const CRef CRef_Undef = RegionAllocator<uint32_t>::Ref_Undef
 

Typedef Documentation

◆ CRef

Definition at line 123 of file SolverTypes.h.

◆ Var

typedef int Minisat::Var

Definition at line 44 of file SolverTypes.h.

Function Documentation

◆ memUsed()

ABC_NAMESPACE_IMPL_START double Minisat::memUsed ( )
extern

Definition at line 107 of file System.cpp.

107{ return 0; }

◆ memUsedPeak()

double Minisat::memUsedPeak ( )
extern

Definition at line 108 of file System.cpp.

108{ return 0; }
Here is the caller graph for this function:

◆ mkLit()

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

Definition at line 60 of file SolverTypes.h.

60{ Lit p; p.x = var + var + (int)sign; return p; }
Cube * p
Definition exorList.c:222
int var(Lit p)
Definition SolverTypes.h:64
bool sign(Lit p)
Definition SolverTypes.h:63
Here is the caller graph for this function:

◆ operator^()

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

Definition at line 62 of file SolverTypes.h.

62{ Lit q; q.x = p.x ^ (unsigned int)b; return q; }

◆ operator~()

Lit Minisat::operator~ ( Lit p)
inline

Definition at line 61 of file SolverTypes.h.

61{ Lit q; q.x = p.x ^ 1; return q; }

◆ parseOptions()

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

Definition at line 28 of file Options.cpp.

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 return printUsageAndExit(argc, argv);
36 else if (match(str, "-verb"))
37 return 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 {
49 if (strict && match(argv[i], "-"))
50 { fprintf(stderr, "ERROR! Unknown flag \"%s\". Use '--%shelp' for help.\n", argv[i], Option::getHelpPrefixString()); return 0; } // exit(0);
51 else
52 argv[j++] = argv[i];
53 }
54 }
55 }
56
57 argc -= (i - j);
58 return 1;
59}
static const char *& getHelpPrefixString()
Definition Options.h:60
static vec< Option * > & getOptionList()
Definition Options.h:58
int printUsageAndExit(int argc, char **argv, bool verbose=false)
Definition Options.cpp:64
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printUsageAndExit()

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

Definition at line 64 of file Options.cpp.

65{
66 const char* usage = Option::getUsageString();
67 if (usage != NULL)
68 fprintf(stderr, usage, argv[0]);
69
71
72 const char* prev_cat = NULL;
73 const char* prev_type = NULL;
74
75 for (int i = 0; i < Option::getOptionList().size(); i++){
76 const char* cat = Option::getOptionList()[i]->category;
77 const char* type = Option::getOptionList()[i]->type_name;
78
79 if (cat != prev_cat)
80 fprintf(stderr, "\n%s OPTIONS:\n\n", cat);
81 else if (type != prev_type)
82 fprintf(stderr, "\n");
83
84 Option::getOptionList()[i]->help(verbose);
85
86 prev_cat = Option::getOptionList()[i]->category;
87 prev_type = Option::getOptionList()[i]->type_name;
88 }
89
90 fprintf(stderr, "\nHELP OPTIONS:\n\n");
91 fprintf(stderr, " --%shelp Print help message.\n", Option::getHelpPrefixString());
92 fprintf(stderr, " --%shelp-verb Print verbose help message.\n", Option::getHelpPrefixString());
93 fprintf(stderr, "\n");
94// exit(0);
95 return 0;
96}
static const char *& getUsageString()
Definition Options.h:59
type
CUBE COVER and CUBE typedefs ///.
Definition exor.h:90
usage()
Definition main.c:626
void sort(T *array, int size, LessThan lt)
Definition Sort.h:58
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectionSort()

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

Definition at line 40 of file Sort.h.

41{
42 int i, j, best_i;
43 T tmp;
44
45 for (i = 0; i < size-1; i++){
46 best_i = i;
47 for (j = i+1; j < size; j++){
48 if (lt(array[j], array[best_i]))
49 best_i = j;
50 }
51 tmp = array[i]; array[i] = array[best_i]; array[best_i] = tmp;
52 }
53}
Here is the caller graph for this function:

◆ setHelpPrefixStr()

void Minisat::setHelpPrefixStr ( const char * str)
extern

Definition at line 63 of file Options.cpp.

Here is the call graph for this function:

◆ setUsageHelp()

void Minisat::setUsageHelp ( const char * str)
extern

Definition at line 62 of file Options.cpp.

62{ Option::getUsageString() = str; }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sign()

bool Minisat::sign ( Lit p)
inline

Definition at line 63 of file SolverTypes.h.

63{ return p.x & 1; }
Here is the caller graph for this function:

◆ sort() [1/3]

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

Definition at line 58 of file Sort.h.

59{
60 if (size <= 15)
61 selectionSort(array, size, lt);
62
63 else{
64 T pivot = array[size / 2];
65 T tmp;
66 int i = -1;
67 int j = size;
68
69 for(;;){
70 do i++; while(lt(array[i], pivot));
71 do j--; while(lt(pivot, array[j]));
72
73 if (i >= j) break;
74
75 tmp = array[i]; array[i] = array[j]; array[j] = tmp;
76 }
77
78 sort(array , i , lt);
79 sort(&array[i], size-i, lt);
80 }
81}
void selectionSort(T *array, int size, LessThan lt)
Definition Sort.h:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sort() [2/3]

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

Definition at line 92 of file Sort.h.

Here is the call graph for this function:

◆ sort() [3/3]

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

Definition at line 90 of file Sort.h.

90 {
91 sort((T*)v, v.size(), lt); }
Here is the call graph for this function:

◆ toInt() [1/3]

int Minisat::toInt ( lbool l)
inline

Definition at line 116 of file SolverTypes.h.

116{ return l.value; }

◆ toInt() [2/3]

int Minisat::toInt ( Lit p)
inline

Definition at line 68 of file SolverTypes.h.

68{ return p.x; }

◆ toInt() [3/3]

int Minisat::toInt ( Var v)
inline

Definition at line 67 of file SolverTypes.h.

67{ return v; }
Here is the caller graph for this function:

◆ toLbool()

lbool Minisat::toLbool ( int v)
inline

Definition at line 117 of file SolverTypes.h.

117{ return lbool((uint8_t)v); }
ABC_NAMESPACE_HEADER_START typedef unsigned char uint8_t
Definition Fxch.h:31
signed char lbool
Definition satVec.h:135

◆ toLit()

Lit Minisat::toLit ( int i)
inline

Definition at line 69 of file SolverTypes.h.

69{ Lit p; p.x = i; return p; }
Here is the caller graph for this function:

◆ var()

int Minisat::var ( Lit p)
inline

Definition at line 64 of file SolverTypes.h.

64{ return p.x >> 1; }
Here is the caller graph for this function:

Variable Documentation

◆ CRef_Undef

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

Definition at line 195 of file SolverTypes.h.

◆ lit_Error

const Lit Minisat::lit_Error = { -1 }

Definition at line 75 of file SolverTypes.h.

75{ -1 }; // }

◆ lit_Undef

const Lit Minisat::lit_Undef = { -2 }

Definition at line 74 of file SolverTypes.h.

74{ -2 }; // }- Useful special constants.