add new class
authorbdemsky <bdemsky@uci.edu>
Mon, 23 Jul 2018 22:00:44 +0000 (15:00 -0700)
committerbdemsky <bdemsky@uci.edu>
Mon, 23 Jul 2018 22:00:44 +0000 (15:00 -0700)
src/ASTTransform/elementopt.cc [new file with mode: 0755]
src/ASTTransform/elementopt.h [new file with mode: 0755]
src/Backend/constraint.cc
src/Tuner/tunable.h

diff --git a/src/ASTTransform/elementopt.cc b/src/ASTTransform/elementopt.cc
new file mode 100755 (executable)
index 0000000..162661b
--- /dev/null
@@ -0,0 +1,22 @@
+#include "elementopt.h"
+#include "csolver.h"
+#include "tunable.h"
+#include "iterator.h"
+
+ElementOpt::ElementOpt(CSolver *_solver)
+       : Transform(_solver)
+{
+}
+
+ElementOpt::~ElementOpt() {
+}
+
+void ElementOpt::doTransform() {
+       if (solver->getTuner()->getTunable(ELEMENTOPT, &onoff) == 0)
+               return;
+
+       BooleanIterator bit(solver);
+       while (bit.hasNext()) {
+               Boolean *b = bit.next();
+       }
+}
diff --git a/src/ASTTransform/elementopt.h b/src/ASTTransform/elementopt.h
new file mode 100755 (executable)
index 0000000..0c4acd2
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef ELEMENTOPT_H
+#define ELEMENTOPT_H
+#include "classlist.h"
+#include "transform.h"
+
+class ElementOpt : public Transform {
+public:
+       ElementOpt(CSolver *_solver);
+       ~ElementOpt();
+       void doTransform();
+
+       CMEMALLOC;
+private:
+};
+
+#endif
index 34ddb0a..37a3db4 100644 (file)
@@ -784,6 +784,10 @@ Edge generateLTValueConstraint(CNF *cnf, uint numvars, Edge *vars, uint value) {
        }
 }
 
+void generateAddConstraint(CNF *cnf, uint nSum, Edge *sum, uint nVar1, Edge *var1, uint nVar2, Edge *var2) {
+  //TO WRITE....
+}
+
 Edge generateEquivNVConstraint(CNF *cnf, uint numvars, Edge *var1, Edge *var2) {
        if (numvars == 0)
                return E_True;
index fcc97be..d88f2c7 100644 (file)
@@ -39,7 +39,7 @@ public:
 static TunableDesc onoff(0, 1, 1);
 static TunableDesc offon(0, 1, 0);
 
-enum Tunables {DECOMPOSEORDER, MUSTREACHGLOBAL, MUSTREACHLOCAL, MUSTREACHPRUNE, OPTIMIZEORDERSTRUCTURE, ORDERINTEGERENCODING, PREPROCESS, NODEENCODING, EDGEENCODING, MUSTEDGEPRUNE};
+enum Tunables {DECOMPOSEORDER, MUSTREACHGLOBAL, MUSTREACHLOCAL, MUSTREACHPRUNE, OPTIMIZEORDERSTRUCTURE, ORDERINTEGERENCODING, PREPROCESS, NODEENCODING, EDGEENCODING, MUSTEDGEPRUNE, ELEMENTOPT};
 typedef enum Tunables Tunables;
 
 const char* tunableParameterToString(Tunables tunable);