X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=src%2FAST%2Fmutableset.cc;h=d029f82bbdcdf428ebf5fe1c5f9c1eb342fc8d46;hb=919a30124bede022af832c5e33e42151f7c38533;hp=19552f6cfa01359010cb1fbf77bd6c3ba75258b8;hpb=71b1f3df40acb5b54bbb06c2c55c97af1a62521b;p=satune.git diff --git a/src/AST/mutableset.cc b/src/AST/mutableset.cc index 19552f6..d029f82 100644 --- a/src/AST/mutableset.cc +++ b/src/AST/mutableset.cc @@ -1,15 +1,21 @@ #include "mutableset.h" +#include "csolver.h" -MutableSet *allocMutableSet(VarType t) { - MutableSet *This = (MutableSet *)ourmalloc(sizeof(MutableSet)); - This->type = t; - This->isRange = false; - This->low = 0; - This->high = 0; - This->members = allocDefVectorInt(); - return This; +MutableSet::MutableSet(VarType t) : Set(t) { } -void addElementMSet(MutableSet *set, uint64_t element) { - pushVectorInt(set->members, element); +void MutableSet::addElementMSet(uint64_t element) { + members->push(element); +} + +Set * MutableSet::clone(CSolver * solver, CloneMap *map) { + Set * s=map->set.get(this); + if (s != NULL) + return s; + s=solver->createMutableSet(type); + for(uint i=0; igetSize();i++) { + solver->addItem((MutableSet *) s, members->get(i)); + } + map->set.put(this, s); + return s; }