cnf->encodeTime = startSolve - startTime;
model_print("CNF Encode time: %f\n", cnf->encodeTime / 1000000000.0);
cnf->solveTime = finishTime - startSolve;
- model_print("Solve time: %f\n", cnf->solveTime / 1000000000.0);
+ model_print("SAT Solving time: %f\n", cnf->solveTime / 1000000000.0);
return result;
}
}
bool notfinished = true;
+ Edge carray[numDomains];
while (notfinished) {
- Edge carray[numDomains];
-
if (predicate->evalPredicateOperator(vals) != generateNegation) {
//Include this in the set of terms
for (uint i = 0; i < numDomains; i++) {
}
bool notfinished = true;
+ Edge carray[numDomains + 1];
while (notfinished) {
- Edge carray[numDomains + 1];
-
uint64_t result = function->applyFunctionOperator(numDomains, vals);
bool isInRange = ((FunctionOperator *)func->getFunction())->isInRangeFunction(result);
bool needClause = isInRange;
array[index] = item;
}
- uint getSize() const {
+ inline uint getSize() const {
return size;
}
#include "csolver.h"
-//#include <unistd.h>
-//#include <sys/types.h>
+#include <unistd.h>
+#include <sys/types.h>
int main(int argc, char **argv) {
if (argc < 2) {
printf("You should specify file names ...");
exit(-1);
}
+ usleep(20000000);
for (int i = 1; i < argc; i++) {
CSolver *solver = CSolver::deserialize(argv[i]);
int value = solver->solve();
long long AutoTuner::evaluate(CSolver *problem, SearchTuner *tuner) {
CSolver *copy = problem->clone();
copy->setTuner(tuner);
+ model_print("**********************\n");
int result = copy->solve();
- model_print("SAT %d\n", result);
+ //model_print("SAT %d\n", result);
long long elapsedTime = copy->getElapsedTime();
- long long encodeTime = copy->getEncodeTime();
- long long solveTime = copy->getSolveTime();
+// long long encodeTime = copy->getEncodeTime();
+// long long solveTime = copy->getSolveTime();
long long metric = elapsedTime;
- model_print("Elapsed Time: %llu\n", elapsedTime);
- model_print("Encode Time: %llu\n", encodeTime);
- model_print("Solve Time: %llu\n", solveTime);
+// model_print("Elapsed Time: %llu\n", elapsedTime);
+// model_print("Encode Time: %llu\n", encodeTime);
+// model_print("Solve Time: %llu\n", solveTime);
delete copy;
return metric;
}
-
+void serialize(void* solver){
+ CCSOLVER(solver)->serialize();
+}
int getBooleanValue(void* solver,void* boolean);
int getOrderConstraintValue(void* solver,void *order, long first, long second);
void printConstraints(void* solver);
+void serialize(void* solver);
#ifdef __cplusplus
}
#endif
model_print("Is problem UNSAT after encoding: %d\n", unsat);
int result = unsat ? IS_UNSAT : satEncoder->solve();
- model_print("Result Computed in CSolver: %d\n", result);
+ model_print("Result Computed in SAT solver: %d\n", result);
if (deleteTuner) {
delete tuner;
csolverlb.getOrderConstraintValue.restype = c_int
csolverlb.printConstraints.argtypes = [c_void_p]
csolverlb.printConstraints.restype = None
+ csolverlb.serialize.argtypes = [c_void_p]
+ csolverlb.serialize.restype = None
return csolverlb