Add Const API to frontend
[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 Predicate* allocPredicateOperator(CompOp op, Set ** domain, uint numDomain);
27 Predicate* allocPredicateTable(Table* table, UndefinedBehavior undefBehavior);
28 bool evalPredicateOperator(PredicateOperator * This, uint64_t * inputs);
29 void deletePredicate(Predicate* This);
30 #endif