X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=nodestack.h;h=6f7807f66f97626cb96b816bd9c7c86fd4d07dbe;hp=0e952417b16c87a484712a94de4953bebc984d96;hb=5e3720f6a6dccf2af670e4ab30660130f2a57c8f;hpb=2ebb0b5a772c0bc5366c41c4980f3fd06f8081ae diff --git a/nodestack.h b/nodestack.h index 0e95241..6f7807f 100644 --- a/nodestack.h +++ b/nodestack.h @@ -13,7 +13,7 @@ class ModelAction; -typedef std::list< const ModelAction *, MyAlloc< const ModelAction * > > readfrom_set_t; +typedef std::vector< const ModelAction *, MyAlloc< const ModelAction * > > readfrom_set_t; /** * @brief A single node in a NodeStack @@ -32,6 +32,7 @@ public: bool has_been_explored(thread_id_t tid); /* return true = backtrack set is empty */ bool backtrack_empty(); + bool readsfrom_empty(); void explore_child(ModelAction *act); /* return false = thread was already in backtrack */ bool set_backtrack(thread_id_t id); @@ -44,8 +45,11 @@ public: Node * get_parent() const { return parent; } void add_read_from(const ModelAction *act); + const ModelAction * get_read_from(); + bool increment_read_from(); void print(); + void print_may_read_from(); MEMALLOC private: @@ -61,6 +65,7 @@ private: /** The set of ModelActions that this the action at this Node may read * from. Only meaningful if this Node represents a 'read' action. */ readfrom_set_t may_read_from; + unsigned int read_from_index; }; typedef std::list< Node *, MyAlloc< Node * > > node_list_t; @@ -81,7 +86,7 @@ public: Node * get_head(); Node * get_next(); void reset_execution(); - + void pop_restofstack(int numAhead); int get_total_nodes() { return total_nodes; } void print();