printConstraints(satune);
}
+ public void turnoffOptimizations(){
+ turnoffOptimizations(satune);
+ }
+
public int solve(){
return solve(satune);
}
private native int getBooleanValue(long solver,long bool);
private native int getOrderConstraintValue(long solver,long order, long first, long second);
private native void printConstraints(long solver);
+ private native void turnoffOptimizations(long solver);
private native void serialize(long solver);
private native void mustHaveValue(long solver, long element);
private native void setInterpreter(long solver, int type);
CCSOLVER(solver)->printConstraints();
}
+void turnoffOptimizations(void *solver) {
+ CCSOLVER(solver)->turnoffOptimizations();
+}
+
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 turnoffOptimizations(void *solver);
void serialize(void *solver);
void mustHaveValue(void *solver, void *element);
void setInterpreter(void *solver, unsigned int type);
unsat(false),
booleanVarUsed(false),
incrementalMode(false),
+ optimizationsOff(false),
tuner(NULL),
elapsedTime(0),
satsolverTimeout(NOTIMEOUT),
}
void CSolver::addConstraint(BooleanEdge constraint) {
- if (!useInterpreter()) {
+ if (!useInterpreter() && !optimizationsOff) {
if (isTrue(constraint))
return;
else if (isFalse(constraint)) {
}
int result = IS_INDETER;
ASSERT (!useInterpreter());
-
- computePolarities(this);
+ if(!optimizationsOff){
+ computePolarities(this);
+ }
// long long time1 = getTimeNano();
// model_print("Polarity time: %f\n", (time1 - startTime) / NANOSEC);
// Preprocess pp(this);
}
delete orderit;
}
+ long long time1, time2;
+
computePolarities(this);
- long long time1 = getTimeNano();
- model_print("Polarity time: %f\n", (time1 - startTime) / NANOSEC);
- Preprocess pp(this);
- pp.doTransform();
- long long time2 = getTimeNano();
- model_print("Preprocess time: %f\n", (time2 - time1) / NANOSEC);
-
- DecomposeOrderTransform dot(this);
- dot.doTransform();
time1 = getTimeNano();
- model_print("Decompose Order: %f\n", (time1 - time2) / NANOSEC);
+ model_print("Polarity time: %f\n", (time1 - startTime) / NANOSEC);
+ if(!optimizationsOff){
+ Preprocess pp(this);
+ pp.doTransform();
+ time2 = getTimeNano();
+ model_print("Preprocess time: %f\n", (time2 - time1) / NANOSEC);
- IntegerEncodingTransform iet(this);
- iet.doTransform();
+ DecomposeOrderTransform dot(this);
+ dot.doTransform();
+ time1 = getTimeNano();
+ model_print("Decompose Order: %f\n", (time1 - time2) / NANOSEC);
- ElementOpt eop(this);
- eop.doTransform();
+ IntegerEncodingTransform iet(this);
+ iet.doTransform();
- EncodingGraph eg(this);
- eg.encode();
+ ElementOpt eop(this);
+ eop.doTransform();
+ EncodingGraph eg(this);
+ eg.encode();
+ }
naiveEncodingDecision(this);
// eg.validate();
-
- VarOrderingOpt bor(this, satEncoder);
- bor.doTransform();
-
- time2 = getTimeNano();
- model_print("Encoding Graph Time: %f\n", (time2 - time1) / NANOSEC);
+ if(!optimizationsOff){
+ VarOrderingOpt bor(this, satEncoder);
+ bor.doTransform();
+ time2 = getTimeNano();
+ model_print("Encoding Graph Time: %f\n", (time2 - time1) / NANOSEC);
+ }
satEncoder->encodeAllSATEncoder(this);
time1 = getTimeNano();
void freezeElement(Element *e);
+ void turnoffOptimizations(){optimizationsOff = true;}
+
/** After getting the solution from the SAT solver, client can get the value of a boolean via this function*/
bool getBooleanValue(BooleanEdge boolean);
bool unsat;
bool booleanVarUsed;
bool incrementalMode;
+ bool optimizationsOff;
Tuner *tuner;
long long elapsedTime;
long satsolverTimeout;
Interpreter *interpreter;
+ bool noOptimization;
friend class ElementOpt;
friend class VarOrderingOpt;
};
csolverlb.getOrderConstraintValue.restype = c_int
csolverlb.printConstraints.argtypes = [c_void_p]
csolverlb.printConstraints.restype = None
+ csolverlb.turnoffOptimizations.argtypes = [c_void_p]
+ csolverlb.turnoffOptimizations.restype = None
csolverlb.clone.argtypes = [c_void_p]
csolverlb.clone.restype = c_void_p
csolverlb.serialize.argtypes = [c_void_p]
printConstraints((void *)solver);
}
+/*
+ * Class: SatuneJavaAPI
+ * Method: turnoffOptimizations
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_satune_SatuneJavaAPI_turnoffOptimizations
+ (JNIEnv *env, jobject obj, jlong solver)
+{
+ turnoffOptimizations((void *)solver);
+}
+
/*
* Class: SatuneJavaAPI
* Method: serialize
JNIEXPORT void JNICALL Java_satune_SatuneJavaAPI_printConstraints
(JNIEnv *, jobject, jlong);
+/*
+ * Class: satune_SatuneJavaAPI
+ * Method: turnoffOptimizations
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_satune_SatuneJavaAPI_turnoffOptimizations
+ (JNIEnv *, jobject, jlong);
+
/*
* Class: satune_SatuneJavaAPI
* Method: serialize