46bc5af83ff9b9e91449037d7f4ea6ca49851f71
[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 "structs.h"
7
8 #define GETPREDICATETYPE(o) (((Predicate *)(o))->type)
9
10 class Predicate {
11 public:
12         Predicate(PredicateType _type) : type(_type) {}
13         virtual ~Predicate() {}
14         PredicateType type;
15         MEMALLOC;
16 };
17
18 class PredicateOperator : public Predicate {
19 public:
20         PredicateOperator(CompOp op, Set **domain, uint numDomain);
21         bool evalPredicateOperator(uint64_t *inputs);
22         CompOp op;
23         Array<Set *> domains;
24         MEMALLOC;
25 };
26
27 class PredicateTable : public Predicate {
28 public:
29         PredicateTable(Table *table, UndefinedBehavior undefBehavior);
30         Table *table;
31         UndefinedBehavior undefinedbehavior;
32         MEMALLOC;
33 };
34 #endif