#include "order.h"
#include "predicate.h"
#include "set.h"
+#include "tunable.h"
SATEncoder::SATEncoder(CSolver *_solver) :
cnf(createCNF()),
}
Polarity p = constraint->polarity;
uint pSize = constraint->parents.getSize();
- if ((pSize > 1 && p != P_BOTHTRUEFALSE ) || pSize > 2) {
+ if (solver->getTuner()->getTunable(PROXYVARIABLE, &offon) == 1) {
+// if ((pSize > 1 && p != P_BOTHTRUEFALSE ) || pSize > 2) {
Edge e = getNewVarSATEncoder();
generateProxy(cnf, result, e, p);
booledgeMap.put(constraint, e.node_ptr);
result = e;
+ } else{
+ booledgeMap.put(constraint, result.node_ptr);
}
return c.isNegated() ? constraintNegate(result) : result;
#include "set.h"
#include "element.h"
#include "common.h"
+#include "tunable.h"
+#include "csolver.h"
Edge SATEncoder::encodeEnumEntriesTablePredicateSATEncoder(BooleanPredicate *constraint) {
ASSERT(constraint->predicate->type == TABLEPRED);
row = constraintAND(cnf, inputNum, carray);
break;
case SATC_FLAGFORCEUNDEFINED: {
- Edge proxy = constraintNewVar(cnf);
- generateProxy(cnf, constraintAND(cnf, inputNum, carray), proxy, P_BOTHTRUEFALSE);
- Edge undefConst = encodeConstraintSATEncoder(constraint->undefStatus);
- addConstraintCNF(cnf, constraintIMPLIES(cnf, proxy, constraintNegate(undefConst)));
- if (generateNegation == (entry->output != 0)) {
- continue;
+ if(solver->getTuner()->getTunable(PROXYVARIABLE, &offon) == 1){
+ Edge proxy = constraintNewVar(cnf);
+ generateProxy(cnf, constraintAND(cnf, inputNum, carray), proxy, P_BOTHTRUEFALSE);
+ Edge undefConst = encodeConstraintSATEncoder(constraint->undefStatus);
+ addConstraintCNF(cnf, constraintIMPLIES(cnf, proxy, constraintNegate(undefConst)));
+ if (generateNegation == (entry->output != 0)) {
+ continue;
+ }
+ row = proxy;
+ }else {
+ row = constraintAND(cnf, inputNum, carray);
}
- row = proxy;
break;
}
default:
static TunableDesc onoff(0, 1, 1);
static TunableDesc offon(0, 1, 0);
-enum Tunables {DECOMPOSEORDER, MUSTREACHGLOBAL, MUSTREACHLOCAL, MUSTREACHPRUNE, OPTIMIZEORDERSTRUCTURE, ORDERINTEGERENCODING, PREPROCESS, NODEENCODING, EDGEENCODING, MUSTEDGEPRUNE, ELEMENTOPT, ELEMENTOPTSETS};
+enum Tunables {DECOMPOSEORDER, MUSTREACHGLOBAL, MUSTREACHLOCAL, MUSTREACHPRUNE, OPTIMIZEORDERSTRUCTURE, ORDERINTEGERENCODING, PREPROCESS, NODEENCODING, EDGEENCODING, MUSTEDGEPRUNE, ELEMENTOPT, ELEMENTOPTSETS, PROXYVARIABLE};
typedef enum Tunables Tunables;
const char* tunableParameterToString(Tunables tunable);