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