Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/constraint_compiler
[satune.git] / src / Encoders / functionencoding.h
index 60690e3857a0626433a16fa255e17bb510215649..a7b6364a67af95d71d617c8423475ff69c91a707 100644 (file)
@@ -3,39 +3,30 @@
 #include "classlist.h"
 
 enum FunctionEncodingType {
-       FUNC_UNASSIGNED, ENUMERATEIMPLICATIONS, CIRCUIT
+       FUNC_UNASSIGNED, ENUMERATEIMPLICATIONS, ENUMERATEIMPLICATIONSNEGATE, CIRCUIT
 };
 
 typedef enum FunctionEncodingType FunctionEncodingType;
 
 union ElementPredicate {
-       Element * function;
-       Boolean * predicate;
+       Element *function;
+       Boolean *predicate;
 };
 
 typedef union ElementPredicate ElementPredicate;
 
-struct FunctionEncoding {
+class FunctionEncoding {
+public:
        FunctionEncodingType type;
        bool isFunction;//true for function, false for predicate
        ElementPredicate op;
+       FunctionEncoding(Element *function);
+       FunctionEncoding(Boolean *predicate);
+       void setFunctionEncodingType(FunctionEncodingType type);
+       FunctionEncodingType getFunctionEncodingType() {return type;}
+       CMEMALLOC;
 };
 
-inline FunctionEncoding* getFunctionEncoding(ASTNode func){
-       switch(GETASTNODETYPE(func)){
-               case ELEMFUNCRETURN:
-                       return &((ElementFunction*)func)->functionencoding;
-               case PREDICATEOP:
-                       return &((BooleanPredicate*)func)->encoding;
-               default:
-                       ASSERT(0);
-       }
-       return NULL;
-}
-
-void initFunctionEncoding(FunctionEncoding *encoding, Element *function);
-void initPredicateEncoding(FunctionEncoding *encoding, Boolean *predicate);
-void setFunctionEncodingType(FunctionEncoding* encoding, FunctionEncodingType type);
-void deleteFunctionEncoding(FunctionEncoding *This);
+
 
 #endif