dc5128b2ca48a45eb9ccda66566ec50724db4bd5
[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 class Predicate {
10 public:
11         Predicate(PredicateType _type) : type(_type) {}
12         virtual ~Predicate() {}
13         virtual Predicate *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
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         Predicate *clone(CSolver *solver, CloneMap *map);
23         CompOp op;
24         Array<Set *> domains;
25         MEMALLOC;
26 };
27
28 class PredicateTable : public Predicate {
29 public:
30         PredicateTable(Table *table, UndefinedBehavior undefBehavior);
31         Predicate *clone(CSolver *solver, CloneMap *map);
32         Table *table;
33         UndefinedBehavior undefinedbehavior;
34         MEMALLOC;
35 };
36 #endif