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 "structs.h"
7
8 #define GETPREDICATETYPE(o) (((Predicate *)(o))->type)
9
10 struct Predicate {
11         PredicateType type;
12 };
13
14 struct PredicateOperator {
15         Predicate base;
16         CompOp op;
17         ArraySet domains;
18 };
19
20 struct PredicateTable {
21         Predicate base;
22         Table* table;
23         UndefinedBehavior undefinedbehavior;
24 };
25
26
27 Predicate* allocPredicateOperator(CompOp op, Set ** domain, uint numDomain);
28 Predicate* allocPredicateTable(Table* table, UndefinedBehavior undefBehavior);
29 // size and result will be modified by this function!
30 void getEqualitySetIntersection(PredicateOperator* predicate, uint* size, uint64_t* result);
31 void deletePredicate(Predicate* predicate);
32 #endif