#include "clockvector.h"
#include "cyclegraph.h"
#include "promise.h"
++#include "datarace.h"
#define INITIAL_THREAD_ID 0
node_stack(new NodeStack()),
next_backtrack(NULL),
mo_graph(new CycleGraph()),
-- failed_promise(false)
++ failed_promise(false),
++ asserted(false)
{
}
nextThread = NULL;
next_backtrack = NULL;
failed_promise = false;
++ reset_asserted();
snapshotObject->backTrackBeforeStep(0);
}
}
} else if (curr->is_write()) {
if (w_modification_order(curr))
-- updated = true;;
++ updated = true;
if (resolve_promises(curr))
updated = true;
}
return get_next_replay_thread();
}
+/** @returns whether the current partial trace must be a prefix of a
+ * feasible trace. */
+
+bool ModelChecker::isfeasibleprefix() {
++ return promises->size()==0;
+}
+
/** @returns whether the current partial trace is feasible. */
bool ModelChecker::isfeasible() {
return !mo_graph->checkForCycles() && !failed_promise;
it++;
}
++ // If we resolved promises or data races, see if we have realized a data race.
++ if (checkDataRaces()) {
++ model->set_assert();
++ }
++
return updated;
}
} else
promise_index++;
}
++
return resolved;
}
bool ModelChecker::take_step() {
Thread *curr, *next;
++ if (has_asserted())
++ return false;
++
curr = thread_current();
if (curr) {
if (curr->get_state() == THREAD_READY) {