X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=model.cc;h=e0c3089e4ec1558e072cd3577b22caa3d3a546e1;hb=6a2d1dcdcff89e68d8a2fe9de1f38ecfac345caf;hp=48fa28acb71cf1b8d49112df717d2ac460dc2e9b;hpb=f9fe0087091f88deeb814d0768eecdfb1b51a94d;p=model-checker.git diff --git a/model.cc b/model.cc index 48fa28a..e0c3089 100644 --- a/model.cc +++ b/model.cc @@ -16,8 +16,6 @@ #include "execution.h" #include "bugmessage.h" -#define INITIAL_THREAD_ID 0 - ModelChecker *model; /** @brief Constructor */ @@ -26,7 +24,8 @@ ModelChecker::ModelChecker(struct model_params params) : params(params), scheduler(new Scheduler()), node_stack(new NodeStack()), - execution(new ModelExecution(¶ms, scheduler, node_stack)), + execution(new ModelExecution(this, &this->params, scheduler, node_stack)), + execution_number(1), diverge(NULL), earliest_diverge(NULL), trace_analyses() @@ -319,7 +318,8 @@ bool ModelChecker::next_execution() diverge->print(); } - execution->increment_execution_number(); + execution_number++; + reset_to_initial_state(); return true; } @@ -444,7 +444,7 @@ void ModelChecker::run() * thread which just took a step--plus the first step * for any newly-created thread */ - for (unsigned int i = 0; i < execution->get_num_threads(); i++) { + for (unsigned int i = 0; i < get_num_threads(); i++) { thread_id_t tid = int_to_id(i); Thread *thr = get_thread(tid); if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) {