tabbing
authorbdemsky <bdemsky@uci.edu>
Sun, 22 Oct 2017 00:21:44 +0000 (17:21 -0700)
committerbdemsky <bdemsky@uci.edu>
Sun, 22 Oct 2017 00:21:44 +0000 (17:21 -0700)
src/ASTAnalyses/Encoding/encodinggraph.cc
src/ASTAnalyses/Order/ordergraph.h
src/ASTTransform/decomposeordertransform.cc
src/Collections/structs.cc
src/Test/constraint.cc
src/Translator/decomposeorderresolver.cc
src/Translator/decomposeorderresolver.h

index f0cd830..5c758c3 100644 (file)
@@ -79,7 +79,7 @@ void EncodingGraph::encode() {
                                        EncodingSubGraph *subgraph = graphMap.get(n);
                                        if (subgraph == NULL)
                                                continue;
-                                       uint encodingSize = subgraph->getEncodingMaxVal(n)+1;
+                                       uint encodingSize = subgraph->getEncodingMaxVal(n) + 1;
                                        uint paddedSize = encoding->getSizeEncodingArray(encodingSize);
                                        encoding->allocInUseArrayElement(paddedSize);
                                        encoding->allocEncodingArrayElement(paddedSize);
index e7e958e..2b2fc59 100644 (file)
@@ -35,7 +35,7 @@ public:
        void computeStronglyConnectedComponentGraph();
        void resetNodeInfoStatusSCC();
        void completePartialOrderGraph();
-       
+
        CMEMALLOC;
 private:
        HashsetOrderNode nodes;
index 4c95db8..1e0426c 100644 (file)
@@ -36,9 +36,9 @@ void DecomposeOrderTransform::doTransform() {
                        continue;
                }
 
-               DecomposeOrderResolver *dor=new DecomposeOrderResolver(order);
+               DecomposeOrderResolver *dor = new DecomposeOrderResolver(order);
                order->setOrderResolver(dor);
-               
+
                OrderGraph *graph = buildOrderGraph(order);
                if (order->type == SATC_PARTIAL) {
                        //Required to do SCC analysis for partial order graphs.  It
@@ -108,7 +108,7 @@ void DecomposeOrderTransform::decomposeOrder(Order *currOrder, OrderGraph *currG
                                        dor->mustOrderEdge(from->getID(), to->getID());
                                        solver->replaceBooleanWithTrue(orderconstraint);
                                } else if (edge->polNeg) {
-                                       if (currOrder->type == SATC_TOTAL)                                      
+                                       if (currOrder->type == SATC_TOTAL)
                                                dor->mustOrderEdge(to->getID(), from->getID());
                                        solver->replaceBooleanWithFalse(orderconstraint);
                                } else {
index 09dc419..2001242 100644 (file)
@@ -64,5 +64,5 @@ unsigned int doredge_hash_function(DOREdge *key) {
 
 bool doredge_equals(DOREdge *key1, DOREdge *key2) {
        return key1->newfirst == key2->newfirst &&
-               key1->newsecond == key2->newsecond;
+                                key1->newsecond == key2->newsecond;
 }
index 60dd586..b270524 100644 (file)
@@ -2,14 +2,14 @@
 
 int main(int numargs, char **argv) {
        CSolver *solver = new CSolver();
-       uint64_t elements[]={0, 1};
-       Set * s = solver->createSet(1, elements, 2);
-       Element * e1=solver->getElementVar(s);
-       Element * e2=solver->getElementVar(s);
-       Set * sarray[]={s, s};
-       Predicate *p=solver->createPredicateOperator(SATC_LT, sarray, 2);
-       Element *earray[]={e1, e2};
-       BooleanEdge be=solver->applyPredicate(p, earray, 2);
+       uint64_t elements[] = {0, 1};
+       Set *s = solver->createSet(1, elements, 2);
+       Element *e1 = solver->getElementVar(s);
+       Element *e2 = solver->getElementVar(s);
+       Set *sarray[] = {s, s};
+       Predicate *p = solver->createPredicateOperator(SATC_LT, sarray, 2);
+       Element *earray[] = {e1, e2};
+       BooleanEdge be = solver->applyPredicate(p, earray, 2);
        solver->addConstraint(be);
 
        if (solver->solve() == 1) {
index c2e9db4..a9c062f 100644 (file)
@@ -11,7 +11,7 @@
 #include "ordernode.h"
 #include "ordergraph.h"
 
-DecomposeOrderResolver::DecomposeOrderResolver(Order * _order) :
+DecomposeOrderResolver::DecomposeOrderResolver(Order *_order) :
        graph(NULL),
        order(_order)
 {
@@ -26,32 +26,32 @@ DecomposeOrderResolver::~DecomposeOrderResolver() {
 void DecomposeOrderResolver::mustOrderEdge(uint64_t first, uint64_t second) {
        DOREdge edge(first, second, 0, first, second);
        if (!edges.contains(&edge)) {
-               DOREdge *newedge=new DOREdge(first, second, 0, first, second);
+               DOREdge *newedge = new DOREdge(first, second, 0, first, second);
                edges.add(newedge);
        }
 }
 
 void DecomposeOrderResolver::remapEdge(uint64_t first, uint64_t second, uint64_t newfirst, uint64_t newsecond) {
        DOREdge edge(first, second, 0, first, second);
-       DOREdge *oldedge=edges.get(&edge);
+       DOREdge *oldedge = edges.get(&edge);
        if (oldedge != NULL) {
                edges.remove(oldedge);
-               oldedge->newfirst=newfirst;
-               oldedge->newsecond=newsecond;
+               oldedge->newfirst = newfirst;
+               oldedge->newsecond = newsecond;
                edges.add(oldedge);
        } else {
-               DOREdge *newedge=new DOREdge(first, second, 0, newfirst, newsecond);
+               DOREdge *newedge = new DOREdge(first, second, 0, newfirst, newsecond);
                edges.add(newedge);
        }
 }
 
 void DecomposeOrderResolver::setEdgeOrder(uint64_t first, uint64_t second, uint sccNum) {
        DOREdge edge(first, second, 0, first, second);
-       DOREdge *oldedge=edges.get(&edge);
+       DOREdge *oldedge = edges.get(&edge);
        if (oldedge != NULL) {
-               oldedge->orderindex=sccNum;
+               oldedge->orderindex = sccNum;
        } else {
-               DOREdge *newedge=new DOREdge(first, second, sccNum, first, second);
+               DOREdge *newedge = new DOREdge(first, second, sccNum, first, second);
                edges.add(newedge);
        }
 }
@@ -60,7 +60,7 @@ void DecomposeOrderResolver::setOrder(uint sccNum, Order *neworder) {
        orders.setExpand(sccNum, neworder);
 }
 
-Order * DecomposeOrderResolver::getOrder(uint sccNum) {
+Order *DecomposeOrderResolver::getOrder(uint sccNum) {
        Order *neworder = NULL;
        if (orders.getSize() > sccNum)
                neworder = orders.get(sccNum);
@@ -70,12 +70,12 @@ Order * DecomposeOrderResolver::getOrder(uint sccNum) {
 void DecomposeOrderResolver::buildGraph() {
        graph = new OrderGraph(order);
        SetIteratorDOREdge *iterator = edges.iterator();
-       while(iterator->hasNext()) {
-               DOREdge * doredge = iterator->next();
+       while (iterator->hasNext()) {
+               DOREdge *doredge = iterator->next();
                if (doredge->orderindex == 0) {
                        graph->addEdge(doredge->origfirst, doredge->origsecond);
                } else {
-                       Order * suborder = orders.get(doredge->orderindex);
+                       Order *suborder = orders.get(doredge->orderindex);
                        bool isEdge = suborder->encoding.resolver->resolveOrder(doredge->newfirst, doredge->newsecond);
                        if (isEdge)
                                graph->addEdge(doredge->origfirst, doredge->origsecond);
index a6bf955..a260309 100644 (file)
 #include "orderresolver.h"
 
 class DOREdge {
- public:
- DOREdge(uint64_t _origfirst, uint64_t _origsecond, uint _orderindex, uint64_t _newfirst, uint64_t _newsecond) :
-         origfirst(_origfirst),
+public:
      DOREdge(uint64_t _origfirst, uint64_t _origsecond, uint _orderindex, uint64_t _newfirst, uint64_t _newsecond) :
+               origfirst(_origfirst),
                origsecond(_origsecond),
                orderindex(_orderindex),
                newfirst(_newfirst),
                newsecond(_newsecond) {
-       }               
+       }
        uint64_t origfirst;
        uint64_t origsecond;
        uint orderindex;
@@ -39,10 +39,10 @@ public:
        void remapEdge(uint64_t oldfirst, uint64_t oldsecond, uint64_t newfirst, uint64_t newsecond);
        void setEdgeOrder(uint64_t first, uint64_t second, uint sccNum);
        void setOrder(uint sccNum, Order *order);
-       Order * getOrder(uint sccNum);
+       Order *getOrder(uint sccNum);
        CMEMALLOC;
-       
- private:
+
+private:
        bool resolvePartialOrder(OrderNode *first, OrderNode *second);
        void buildGraph();
        OrderGraph *graph;