X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2FAST%2Fset.h;h=eb406bb553c6ed4feded557fc57454a46dd0b13c;hb=8014c371c763fbc3fe65ec15e5320c1a9b859a8d;hp=1555ae9650dc1169795fbd61174c5635461851d3;hpb=32f0e484ad03e167ba45ddeeb78f1093a013e675;p=satune.git diff --git a/src/AST/set.h b/src/AST/set.h index 1555ae9..eb406bb 100644 --- a/src/AST/set.h +++ b/src/AST/set.h @@ -12,19 +12,28 @@ #include "structs.h" #include "mymemory.h" -struct Set { +class Set { +public: + Set(VarType t); + Set(VarType t, uint64_t *elements, uint num); + Set(VarType t, uint64_t lowrange, uint64_t highrange); + virtual ~Set(); + bool exists(uint64_t element); + uint getSize(); + VarType getType(){return type;} + uint64_t getNewUniqueItem(){return low++;} + uint64_t getMemberAt(uint index); + uint64_t getElement(uint index); + virtual Set *clone(CSolver *solver, CloneMap *map); + MEMALLOC; +protected: VarType type; bool isRange; uint64_t low;//also used to count unique items uint64_t high; - VectorInt * members; + Vector *members; + }; -Set * allocSet(VarType t, uint64_t * elements, uint num); -Set * allocSetRange(VarType t, uint64_t lowrange, uint64_t highrange); -bool existsInSet(Set * This, uint64_t element); -uint getSetSize(Set * This); -uint64_t getSetElement(Set * This, uint index); -void deleteSet(Set * This); #endif/* SET_H */