Renaming
[satune.git] / src / csolver.h
index a3d4c2b1aef970f6272bea87ae59075d09b7c875..a37434cf3e86bc39d3c209aeda7f99a5f6d6fb1c 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef CSOLVER_H
 #define CSOLVER_H
-#include "classlist.h"
+#include "classes.h"
 #include "ops.h"
-#include "structs.h"
+#include "corestructs.h"
+#include "asthash.h"
 
 class CSolver {
 public:
@@ -37,6 +38,10 @@ public:
        /** This function creates an element constrant. */
        Element *getElementConst(VarType type, uint64_t value);
 
+       Boolean *getBooleanTrue();
+
+       Boolean *getBooleanFalse();
+       
        /** This function creates a boolean variable. */
 
        Boolean *getBooleanVar(VarType type);
@@ -109,7 +114,7 @@ public:
 
        Tuner *getTuner() { return tuner; }
        
-       HSIteratorBoolean *getConstraints() { return constraints.iterator(); }
+       SetIteratorBoolean *getConstraints() { return constraints.iterator(); }
 
        SATEncoder *getSATEncoder() {return satEncoder;}
 
@@ -124,11 +129,9 @@ public:
        long long getEncodeTime();
        long long getSolveTime();
        
-       MEMALLOC;
+       CMEMALLOC;
 
 private:
-       void assignID(Boolean * b);
-       void assignID(Element * e);
        void handleXORFalse(BooleanLogic *bexpr, Boolean *child);
        void handleIMPLIESTrue(BooleanLogic *bexpr, Boolean *child);
        void handleIMPLIESFalse(BooleanLogic *bexpr, Boolean *child);
@@ -159,11 +162,16 @@ private:
        /** This is a vector of all function structs that we have allocated. */
        Vector<Function *> allFunctions;
 
+       Boolean * boolTrue;
+       Boolean * boolFalse;
+       
+       /** These two tables are used for deduplicating entries. */
+       BooleanMatchMap boolMap;
+       ElementMatchMap elemMap;
+       
        SATEncoder *satEncoder;
        bool unsat;
        Tuner *tuner;
-       uint booleanID;
-       uint elementID;
        
        long long elapsedTime;
 };