#include "src/mc/Transition.hpp"
#include "src/mc/VisitedState.hpp"
#include "src/mc/checker/SafetyChecker.hpp"
#include "src/mc/Transition.hpp"
#include "src/mc/VisitedState.hpp"
#include "src/mc/checker/SafetyChecker.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/mc_record.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
#include "src/mc/mc_record.hpp"
{
simgrid::mc::Snapshot* s1 = state1->system_state.get();
simgrid::mc::Snapshot* s2 = state2->system_state.get();
{
simgrid::mc::Snapshot* s1 = state1->system_state.get();
simgrid::mc::Snapshot* s2 = state2->system_state.get();
- int num1 = state1->num;
- int num2 = state2->num;
- return snapshot_compare(num1, s1, num2, s2);
+ return snapshot_compare(s1, s2);
{
for (auto state = stack_.rbegin(); state != stack_.rend(); ++state)
if (snapshot_compare(state->get(), current_state) == 0) {
{
for (auto state = stack_.rbegin(); state != stack_.rend(); ++state)
if (snapshot_compare(state->get(), current_state) == 0) {
XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
XBT_INFO("******************************************");
XBT_INFO("Counter-example execution trace:");
XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
XBT_INFO("******************************************");
XBT_INFO("Counter-example execution trace:");
XBT_INFO(" %s", s.c_str());
simgrid::mc::dumpRecordPath();
XBT_INFO(" %s", s.c_str());
simgrid::mc::dumpRecordPath();
XBT_INFO("Visited states = %lu", mc_model_checker->visited_states);
XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
}
XBT_INFO("Visited states = %lu", mc_model_checker->visited_states);
XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
}
mc_model_checker->executed_transitions++;
/* Actually answer the request: let execute the selected request (MCed does one step) */
mc_model_checker->executed_transitions++;
/* Actually answer the request: let execute the selected request (MCed does one step) */
/* Create the new expanded state (copy the state of MCed into our MCer data) */
std::unique_ptr<simgrid::mc::State> next_state =
/* Create the new expanded state (copy the state of MCed into our MCer data) */
std::unique_ptr<simgrid::mc::State> next_state =
/* Check whether we already explored next_state in the past (but only if interested in state-equality reduction) */
if (_sg_mc_max_visited_states > 0)
/* Check whether we already explored next_state in the past (but only if interested in state-equality reduction) */
if (_sg_mc_max_visited_states > 0)
/* Get an enabled process and insert it in the interleave set of the next state */
for (auto& remoteActor : mc_model_checker->process().actors()) {
/* Get an enabled process and insert it in the interleave set of the next state */
for (auto& remoteActor : mc_model_checker->process().actors()) {
if (simgrid::mc::actor_is_enabled(actor)) {
next_state->addInterleavingSet(actor);
if (reductionMode_ == simgrid::mc::ReductionMode::dpor)
if (simgrid::mc::actor_is_enabled(actor)) {
next_state->addInterleavingSet(actor);
if (reductionMode_ == simgrid::mc::ReductionMode::dpor)
} else if (dot_output != nullptr)
std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num,
} else if (dot_output != nullptr)
std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num,
/* We found a back-tracking point, let's loop */
XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
stack_.push_back(std::move(state));
/* We found a back-tracking point, let's loop */
XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
stack_.push_back(std::move(state));
{
/* Intermediate backtracking */
simgrid::mc::State* last_state = stack_.back().get();
if (last_state->system_state) {
{
/* Intermediate backtracking */
simgrid::mc::State* last_state = stack_.back().get();
if (last_state->system_state) {
/* Traverse the stack from the state at position start and re-execute the transitions */
for (std::unique_ptr<simgrid::mc::State> const& state : stack_) {
/* Traverse the stack from the state at position start and re-execute the transitions */
for (std::unique_ptr<simgrid::mc::State> const& state : stack_) {
XBT_DEBUG("**************************************************");
XBT_DEBUG("Initial state");
/* Get an enabled actor and insert it in the interleave set of the initial state */
for (auto& actor : mc_model_checker->process().actors())
XBT_DEBUG("**************************************************");
XBT_DEBUG("Initial state");
/* Get an enabled actor and insert it in the interleave set of the initial state */
for (auto& actor : mc_model_checker->process().actors())
- if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer())) {
- initial_state->addInterleavingSet(actor.copy.getBuffer());
+ if (simgrid::mc::actor_is_enabled(actor.copy.get_buffer())) {
+ initial_state->addInterleavingSet(actor.copy.get_buffer());