X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2FAST%2Fpredicate.h;h=183a96099c9d69157f8a63dc7d4c6bd323a91f36;hb=da9bf180de81b31c95fb4987b84412e11ce3f6eb;hp=22f33d0e2e4bacaac23a6f22ac608e475d36c72c;hpb=06c6e560d30a2d3774c379e28ddf3c8b9e5a19a6;p=satune.git diff --git a/src/AST/predicate.h b/src/AST/predicate.h index 22f33d0..183a960 100644 --- a/src/AST/predicate.h +++ b/src/AST/predicate.h @@ -3,30 +3,35 @@ #include "classlist.h" #include "mymemory.h" #include "ops.h" +#include "astops.h" #include "structs.h" +#include "common.h" -#define GETPREDICATETYPE(o) (((Predicate *)(o))->type) - -struct Predicate { +class Predicate { +public: + Predicate(PredicateType _type) : type(_type) {} + virtual ~Predicate() {} + virtual Predicate *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;} PredicateType type; + CMEMALLOC; }; -struct PredicateOperator { - Predicate base; +class PredicateOperator : public Predicate { +public: + PredicateOperator(CompOp op, Set **domain, uint numDomain); + bool evalPredicateOperator(uint64_t *inputs); + Predicate *clone(CSolver *solver, CloneMap *map); CompOp op; - ArraySet domains; + Array domains; + CMEMALLOC; }; -struct PredicateTable { - Predicate base; - Table* table; +class PredicateTable : public Predicate { +public: + PredicateTable(Table *table, UndefinedBehavior undefBehavior); + Predicate *clone(CSolver *solver, CloneMap *map); + Table *table; UndefinedBehavior undefinedbehavior; + CMEMALLOC; }; - - -Predicate* allocPredicateOperator(CompOp op, Set ** domain, uint numDomain); -Predicate* allocPredicateTable(Table* table, UndefinedBehavior undefBehavior); -// size and result will be modified by this function! -void getEqualitySetIntersection(PredicateOperator* predicate, uint* size, uint64_t* result); -void deletePredicate(Predicate* predicate); #endif