Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/constraint_compiler
[satune.git] / src / AST / predicate.h
1 #ifndef PREDICATE_H
2 #define PREDICATE_H
3 #include "classlist.h"
4 #include "mymemory.h"
5 #include "ops.h"
6 #include "astops.h"
7 #include "structs.h"
8 #include "common.h"
9
10 class Predicate {
11 public:
12         Predicate(PredicateType _type) : type(_type) {}
13         virtual ~Predicate() {}
14         virtual Predicate *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
15         PredicateType type;
16         CMEMALLOC;
17 };
18
19 class PredicateOperator : public Predicate {
20 public:
21         PredicateOperator(CompOp op, Set **domain, uint numDomain);
22         bool evalPredicateOperator(uint64_t *inputs);
23         Predicate *clone(CSolver *solver, CloneMap *map);
24         CompOp op;
25         Array<Set *> domains;
26         CMEMALLOC;
27 };
28
29 class PredicateTable : public Predicate {
30 public:
31         PredicateTable(Table *table, UndefinedBehavior undefBehavior);
32         Predicate *clone(CSolver *solver, CloneMap *map);
33         Table *table;
34         UndefinedBehavior undefinedbehavior;
35         CMEMALLOC;
36 };
37 #endif