projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
README: add LICENSE note
[model-checker.git]
/
model.cc
diff --git
a/model.cc
b/model.cc
index 8d5bc0fa3bab813c3a68b5fa149ae95b27c51800..90ef906ef6348ed9cdfc6717c1eaab1fb3d9e886 100644
(file)
--- a/
model.cc
+++ b/
model.cc
@@
-1,6
+1,5
@@
#include <stdio.h>
#include <algorithm>
#include <stdio.h>
#include <algorithm>
-#include <mutex>
#include <new>
#include <stdarg.h>
#include <new>
#include <stdarg.h>
@@
-17,8
+16,6
@@
#include "execution.h"
#include "bugmessage.h"
#include "execution.h"
#include "bugmessage.h"
-#define INITIAL_THREAD_ID 0
-
ModelChecker *model;
/** @brief Constructor */
ModelChecker *model;
/** @brief Constructor */
@@
-27,7
+24,8
@@
ModelChecker::ModelChecker(struct model_params params) :
params(params),
scheduler(new Scheduler()),
node_stack(new NodeStack()),
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()
diverge(NULL),
earliest_diverge(NULL),
trace_analyses()
@@
-38,8
+36,6
@@
ModelChecker::ModelChecker(struct model_params params) :
ModelChecker::~ModelChecker()
{
delete node_stack;
ModelChecker::~ModelChecker()
{
delete node_stack;
- for (unsigned int i = 0; i < trace_analyses.size(); i++)
- delete trace_analyses[i];
delete scheduler;
}
delete scheduler;
}
@@
-320,7
+316,8
@@
bool ModelChecker::next_execution()
diverge->print();
}
diverge->print();
}
- execution->increment_execution_number();
+ execution_number++;
+
reset_to_initial_state();
return true;
}
reset_to_initial_state();
return true;
}
@@
-445,7
+442,7
@@
void ModelChecker::run()
* thread which just took a step--plus the first step
* for any newly-created thread
*/
* 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()) {
thread_id_t tid = int_to_id(i);
Thread *thr = get_thread(tid);
if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) {
@@
-486,4
+483,8
@@
void ModelChecker::run()
model_print("******* Model-checking complete: *******\n");
print_stats();
model_print("******* Model-checking complete: *******\n");
print_stats();
+
+ /* Have the trace analyses dump their output. */
+ for (unsigned int i = 0; i < trace_analyses.size(); i++)
+ trace_analyses[i]->finish();
}
}