#include "structs.h"
#include "orderresolver.h"
#include "integerencoding.h"
-#include <stdlib.h>
+#include "qsort.h"
+#include "preprocess.h"
CSolver::CSolver() :
boolTrue(BooleanEdge(new BooleanConst(true))),
SetIteratorBooleanEdge *it = getConstraints();
while (it->hasNext()) {
BooleanEdge b = it->next();
- copy->addConstraint(b->clone(copy, &map));
+ copy->addConstraint(cloneEdge(copy, &map, b));
}
delete it;
return copy;
Element *element = new ElementFunction(function,array,numArrays,overflowstatus);
Element *e = elemMap.get(element);
if (e == NULL) {
+ element->updateParents();
allElements.push(element);
elemMap.put(element, element);
return element;
BooleanPredicate *boolean = new BooleanPredicate(predicate, inputs, numInputs, undefinedStatus);
Boolean *b = boolMap.get(boolean);
if (b == NULL) {
+ boolean->updateParents();
boolMap.put(boolean, boolean);
allBooleans.push(boolean);
return BooleanEdge(boolean);
} else if (newindex == 1) {
return newarray[0];
} else {
- qsort(newarray, newindex, sizeof(BooleanEdge), ptrcompares);
+ bsdqsort(newarray, newindex, sizeof(BooleanEdge), ptrcompares);
array = newarray;
asize = newindex;
}
Boolean *boolean = new BooleanLogic(this, op, array, asize);
Boolean *b = boolMap.get(boolean);
if (b == NULL) {
+ boolean->updateParents();
boolMap.put(boolean, boolean);
allBooleans.push(boolean);
return BooleanEdge(boolean);
}
constraints.add(constraint);
Boolean *ptr=constraint.getBoolean();
- if (constraint.isNegated())
- updateMustValue(ptr, BV_MUSTBEFALSE);
- else
- updateMustValue(ptr, BV_MUSTBETRUE);
if (ptr->boolVal == BV_UNSAT)
setUnSAT();
long long startTime = getTimeNano();
computePolarities(this);
+ Preprocess pp(this);
+ pp.doTransform();
+
DecomposeOrderTransform dot(this);
dot.doTransform();
- //This leaks like crazy
- // IntegerEncodingTransform iet(this);
- //iet.doTransform();
+ IntegerEncodingTransform iet(this);
+ iet.doTransform();
naiveEncodingDecision(this);
satEncoder->encodeAllSATEncoder(this);