change test case to match nice one from spec... it works. :)
[model-checker.git] / cyclegraph.h
index a748c7791110f5c37837ff72131bc8901b98e4e5..5cf709324a863d51e4ec45956093600460495232 100644 (file)
@@ -1,3 +1,7 @@
+/** @file cyclegraph.h @brief Data structure to track ordering
+ *  constraints on modification order.  The idea is to see whether a
+ *  total order exists that satisfies the ordering constriants.*/
+
 #ifndef CYCLEGRAPH_H
 #define CYCLEGRAPH_H
 
@@ -12,26 +16,30 @@ class ModelAction;
 class CycleGraph {
  public:
        CycleGraph();
-       void addEdge(ModelAction *from, ModelAction *to);
+       ~CycleGraph();
+       void addEdge(const ModelAction *from, const ModelAction *to);
        bool checkForCycles();
+       void addRMWEdge(const ModelAction *from, const ModelAction *to);
 
  private:
-       CycleNode * getNode(ModelAction *);
-       HashTable<ModelAction *, CycleNode *, uintptr_t, 4> actionToNode;
+       CycleNode * getNode(const ModelAction *);
+       HashTable<const ModelAction *, CycleNode *, uintptr_t, 4> actionToNode;
        bool checkReachable(CycleNode *from, CycleNode *to);
        bool hasCycles;
-
 };
 
 class CycleNode {
  public:
-       CycleNode(ModelAction *action);
+       CycleNode(const ModelAction *action);
        void addEdge(CycleNode * node);
        std::vector<CycleNode *> * getEdges();
+       bool setRMW(CycleNode *);
+       CycleNode* getRMW();
 
  private:
-       ModelAction *action;
+       const ModelAction *action;
        std::vector<CycleNode *> edges;
+       CycleNode * hasRMW;
 };
 
 #endif