Renaming
authorbdemsky <bdemsky@uci.edu>
Wed, 30 Aug 2017 23:39:18 +0000 (16:39 -0700)
committerbdemsky <bdemsky@uci.edu>
Wed, 30 Aug 2017 23:39:18 +0000 (16:39 -0700)
15 files changed:
src/AST/table.cc
src/ASTAnalyses/orderanalysis.cc
src/ASTAnalyses/ordergraph.cc
src/ASTAnalyses/ordergraph.h
src/ASTAnalyses/polarityassignment.cc
src/Backend/satencoder.cc
src/Backend/satfunctableencoder.cc
src/Collections/corestructs.h
src/Collections/hashset.h
src/Collections/structs.h
src/Encoders/naiveencoder.cc
src/Tuner/searchtuner.cc
src/Tuner/searchtuner.h
src/csolver.cc
src/csolver.h

index c4e9594..4d0716e 100644 (file)
@@ -39,7 +39,7 @@ Table *Table::clone(CSolver *solver, CloneMap *map) {
        }
        Set *rcopy = range != NULL ? range->clone(solver, map) : NULL;
        t = solver->createTable(array, domains.getSize(), rcopy);
-       HSIteratorTableEntry *entryit = entries->iterator();
+       SetIteratorTableEntry *entryit = entries->iterator();
        while (entryit->hasNext()) {
                TableEntry *te = entryit->next();
                solver->addTableEntry(t, &te->inputs[0], te->inputSize, te->output);
@@ -50,7 +50,7 @@ Table *Table::clone(CSolver *solver, CloneMap *map) {
 }
 
 Table::~Table() {
-       HSIteratorTableEntry *iterator = entries->iterator();
+       SetIteratorTableEntry *iterator = entries->iterator();
        while (iterator->hasNext()) {
                deleteTableEntry(iterator->next());
        }
index 6010375..56544f4 100644 (file)
@@ -10,7 +10,7 @@
 #include "tunable.h"
 
 void DFS(OrderGraph *graph, Vector<OrderNode *> *finishNodes) {
-       HSIteratorOrderNode *iterator = graph->getNodes();
+       SetIteratorOrderNode *iterator = graph->getNodes();
        while (iterator->hasNext()) {
                OrderNode *node = iterator->next();
                if (node->status == NOTVISITED) {
@@ -39,7 +39,7 @@ void DFSReverse(OrderGraph *graph, Vector<OrderNode *> *finishNodes) {
 }
 
 void DFSNodeVisit(OrderNode *node, Vector<OrderNode *> *finishNodes, bool isReverse, bool mustvisit, uint sccNum) {
-       HSIteratorOrderEdge *iterator = isReverse ? node->inEdges.iterator() : node->outEdges.iterator();
+       SetIteratorOrderEdge *iterator = isReverse ? node->inEdges.iterator() : node->outEdges.iterator();
        while (iterator->hasNext()) {
                OrderEdge *edge = iterator->next();
                if (mustvisit) {
@@ -65,7 +65,7 @@ void DFSNodeVisit(OrderNode *node, Vector<OrderNode *> *finishNodes, bool isReve
 }
 
 void resetNodeInfoStatusSCC(OrderGraph *graph) {
-       HSIteratorOrderNode *iterator = graph->getNodes();
+       SetIteratorOrderNode *iterator = graph->getNodes();
        while (iterator->hasNext()) {
                iterator->next()->status = NOTVISITED;
        }
@@ -81,7 +81,7 @@ void computeStronglyConnectedComponentGraph(OrderGraph *graph) {
 }
 
 bool isMustBeTrueNode(OrderNode *node) {
-       HSIteratorOrderEdge *iterator = node->inEdges.iterator();
+       SetIteratorOrderEdge *iterator = node->inEdges.iterator();
        while (iterator->hasNext()) {
                OrderEdge *edge = iterator->next();
                if (!edge->mustPos) {
@@ -103,12 +103,12 @@ bool isMustBeTrueNode(OrderNode *node) {
 }
 
 void bypassMustBeTrueNode(CSolver *This, OrderGraph *graph, OrderNode *node) {
-       HSIteratorOrderEdge *iterin = node->inEdges.iterator();
+       SetIteratorOrderEdge *iterin = node->inEdges.iterator();
        while (iterin->hasNext()) {
                OrderEdge *inEdge = iterin->next();
                OrderNode *srcNode = inEdge->source;
                srcNode->outEdges.remove(inEdge);
-               HSIteratorOrderEdge *iterout = node->outEdges.iterator();
+               SetIteratorOrderEdge *iterout = node->outEdges.iterator();
                while (iterout->hasNext()) {
                        OrderEdge *outEdge = iterout->next();
                        OrderNode *sinkNode = outEdge->sink;
@@ -128,7 +128,7 @@ void bypassMustBeTrueNode(CSolver *This, OrderGraph *graph, OrderNode *node) {
 }
 
 void removeMustBeTrueNodes(CSolver *This, OrderGraph *graph) {
-       HSIteratorOrderNode *iterator = graph->getNodes();
+       SetIteratorOrderNode *iterator = graph->getNodes();
        while (iterator->hasNext()) {
                OrderNode *node = iterator->next();
                if (isMustBeTrueNode(node)) {
@@ -172,7 +172,7 @@ void completePartialOrderGraph(OrderGraph *graph) {
                        for (uint j = 0; j < rSize; j++) {
                                OrderNode *rnode = sccNodes.get(j);
                                //Compute source sets
-                               HSIteratorOrderEdge *iterator = rnode->inEdges.iterator();
+                               SetIteratorOrderEdge *iterator = rnode->inEdges.iterator();
                                while (iterator->hasNext()) {
                                        OrderEdge *edge = iterator->next();
                                        OrderNode *parent = edge->source;
@@ -191,7 +191,7 @@ void completePartialOrderGraph(OrderGraph *graph) {
                                table->put(rnode, set);
 
                                //Use source sets to compute pseudoPos edges
-                               HSIteratorOrderEdge *iterator = node->inEdges.iterator();
+                               SetIteratorOrderEdge *iterator = node->inEdges.iterator();
                                while (iterator->hasNext()) {
                                        OrderEdge *edge = iterator->next();
                                        OrderNode *parent = edge->source;
@@ -215,7 +215,7 @@ void completePartialOrderGraph(OrderGraph *graph) {
 }
 
 void DFSMust(OrderGraph *graph, Vector<OrderNode *> *finishNodes) {
-       HSIteratorOrderNode *iterator = graph->getNodes();
+       SetIteratorOrderNode *iterator = graph->getNodes();
        while (iterator->hasNext()) {
                OrderNode *node = iterator->next();
                if (node->status == NOTVISITED) {
@@ -239,7 +239,7 @@ void DFSClearContradictions(CSolver *solver, OrderGraph *graph, Vector<OrderNode
 
                {
                        //Compute source sets
-                       HSIteratorOrderEdge *iterator = node->inEdges.iterator();
+                       SetIteratorOrderEdge *iterator = node->inEdges.iterator();
                        while (iterator->hasNext()) {
                                OrderEdge *edge = iterator->next();
                                OrderNode *parent = edge->source;
@@ -253,7 +253,7 @@ void DFSClearContradictions(CSolver *solver, OrderGraph *graph, Vector<OrderNode
                }
                if (computeTransitiveClosure) {
                        //Compute full transitive closure for nodes
-                       HSIteratorOrderNode *srciterator = sources->iterator();
+                       SetIteratorOrderNode *srciterator = sources->iterator();
                        while (srciterator->hasNext()) {
                                OrderNode *srcnode = srciterator->next();
                                OrderEdge *newedge = graph->getOrderEdgeFromOrderGraph(srcnode, node);
@@ -268,7 +268,7 @@ void DFSClearContradictions(CSolver *solver, OrderGraph *graph, Vector<OrderNode
                }
                {
                        //Use source sets to compute mustPos edges
-                       HSIteratorOrderEdge *iterator = node->inEdges.iterator();
+                       SetIteratorOrderEdge *iterator = node->inEdges.iterator();
                        while (iterator->hasNext()) {
                                OrderEdge *edge = iterator->next();
                                OrderNode *parent = edge->source;
@@ -283,7 +283,7 @@ void DFSClearContradictions(CSolver *solver, OrderGraph *graph, Vector<OrderNode
                }
                {
                        //Use source sets to compute mustNeg for edges that would introduce cycle if true
-                       HSIteratorOrderEdge *iterator = node->outEdges.iterator();
+                       SetIteratorOrderEdge *iterator = node->outEdges.iterator();
                        while (iterator->hasNext()) {
                                OrderEdge *edge = iterator->next();
                                OrderNode *child = edge->sink;
@@ -322,7 +322,7 @@ void reachMustAnalysis(CSolver *solver, OrderGraph *graph, bool computeTransitiv
    had one). */
 
 void localMustAnalysisTotal(CSolver *solver, OrderGraph *graph) {
-       HSIteratorOrderEdge *iterator = graph->getEdges();
+       SetIteratorOrderEdge *iterator = graph->getEdges();
        while (iterator->hasNext()) {
                OrderEdge *edge = iterator->next();
                if (edge->mustPos) {
@@ -347,7 +347,7 @@ void localMustAnalysisTotal(CSolver *solver, OrderGraph *graph) {
     polarity. */
 
 void localMustAnalysisPartial(CSolver *solver, OrderGraph *graph) {
-       HSIteratorOrderEdge *iterator = graph->getEdges();
+       SetIteratorOrderEdge *iterator = graph->getEdges();
        while (iterator->hasNext()) {
                OrderEdge *edge = iterator->next();
                if (edge->mustPos) {
index 9f53d11..c0df7a5 100644 (file)
@@ -159,14 +159,14 @@ void OrderGraph::addMustOrderConstraintToOrderGraph(BooleanOrder *bOrder) {
 }
 
 OrderGraph::~OrderGraph() {
-       HSIteratorOrderNode *iterator = nodes->iterator();
+       SetIteratorOrderNode *iterator = nodes->iterator();
        while (iterator->hasNext()) {
                OrderNode *node = iterator->next();
                delete node;
        }
        delete iterator;
 
-       HSIteratorOrderEdge *eiterator = edges->iterator();
+       SetIteratorOrderEdge *eiterator = edges->iterator();
        while (eiterator->hasNext()) {
                OrderEdge *edge = eiterator->next();
                delete edge;
index f80ec98..d28c4b6 100644 (file)
@@ -25,8 +25,8 @@ public:
        void addMustOrderEdge(OrderNode *node1, OrderNode *node2, BooleanOrder *constr);
        OrderEdge *getInverseOrderEdge(OrderEdge *edge);
        Order *getOrder() {return order;}
-       HSIteratorOrderNode *getNodes() {return nodes->iterator();}
-       HSIteratorOrderEdge *getEdges() {return edges->iterator();}
+       SetIteratorOrderNode *getNodes() {return nodes->iterator();}
+       SetIteratorOrderEdge *getEdges() {return edges->iterator();}
 
        CMEMALLOC;
 private:
index f0dac37..38f32ae 100644 (file)
@@ -2,7 +2,7 @@
 #include "csolver.h"
 
 void computePolarities(CSolver *This) {
-       HSIteratorBoolean *iterator = This->getConstraints();
+       SetIteratorBoolean *iterator = This->getConstraints();
        while (iterator->hasNext()) {
                Boolean *boolean = iterator->next();
                updatePolarity(boolean, P_TRUE);
index dcd70bc..e053d78 100644 (file)
@@ -26,7 +26,7 @@ int SATEncoder::solve() {
 }
 
 void SATEncoder::encodeAllSATEncoder(CSolver *csolver) {
-       HSIteratorBoolean *iterator = csolver->getConstraints();
+       SetIteratorBoolean *iterator = csolver->getConstraints();
        while (iterator->hasNext()) {
                Boolean *constraint = iterator->next();
                Edge c = encodeConstraintSATEncoder(constraint);
index 15094ee..0ec498a 100644 (file)
@@ -24,7 +24,7 @@ Edge SATEncoder::encodeEnumEntriesTablePredicateSATEncoder(BooleanPredicate *con
        Edge undefConst = encodeConstraintSATEncoder(constraint->undefStatus);
        printCNF(undefConst);
        model_print("**\n");
-       HSIteratorTableEntry *iterator = table->entries->iterator();
+       SetIteratorTableEntry *iterator = table->entries->iterator();
        uint i = 0;
        while (iterator->hasNext()) {
                TableEntry *entry = iterator->next();
@@ -183,7 +183,7 @@ void SATEncoder::encodeEnumEntriesTableElemFuncSATEncoder(ElementFunction *func)
        Table *table = ((FunctionTable *) (func->function))->table;
        uint size = table->entries->getSize();
        Edge constraints[size];
-       HSIteratorTableEntry *iterator = table->entries->iterator();
+       SetIteratorTableEntry *iterator = table->entries->iterator();
        uint i = 0;
        while (iterator->hasNext()) {
                TableEntry *entry = iterator->next();
index 867feb7..48447af 100644 (file)
@@ -5,6 +5,6 @@
 #include "hashset.h"
 
 typedef HashSet<Boolean *, uintptr_t, 4> HashSetBoolean;
-typedef HSIterator<Boolean *, uintptr_t, 4> HSIteratorBoolean;
+typedef SetIterator<Boolean *, uintptr_t, 4> SetIteratorBoolean;
 
 #endif
index c86217c..fa3f327 100644 (file)
@@ -22,9 +22,9 @@ template<typename _Key, typename _KeyInt, int _Shift, unsigned int (*hash_functi
 class HashSet;
 
 template<typename _Key, typename _KeyInt, int _Shift, unsigned int (*hash_function)(_Key) = default_hash_function<_Key, _Shift, _KeyInt>, bool (*equals)(_Key, _Key) = default_equals<_Key> >
-class HSIterator {
+class SetIterator {
 public:
-       HSIterator(LinkNode<_Key> *_curr, HashSet <_Key, _KeyInt, _Shift, hash_function, equals> *_set) :
+       SetIterator(LinkNode<_Key> *_curr, HashSet <_Key, _KeyInt, _Shift, hash_function, equals> *_set) :
                curr(_curr),
                set(_set)
        {
@@ -99,7 +99,7 @@ public:
 
        HashSet<_Key, _KeyInt, _Shift, hash_function, equals> *copy() {
                HashSet<_Key, _KeyInt, _Shift, hash_function, equals> *copy = new HashSet<_Key, _KeyInt, _Shift, hash_function, equals>(table->getCapacity(), table->getLoadFactor());
-               HSIterator<_Key, _KeyInt, _Shift, hash_function, equals> *it = iterator();
+               SetIterator<_Key, _KeyInt, _Shift, hash_function, equals> *it = iterator();
                while (it->hasNext())
                        copy->add(it->next());
                delete it;
@@ -121,7 +121,7 @@ public:
         *  is already present. */
 
        void addAll(HashSet<_Key, _KeyInt, _Shift, hash_function, equals> *table) {
-               HSIterator<_Key, _KeyInt, _Shift, hash_function, equals> *it = iterator();
+               SetIterator<_Key, _KeyInt, _Shift, hash_function, equals> *it = iterator();
                while (it->hasNext())
                        add(it->next());
                delete it;
@@ -213,8 +213,8 @@ public:
                return getSize() == 0;
        }
 
-       HSIterator<_Key, _KeyInt, _Shift, hash_function, equals> *iterator() {
-               return new HSIterator<_Key, _KeyInt, _Shift, hash_function, equals>(list, this);
+       SetIterator<_Key, _KeyInt, _Shift, hash_function, equals> *iterator() {
+               return new SetIterator<_Key, _KeyInt, _Shift, hash_function, equals>(list, this);
        }
 
        /** Override: new operator */
index 30fc93b..88cd42a 100644 (file)
@@ -29,9 +29,9 @@ typedef HashTable<OrderPair *, OrderPair *, uintptr_t, 4, order_pair_hash_functi
 typedef HashTable<void *, void *, uintptr_t, 4> CloneMap;
 typedef HashTable<Order* , IntegerEncodingRecord*, uintptr_t, 4> HashTableOrderIntegerEncoding; 
 
-typedef HSIterator<TableEntry *, uintptr_t, 4, table_entry_hash_function, table_entry_equals> HSIteratorTableEntry;
-typedef HSIterator<OrderEdge *, uintptr_t, 4, order_edge_hash_function, order_edge_equals> HSIteratorOrderEdge;
-typedef HSIterator<OrderNode *, uintptr_t, 4, order_node_hash_function, order_node_equals> HSIteratorOrderNode;
+typedef SetIterator<TableEntry *, uintptr_t, 4, table_entry_hash_function, table_entry_equals> SetIteratorTableEntry;
+typedef SetIterator<OrderEdge *, uintptr_t, 4, order_edge_hash_function, order_edge_equals> SetIteratorOrderEdge;
+typedef SetIterator<OrderNode *, uintptr_t, 4, order_node_hash_function, order_node_equals> SetIteratorOrderNode;
 
 
 #endif
index ef677ad..9b4487e 100644 (file)
@@ -14,7 +14,7 @@
 #include <strings.h>
 
 void naiveEncodingDecision(CSolver *This) {
-       HSIteratorBoolean *iterator = This->getConstraints();
+       SetIteratorBoolean *iterator = This->getConstraints();
        while (iterator->hasNext()) {
                Boolean *boolean = iterator->next();
                naiveEncodingConstraint(boolean);
index 0459206..c3c1af7 100644 (file)
@@ -52,7 +52,7 @@ SearchTuner::SearchTuner() {
 
 SearchTuner * SearchTuner::copyUsed() {
        SearchTuner * tuner = new SearchTuner();
-       HSIteratorTunableSetting *iterator=usedSettings.iterator();
+       SetIteratorTunableSetting *iterator=usedSettings.iterator();
        while(iterator->hasNext()) {
                TunableSetting *setting=iterator->next();
                TunableSetting *copy=new TunableSetting(setting);
@@ -63,7 +63,7 @@ SearchTuner * SearchTuner::copyUsed() {
 }
 
 SearchTuner::~SearchTuner() {
-       HSIteratorTunableSetting *iterator=settings.iterator();
+       SetIteratorTunableSetting *iterator=settings.iterator();
        while(iterator->hasNext()) {
                TunableSetting *setting=iterator->next();
                delete setting;
@@ -114,7 +114,7 @@ void SearchTuner::randomMutate() {
 }
 
 void SearchTuner::print() {
-       HSIteratorTunableSetting *iterator=settings.iterator();
+       SetIteratorTunableSetting *iterator=settings.iterator();
        while(iterator->hasNext()) {
                TunableSetting *setting=iterator->next();
                setting->print();
@@ -124,7 +124,7 @@ void SearchTuner::print() {
 }
 
 void SearchTuner::printUsed() {
-       HSIteratorTunableSetting *iterator=usedSettings.iterator();
+       SetIteratorTunableSetting *iterator=usedSettings.iterator();
        while(iterator->hasNext()) {
                TunableSetting *setting=iterator->next();
                setting->print();
index 3470aa8..b410d01 100644 (file)
@@ -29,7 +29,7 @@ unsigned int tunableSettingHash(TunableSetting *setting);
 bool tunableSettingEquals(TunableSetting *setting1, TunableSetting *setting2);
 
 typedef HashSet<TunableSetting *, uintptr_t, 4, tunableSettingHash, tunableSettingEquals> HashSetTunableSetting;
-typedef HSIterator<TunableSetting *, uintptr_t, 4, tunableSettingHash, tunableSettingEquals> HSIteratorTunableSetting;
+typedef SetIterator<TunableSetting *, uintptr_t, 4, tunableSettingHash, tunableSettingEquals> SetIteratorTunableSetting;
 
 class SearchTuner : public Tuner {
  public:
index bcde64e..5ee5157 100644 (file)
@@ -72,7 +72,7 @@ CSolver::~CSolver() {
 CSolver *CSolver::clone() {
        CSolver *copy = new CSolver();
        CloneMap map;
-       HSIteratorBoolean *it = getConstraints();
+       SetIteratorBoolean *it = getConstraints();
        while (it->hasNext()) {
                Boolean *b = it->next();
                copy->addConstraint(b->clone(copy, &map));
index 0f49dcd..a37434c 100644 (file)
@@ -114,7 +114,7 @@ public:
 
        Tuner *getTuner() { return tuner; }
        
-       HSIteratorBoolean *getConstraints() { return constraints.iterator(); }
+       SetIteratorBoolean *getConstraints() { return constraints.iterator(); }
 
        SATEncoder *getSATEncoder() {return satEncoder;}