void ElementFunction::print() {
model_print("{ElementFunction<%p>:\n", this);
function->print();
+ model_print("OverFlow Boolean Flag:\n");
+ overflowstatus.getBoolean()->print();
+ model_print("Range:\n");
+ getRange()->print();
model_print("Elements:\n");
uint size = inputs.getSize();
for (uint i = 0; i < size; i++) {
}
}
-uint64_t Set::getMemberAt(uint index) {
- if (isRange) {
- return low + index;
- } else {
- return members->get(index);
- }
-}
-
Set::~Set() {
if (!isRange)
delete members;
}
void Set::print() {
- model_print("{Set<%p>:", this);
+ model_print("{Set(%lu)<%p>:", type, this);
if (isRange) {
model_print("Range: low=%lu, high=%lu}", low, high);
} else {
uint getSize();
VarType getType() {return type;}
uint64_t getNewUniqueItem() {return low++;}
- uint64_t getMemberAt(uint index);
uint64_t getElement(uint index);
uint getUnionSize(Set *s);
virtual bool isMutableSet() {return false;}
Set *set = order->set;
uint size = order->set->getSize();
for (uint i = 0; i < size; i++) {
- uint64_t valueI = set->getMemberAt(i);
+ uint64_t valueI = set->getElement(i);
for (uint j = i + 1; j < size; j++) {
- uint64_t valueJ = set->getMemberAt(j);
+ uint64_t valueJ = set->getElement(j);
OrderPair pairIJ(valueI, valueJ, E_NULL);
Edge constIJ = getPairConstraint(order, &pairIJ);
for (uint k = j + 1; k < size; k++) {
- uint64_t valueK = set->getMemberAt(k);
+ uint64_t valueK = set->getElement(k);
OrderPair pairJK(valueJ, valueK, E_NULL);
OrderPair pairIK(valueI, valueK, E_NULL);
Edge constIK = getPairConstraint(order, &pairIK);
Set *set = order->set;
uint size = order->set->getSize();
for (uint i = 0; i < size; i++) {
- uint64_t valueI = set->getMemberAt(i);
+ uint64_t valueI = set->getElement(i);
for (uint j = i + 1; j < size; j++) {
- uint64_t valueJ = set->getMemberAt(j);
+ uint64_t valueJ = set->getElement(j);
OrderPair pairIJ(valueI, valueJ, E_NULL);
OrderPair pairJI(valueJ, valueI, E_NULL);
Edge constIJ = getPartialPairConstraint(order, &pairIJ);
Edge constJI = getPartialPairConstraint(order, &pairJI);
for (uint k = j + 1; k < size; k++) {
- uint64_t valueK = set->getMemberAt(k);
+ uint64_t valueK = set->getElement(k);
OrderPair pairJK(valueJ, valueK, E_NULL);
OrderPair pairIK(valueI, valueK, E_NULL);
Edge constIK = getPartialPairConstraint(order, &pairIK);
allocEncodingArrayElement(encSize);
allocInUseArrayElement(encSize);
for (uint i = 0; i < size; i++) {
- encodingArray[i] = set->getMemberAt(i);
+ encodingArray[i] = set->getElement(i);
setInUseElement(i);
}
}
#include "orderedge.h"
#include "orderanalysis.h"
#include <time.h>
+#include <stdarg.h>
CSolver::CSolver() :
boolTrue(BooleanEdge(new BooleanConst(true))),
}
delete orderit;
}
-
+ model_print("*****************Before any modifications:************\n");
+ printConstraints();
computePolarities(this);
long long time2 = getTimeNano();
model_print("Polarity time: %f\n", (time2 - starttime) / NANOSEC);
- Preprocess pp(this);
- pp.doTransform();
+// Preprocess pp(this);
+// pp.doTransform();
long long time3 = getTimeNano();
- model_print("Preprocess time: %f\n", (time3 - time2) / NANOSEC);
+// model_print("Preprocess time: %f\n", (time3 - time2) / NANOSEC);
DecomposeOrderTransform dot(this);
dot.doTransform();
model_print("Elapse Encode time: %f\n", elapsedTime / NANOSEC);
model_print("Is problem UNSAT after encoding: %d\n", unsat);
+ model_print("########## After all modifications: #############\n");
+ printConstraints();
int result = unsat ? IS_UNSAT : satEncoder->solve();
model_print("Result Computed in CSolver: %d\n", result);
autotuner->tune();
delete autotuner;
}
+
+//Set* CSolver::addItemsToRange(Element* element, uint num, ...){
+// va_list args;
+// va_start(args, num);
+// element->getRange()
+// uint setSize = set->getSize();
+// uint newSize = setSize+ num;
+// uint64_t members[newSize];
+// for(uint i=0; i<setSize; i++){
+// members[i] = set->getElement(i);
+// }
+// for( uint i=0; i< num; i++){
+// uint64_t arg = va_arg(args, uint64_t);
+// members[setSize+i] = arg;
+// }
+// va_end(args);
+// return createSet(set->getType(), members, newSize);
+//}
\ No newline at end of file
void replaceBooleanWithFalse(BooleanEdge bexpr);
void replaceBooleanWithBoolean(BooleanEdge oldb, BooleanEdge newb);
CSolver *clone();
+// Set* addItemsToRange(Element* element, uint num, ...);
void serialize();
static CSolver *deserialize(const char *file);
void autoTune(uint budget);