X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=cyclegraph.h;h=5cf709324a863d51e4ec45956093600460495232;hp=a748c7791110f5c37837ff72131bc8901b98e4e5;hb=c7affe0434c47a25fb4b571136aea6089ac75592;hpb=9209688c955f7924af15da0c79c70948eb481b8c diff --git a/cyclegraph.h b/cyclegraph.h index a748c77..5cf7093 100644 --- a/cyclegraph.h +++ b/cyclegraph.h @@ -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 actionToNode; + CycleNode * getNode(const ModelAction *); + HashTable 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 * getEdges(); + bool setRMW(CycleNode *); + CycleNode* getRMW(); private: - ModelAction *action; + const ModelAction *action; std::vector edges; + CycleNode * hasRMW; }; #endif