run.sh: pass command-line arguments through to test program
[model-checker.git] / cyclegraph.h
index 818a3e88f3afca519cbff27e8d4310f485e130ff..5cf709324a863d51e4ec45956093600460495232 100644 (file)
@@ -1,38 +1,45 @@
+/** @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
 
 #include "hashtable.h"
-#include "action.h"
 #include <vector>
 #include <inttypes.h>
 
 class CycleNode;
+class ModelAction;
 
 /** @brief A graph of Model Actions for tracking cycles. */
 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<class ModelAction *, class 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<class CycleNode *> * getEdges();
+       std::vector<CycleNode *> * getEdges();
+       bool setRMW(CycleNode *);
+       CycleNode* getRMW();
 
  private:
-       ModelAction *action;
-       std::vector<class CycleNode *> edges;
+       const ModelAction *action;
+       std::vector<CycleNode *> edges;
+       CycleNode * hasRMW;
 };
 
 #endif