More graph building
[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 getOp() {return op;}
25         Array<Set *> domains;
26         CMEMALLOC;
27  private:
28         CompOp op;
29 };
30
31 class PredicateTable : public Predicate {
32 public:
33         PredicateTable(Table *table, UndefinedBehavior undefBehavior);
34         Predicate *clone(CSolver *solver, CloneMap *map);
35         Table *table;
36         UndefinedBehavior undefinedbehavior;
37         CMEMALLOC;
38 };
39 #endif