snapshot: don't put entire if (...) on one line
[model-checker.git] / model.h
diff --git a/model.h b/model.h
index d3b42053fcee011ed32e47df7fef9822aadd144d..0f93920fc83bc5cb29ffc7da618923b8f5a266c9 100644 (file)
--- a/model.h
+++ b/model.h
@@ -1,3 +1,7 @@
+/** @file model.h
+ *  @brief Core model checker. 
+ */
+
 #ifndef __MODEL_H__
 #define __MODEL_H__
 
@@ -16,8 +20,7 @@
 #include "action.h"
 
 /* Forward declaration */
-class TreeNode;
-class Backtrack;
+class NodeStack;
 
 class ModelChecker {
 public:
@@ -35,15 +38,17 @@ public:
 
        int add_thread(Thread *t);
        void remove_thread(Thread *t);
-       Thread * get_thread(thread_id_t tid) { return thread_map[id_to_int(tid)]; }
+       Thread * get_thread(thread_id_t tid) { return (*thread_map)[id_to_int(tid)]; }
 
        thread_id_t get_next_id();
+       int get_num_threads();
        int get_next_seq_num();
 
        int switch_to_master(ModelAction *act);
 
        bool next_execution();
-  MEMALLOC
+
+       MEMALLOC
 private:
        int next_thread_id;
        int used_sequence_numbers;
@@ -51,22 +56,27 @@ private:
 
        ModelAction * get_last_conflict(ModelAction *act);
        void set_backtracking(ModelAction *act);
-       thread_id_t advance_backtracking_state();
        thread_id_t get_next_replay_thread();
-       Backtrack * get_next_backtrack();
+       ModelAction * get_next_backtrack();
        void reset_to_initial_state();
 
+       void add_action_to_lists(ModelAction *act);
+       ModelAction * get_last_action(thread_id_t tid);
+       ModelAction * get_parent_action(thread_id_t tid);
+
        void print_list(action_list_t *list);
 
-       class ModelAction *current_action;
-       Backtrack *exploring;
+       ModelAction *current_action;
+       ModelAction *diverge;
        thread_id_t nextThread;
 
        ucontext_t *system_context;
        action_list_t *action_trace;
-       std::map<int, class Thread *, std::less< int >, MyAlloc< std::pair< const int, class Thread * > > > thread_map;
-       class TreeNode *rootNode, *currentNode;
-       std::list<class Backtrack *, MyAlloc< class Backtrack * > > backtrack_list;
+       std::map<int, class Thread *> *thread_map;
+       std::map<void *, std::vector<action_list_t> > *obj_thrd_map;
+       std::vector<ModelAction *> *thrd_last_action;
+       class NodeStack *node_stack;
+       ModelAction *next_backtrack;
 };
 
 extern ModelChecker *model;