Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/constraint_compiler into...
[satune.git] / src / AST / predicate.h
index 513e3869d5000681826a0e90e0d2fdef951e2d4f..c59a6a6078bdc8f1838fe215cb2f290014731da4 100644 (file)
@@ -5,12 +5,29 @@
 #include "ops.h"
 #include "structs.h"
 
-struct Predicate {
-       CompOp op;
-       VectorSet* domains;
+#define GETPREDICATETYPE(o) (((Predicate *)(o))->type)
+
+class Predicate {
+ public:
+  Predicate(PredicateType _type) : type(_type) {}
+       PredicateType type;
+       MEMALLOC;
 };
 
+class PredicateOperator : public Predicate {
+ public:
+       PredicateOperator(CompOp op, Set **domain, uint numDomain);
+       bool evalPredicateOperator(uint64_t *inputs);
+       CompOp op;
+       Array<Set *> domains;
+       MEMALLOC;
+};
 
-Predicate* allocPredicate(CompOp op, Set ** domain, uint numDomain);
-void deletePredicate(Predicate* predicate);
+class PredicateTable : public Predicate {
+ public:
+       PredicateTable(Table *table, UndefinedBehavior undefBehavior);
+       Table *table;
+       UndefinedBehavior undefinedbehavior;
+       MEMALLOC;
+};
 #endif