X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2FAST%2Fset.h;h=ca8533153f18cba94c3a4541fa030dbf4a8fdabc;hb=2f983851a140ba2b1c6732ff721c7871d18902e8;hp=16fde20057370fc70cf9f4e5e265bb83f474971c;hpb=4221735881b9d1cd53ef410d9448efd2d12a51ad;p=satune.git diff --git a/src/AST/set.h b/src/AST/set.h index 16fde20..ca85331 100644 --- a/src/AST/set.h +++ b/src/AST/set.h @@ -12,19 +12,32 @@ #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 getElement(uint index); + uint getUnionSize(Set *s); + virtual bool isMutableSet() {return false;} + virtual Set *clone(CSolver *solver, CloneMap *map); + virtual void serialize(Serializer *serializer); + virtual void print(); + CMEMALLOC; +protected: VarType type; bool isRange; - uint64_t low;//also used to count unique items + uint64_t low; //also used to count unique items uint64_t high; - VectorInt *members; + Vector *members; + friend class ElementOpt; }; -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); +int intcompare(const void *p1, const void *p2); #endif/* SET_H */