2 * @brief Stack of operations for use in backtracking.
5 #ifndef __NODESTACK_H__
6 #define __NODESTACK_H__
13 #include "stl-model.h"
14 #include "classlist.h"
17 * @brief A single node in a NodeStack
19 * Represents a single node in the NodeStack. Each Node is associated with up
20 * to one action and up to one parent node. A node holds information
21 * regarding the last action performed (the "associated action"), the thread
22 * choices that have been explored (explored_children) and should be explored
23 * (backtrack), and the actions that the last action may read from.
27 Node(ModelAction *act);
30 ModelAction * get_action() const { return action; }
31 void set_uninit_action(ModelAction *act) { uninit_action = act; }
32 ModelAction * get_uninit_action() const { return uninit_action; }
37 ModelAction * const action;
39 /** @brief ATOMIC_UNINIT action which was created at this Node */
40 ModelAction *uninit_action;
43 typedef ModelVector<Node *> node_list_t;
46 * @brief A stack of nodes
48 * Holds a Node linked-list that can be used for holding backtracking,
49 * may-read-from, and replay information. It is used primarily as a
50 * stack-like structure, in that backtracking points and replay nodes are
51 * only removed from the top (most recent).
58 void register_engine(const ModelExecution *exec);
59 ModelAction * explore_action(ModelAction *act);
60 Node * get_head() const;
61 Node * get_next() const;
62 void reset_execution();
68 node_list_t node_list;
69 const struct model_params * get_params() const;
71 /** @brief The model-checker execution object */
72 const ModelExecution *execution;
75 * @brief the index position of the current head Node
77 * This index is relative to node_list. The index should point to the
78 * current head Node. It is negative when the list is empty.
83 #endif /* __NODESTACK_H__ */