making the qsort deterministic for BooleanEdge
authorHamed Gorjiara <hgorjiar@uci.edu>
Tue, 8 May 2018 18:00:33 +0000 (11:00 -0700)
committerHamed Gorjiara <hgorjiar@uci.edu>
Tue, 8 May 2018 18:00:33 +0000 (11:00 -0700)
src/AST/boolean.cc
src/AST/boolean.h

index c576268058f3b5203687a2d6cef9e496a90bcf2e..647f548d352f21e5a98c149ce519b427941099bc 100644 (file)
@@ -5,11 +5,13 @@
 #include "order.h"
 #include "predicate.h"
 
 #include "order.h"
 #include "predicate.h"
 
+uint64_t Boolean::counter = 0;
+
 Boolean::Boolean(ASTNodeType _type) :
        ASTNode(_type),
        polarity(P_UNDEFINED),
        boolVal(BV_UNDEFINED),
 Boolean::Boolean(ASTNodeType _type) :
        ASTNode(_type),
        polarity(P_UNDEFINED),
        boolVal(BV_UNDEFINED),
-       parents() {
+       parents(), id(counter++) {
 }
 
 BooleanConst::BooleanConst(bool _isTrue) :
 }
 
 BooleanConst::BooleanConst(bool _isTrue) :
index 207b327bf693182d4d06a7ded3b4849aa913b367..1f218b2cd855fde36aeab02738bfd917cda6dd46 100644 (file)
@@ -11,6 +11,8 @@
 #include "serializer.h"
 
 class Boolean : public ASTNode {
 #include "serializer.h"
 
 class Boolean : public ASTNode {
+private:
+    static uint64_t counter;
 public:
        Boolean(ASTNodeType _type);
        virtual ~Boolean() {}
 public:
        Boolean(ASTNodeType _type);
        virtual ~Boolean() {}
@@ -23,7 +25,7 @@ public:
        BooleanValue boolVal;
        Vector<Boolean *> parents;
        virtual void updateParents() {}
        BooleanValue boolVal;
        Vector<Boolean *> parents;
        virtual void updateParents() {}
-       
+        uint64_t id;
        CMEMALLOC;
 };
 
        CMEMALLOC;
 };