#include "satencoder.h"
#include "sattranslator.h"
#include "tunable.h"
-#include "orderencoder.h"
#include "polarityassignment.h"
+#include "orderdecompose.h"
CSolver::CSolver() : unsat(false) {
- tuner = allocTuner();
+ tuner = new Tuner();
satEncoder = allocSATEncoder(this);
}
}
deleteSATEncoder(satEncoder);
- deleteTuner(tuner);
+ delete tuner;
}
Set *CSolver::createSet(VarType type, uint64_t *elements, uint numelements) {
}
Boolean *CSolver::applyPredicateTable(Predicate *predicate, Element **inputs, uint numInputs, Boolean *undefinedStatus) {
- Boolean *boolean = new BooleanPredicate(predicate, inputs, numInputs, undefinedStatus);
+ BooleanPredicate *boolean = new BooleanPredicate(predicate, inputs, numInputs, undefinedStatus);
allBooleans.push(boolean);
return boolean;
}
Boolean *CSolver::applyLogicalOperation(LogicOp op, Boolean **array, uint asize) {
- return new BooleanLogic(this, op, array, asize);
+ Boolean *boolean = new BooleanLogic(this, op, array, asize);
+ allBooleans.push(boolean);
+ return boolean;
}
void CSolver::addConstraint(Boolean *constraint) {
}
int CSolver::startEncoding() {
- naiveEncodingDecision(this);
computePolarities(this);
orderAnalysis(this);
+ naiveEncodingDecision(this);
encodeAllSATEncoder(this, satEncoder);
int result = solveCNF(satEncoder->cnf);
model_print("sat_solver's result:%d\tsolutionSize=%d\n", result, satEncoder->cnf->solver->solutionsize);