Boolean *pred = solver->applyPredicate(equal2, inputs2, 2);
solver->addConstraint(pred);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 " \n", solver->getElementValue(e1), solver->getElementValue(e2));
else
printf("UNSAT\n");
Boolean *b = solver->applyPredicate(equals, inputs, 2);
solver->addConstraint(b);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 "\n", solver->getElementValue(e1), solver->getElementValue(e2));
else
printf("UNSAT\n");
Boolean *b = solver->applyPredicate(equals, inputs, 2);
solver->addConstraint(b);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 "\n", solver->getElementValue(e1), solver->getElementValue(e2));
else
printf("UNSAT\n");
Boolean *pred = solver->applyPredicate(gt, inputs2, 2);
solver->addConstraint(pred);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 " e7=%" PRIu64 "\n",
solver->getElementValue(e1), solver->getElementValue(e2), solver->getElementValue(e7));
else
solver->addConstraint(solver->applyLogicalOperation(SATC_OR, barray4, 2));
Boolean *barray5[] = {b1, b4};
solver->addConstraint(solver->applyLogicalOperation(SATC_XOR, barray5, 2));
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("b1=%d b2=%d b3=%d b4=%d\n",
solver->getBooleanValue(b1), solver->getBooleanValue(b2),
solver->getBooleanValue(b3), solver->getBooleanValue(b4));
Element *inputs2[] = {e1, e2};
Boolean *b = solver->applyPredicate(lt, inputs2, 2);
solver->addConstraint(b);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 "\n", solver->getElementValue(e1), solver->getElementValue(e2));
else
printf("UNSAT\n");
Boolean * array12[] = {o58, o81};
solver->addConstraint(solver->applyLogicalOperation(SATC_AND, array12, 2) );
- /* if (solver->startEncoding() == 1)
+ /* if (solver->solve() == 1)
printf("SAT\n");
else
printf("UNSAT\n");*/
Boolean *b2 = solver->orderConstraint(order, 1, 4);
solver->addConstraint(b1);
solver->addConstraint(b2);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("SAT\n");
else
printf("UNSAT\n");
Boolean *pred = solver->applyPredicate(lte, inputs2, 2);
solver->addConstraint(pred);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 " e3=%" PRIu64 " e4=%" PRIu64 " overFlow:%d\n",
solver->getElementValue(e1), solver->getElementValue(e2), solver->getElementValue(e3),
solver->getElementValue(e4), solver->getBooleanValue(overflow));
Boolean *pred2 = solver->applyPredicate(eq, tmparray2, 2);
solver->addConstraint(pred2);
- if (solver->startEncoding() == 1)
+ if (solver->solve() == 1)
printf("e1=%" PRIu64 " e2=%" PRIu64 " e3=%" PRIu64 " undefFlag:%d\n",
solver->getElementValue(e1), solver->getElementValue(e2),
solver->getElementValue(e3), solver->getBooleanValue(undef));
long long AutoTuner::evaluate(CSolver * problem, SearchTuner *tuner) {
CSolver * copy=problem->clone();
copy->setTuner(tuner);
- int result = copy->startEncoding();
+ int result = copy->solve();
long long elapsedTime=copy->getElapsedTime();
long long encodeTime=copy->getEncodeTime();
long long solveTime=copy->getSolveTime();
return order;
}
-int CSolver::startEncoding() {
+int CSolver::solve() {
bool deleteTuner = false;
if (tuner == NULL) {
tuner = new DefaultTuner();
Boolean *orderConstraint(Order *order, uint64_t first, uint64_t second);
/** When everything is done, the client calls this function and then csolver starts to encode*/
- int startEncoding();
+ int solve();
/** After getting the solution from the SAT solver, client can get the value of an element via this function*/
uint64_t getElementValue(Element *element);