}
case P_UNDEFINED:
//There is an unreachable order constraint if this assert fires
- ASSERT(0);
+ //Clients can easily do this, so don't do anything.
+ ;
}
}
#include "structs.h"
#include "orderedge.h"
-enum NodeStatus {NOTVISITED, VISITED, FINISHED, SATC_ADDEDTOSET};
+enum NodeStatus {NOTVISITED, VISITED, FINISHED, ADDEDTOSET};
typedef enum NodeStatus NodeStatus;
class OrderNode {
else
partialcandidatevec.setExpand(from->sccNum, NULL);
}
- if (from->status != SATC_ADDEDTOSET) {
- from->status = SATC_ADDEDTOSET;
+ if (from->status != ADDEDTOSET) {
+ from->status = ADDEDTOSET;
((MutableSet *)neworder->set)->addElementMSet(from->id);
}
- if (to->status != SATC_ADDEDTOSET) {
- to->status = SATC_ADDEDTOSET;
+ if (to->status != ADDEDTOSET) {
+ to->status = ADDEDTOSET;
((MutableSet *)neworder->set)->addElementMSet(to->id);
}
if (currOrder->type == SATC_PARTIAL) {
}
void setCurrentOrder(Order* _current) { currOrder = _current;}
bool canExecuteTransform();
-private:
+ CMEMALLOC;
+ private:
Order* currOrder;
OrderGraph* currGraph;
};
virtual ~Transform();
virtual bool canExecuteTransform() = 0;
virtual void doTransform() = 0;
-protected:
+ CMEMALLOC;
+ protected:
// Need solver for translating back the result ...
CSolver* solver;
};
~Transformer();
IntegerEncodingTransform* getIntegerEncodingTransform(){ return integerEncoding; }
void orderAnalysis();
-private:
+ CMEMALLOC;
+ private:
//For now we can just add transforms here, but in future we may want take a smarter approach.
IntegerEncodingTransform* integerEncoding;
DecomposeOrderTransform* decomposeOrder;
type *expose() {
return array;
}
-
+ CMEMALLOC;
private:
uint size;
uint capacity;
LIB_NAME := cons_comp
LIB_SO := lib_$(LIB_NAME).so
-CPPFLAGS += -Wall -g -O3
+CPPFLAGS += -Wall -g -O0
# Mac OSX options
ifeq ($(UNAME), Darwin)
Boolean *b=array[i];
if (b->type == BOOLCONST) {
if (b->isTrue())
- return b;
+ return boolTrue;
else
continue;
} else
newarray[newindex++]=b;
}
- if (newindex==1)
+ if (newindex==0) {
+ return boolFalse;
+ } else if (newindex==1)
return newarray[0];
else if (newindex == 2) {
bool isNot0 = (newarray[0]->type==BOOLCONST) && ((BooleanLogic *)newarray[0])->op == SATC_NOT;
if (b->isTrue())
continue;
else
- return b;
+ return boolFalse;
} else
newarray[newindex++]=b;
}
- if(newindex==1) {
+ if (newindex==0) {
+ return boolTrue;
+ } else if(newindex==1) {
return newarray[0];
} else {
array = newarray;
}
}
+ ASSERT(asize != 0);
Boolean *boolean = new BooleanLogic(this, op, array, asize);
Boolean *b = boolMap.get(boolean);
if (b == NULL) {
void * ourcalloc(size_t count, size_t size);
void * ourrealloc(void *ptr, size_t size);
*/
+void * model_malloc(size_t size);
+void model_free(void *ptr);
+void * model_calloc(size_t count, size_t size);
+void * model_realloc(void *ptr, size_t size);
+
+#define ourmalloc model_malloc
+#define ourfree model_free
+#define ourrealloc model_realloc
+#define ourcalloc model_calloc
+/*
static inline void *ourmalloc(size_t size) { return malloc(size); }
static inline void ourfree(void *ptr) { free(ptr); }
static inline void *ourcalloc(size_t count, size_t size) { return calloc(count, size); }
-static inline void *ourrealloc(void *ptr, size_t size) { return realloc(ptr, size); }
+static inline void *ourrealloc(void *ptr, size_t size) { return realloc(ptr, size); }*/
#define CMEMALLOC \
void *operator new(size_t size) { \