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

Classes

class  BoolOption
 
class  bqueue
 
class  Clause
 
class  ClauseAllocator
 
class  CMap
 
struct  DeepEqual
 
struct  DeepHash
 
class  DoubleOption
 
struct  DoubleRange
 
struct  Equal
 
struct  Hash
 
class  Heap
 
class  Heap2
 
class  Int64Option
 
struct  Int64Range
 
class  IntOption
 
struct  IntRange
 
class  lbool
 
struct  LessThan_default
 
struct  Lit
 
class  Map
 
class  OccLists
 
class  Option
 
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

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)
 
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

BoolOption opt_certified_ (_certified, "certified", "Certified UNSAT using DRUP format", false)
 
StringOption opt_certified_file_ (_certified, "certified-output", "Certified UNSAT output file", "NULL")
 
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 132 of file SolverTypes.h.

◆ Var

typedef int Gluco2::Var

Definition at line 54 of file SolverTypes.h.

Function Documentation

◆ memUsed()

ABC_NAMESPACE_IMPL_START double Gluco2::memUsed ( )
extern

Definition at line 110 of file System2.cpp.

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

◆ memUsedPeak()

double Gluco2::memUsedPeak ( )
extern

◆ mkLit()

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

Definition at line 69 of file SolverTypes.h.

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

◆ operator^()

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

Definition at line 71 of file SolverTypes.h.

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

◆ operator~()

Lit Gluco2::operator~ ( Lit p)
inline

Definition at line 70 of file SolverTypes.h.

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

◆ parseOptions()

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

Definition at line 28 of file Options2.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 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 const char *& getHelpPrefixString()
Definition Options.h:62
static vec< Option * > & getOptionList()
Definition Options.h:60
void printUsageAndExit(int argc, char **argv, bool verbose=false)
Definition Options2.cpp:62
VOID_HACK exit()
Here is the call graph for this function:

◆ printUsageAndExit()

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

Definition at line 62 of file Options2.cpp.

63{
64 const char* usage = Option::getUsageString();
65 if (usage != NULL)
66 fprintf(stderr, usage, argv[0]);
67
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}
static const char *& getUsageString()
Definition Options.h:61
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 Gluco2::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 Gluco2::setHelpPrefixStr ( const char * str)
extern

Definition at line 61 of file Options2.cpp.

Here is the call graph for this function:

◆ setUsageHelp()

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

Definition at line 60 of file Options2.cpp.

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

◆ sign()

bool Gluco2::sign ( Lit p)
inline

Definition at line 72 of file SolverTypes.h.

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

◆ sort() [1/3]

template<class T, class LessThan>
void Gluco2::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 Gluco2::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 Gluco2::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 Gluco2::toInt ( lbool l)
inline

Definition at line 125 of file SolverTypes.h.

125{ return l.value; }

◆ toInt() [2/3]

int Gluco2::toInt ( Lit p)
inline

Definition at line 77 of file SolverTypes.h.

77{ return p.x; }

◆ toInt() [3/3]

int Gluco2::toInt ( Var v)
inline

Definition at line 76 of file SolverTypes.h.

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

◆ toLbool()

lbool Gluco2::toLbool ( int v)
inline

Definition at line 126 of file SolverTypes.h.

126{ 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 Gluco2::toLit ( int i)
inline

Definition at line 78 of file SolverTypes.h.

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

◆ var()

int Gluco2::var ( Lit p)
inline

Definition at line 73 of file SolverTypes.h.

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

Variable Documentation

◆ CRef_Undef

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

Definition at line 222 of file SolverTypes.h.

◆ lit_Error

const Lit Gluco2::lit_Error = { -1 }

Definition at line 84 of file SolverTypes.h.

84{ -1 }; // }

◆ lit_Undef

const Lit Gluco2::lit_Undef = { -2 }

Definition at line 83 of file SolverTypes.h.

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

◆ opt_certified_

BoolOption Gluco2::opt_certified_(_certified, "certified", "Certified UNSAT using DRUP format", false) ( _certified ,
"certified" ,
"Certified UNSAT using DRUP format" ,
false  )

◆ opt_certified_file_

StringOption Gluco2::opt_certified_file_(_certified, "certified-output", "Certified UNSAT output file", "NULL") ( _certified ,
"certified-output" ,
"Certified UNSAT output file" ,
"NULL"  )