-
- if (_sg_mc_termination)
- this->check_non_termination(next_state.get());
-
- /* 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)
- visited_state_ = visited_states_.addVisitedState(next_state->get_num(), next_state.get(), get_remote_app());
-
- /* If this is a new state (or if we don't care about state-equality reduction) */
- if (visited_state_ == nullptr) {
- /* Get an enabled process and insert it in the interleave set of the next state */
- for (auto const& [aid, _] : next_state->get_actors_list()) {
- if (next_state->is_actor_enabled(aid) and not next_state->is_actor_done(aid)) {
- next_state->mark_todo(aid);
- if (reduction_mode_ == ReductionMode::dpor)
- break; // With DPOR, we take the first enabled transition
- }
- }
-
- dot_output("\"%ld\" -> \"%ld\" [%s];\n", state->get_num(), next_state->get_num(),
- state->get_transition()->dot_string().c_str());
- } else
- dot_output("\"%ld\" -> \"%ld\" [%s];\n", state->get_num(),
- visited_state_->original_num_ == -1 ? visited_state_->num_ : visited_state_->original_num_,
- state->get_transition()->dot_string().c_str());
-
- stack_.push_back(std::move(next_state));
- }
-
- log_state();
-}
-
-void DFSExplorer::backtrack()
-{
- backtrack_count_++;
- XBT_VERB("Backtracking from %s", get_record_trace().to_string().c_str());
- on_backtracking_signal(get_remote_app());
- get_remote_app().check_deadlock();
-
- /* We may backtrack from somewhere either because it's leaf, or because every enabled process are in done/sleep set.
- * In the first case, we need to remove the last transition corresponding to the Finalize */
- if (stack_.back()->get_transition()->aid_ == 0)
- stack_.pop_back();
-
- /* Traverse the stack backwards until a state with a non empty interleave set is found, deleting all the states that
- * have it empty in the way. For each deleted state, check if the request that has generated it (from its
- * predecessor state) depends on any other previous request executed before it on another process. If there exists one,
- * find the more recent, and add its process to the interleave set. If the process is not enabled at this point,
- * then add every enabled process to the interleave */
- bool found_backtracking_point = false;
- while (not stack_.empty() && not found_backtracking_point) {
- std::unique_ptr<State> state = std::move(stack_.back());
-
- stack_.pop_back();
-