- /* Pair already visited ? stop the exploration on the current path */
- if ((current_pair->exploration_started == 0)
- && (visited_num = this->insertVisitedPair(
- reached_pair, current_pair)) != -1) {
-
- if (dot_output != nullptr){
- fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_global_state->prev_pair, visited_num, initial_global_state->prev_req);
- fflush(dot_output);
- }
-
- XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
- current_pair->requests = 0;
- goto backtracking;
-
- }else{
-
- req = MC_state_get_request(current_pair->graph_state, &value);
-
- if (dot_output != nullptr) {
- if (initial_global_state->prev_pair != 0 && initial_global_state->prev_pair != current_pair->num) {
- fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", initial_global_state->prev_pair, current_pair->num, initial_global_state->prev_req);
- xbt_free(initial_global_state->prev_req);
- }
- initial_global_state->prev_pair = current_pair->num;
- initial_global_state->prev_req = simgrid::mc::request_get_dot_output(req, value);
- if (current_pair->search_cycle)
- fprintf(dot_output, "%d [shape=doublecircle];\n", current_pair->num);
- fflush(dot_output);
- }
-
- char* req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::simix);
- XBT_DEBUG("Execute: %s", req_str);
- xbt_free(req_str);
-
- /* Set request as executed */
- MC_state_set_executed_request(current_pair->graph_state, req, value);
-
- /* Update mc_stats */
- mc_stats->executed_transitions++;
- if(current_pair->exploration_started == 0)
- mc_stats->visited_pairs++;
-
- /* Answer the request */
- simgrid::mc::handle_simcall(req, value);
-
- /* Wait for requests (schedules processes) */
- mc_model_checker->wait_for_requests();
-
- current_pair->requests--;
- current_pair->exploration_started = 1;
-
- /* Get values of atomic propositions (variables used in the property formula) */
- prop_values = this->getPropositionValues();
-
- /* Evaluate enabled/true transitions in automaton according to atomic propositions values and create new pairs */
- cursor = xbt_dynar_length(current_pair->automaton_state->out) - 1;
- while (cursor >= 0) {
- transition_succ = (xbt_automaton_transition_t)xbt_dynar_get_as(current_pair->automaton_state->out, cursor, xbt_automaton_transition_t);
- res = MC_automaton_evaluate_label(transition_succ->label, prop_values.get());
- if (res == 1 || res == 2) { /* 1 = True transition (always enabled), 2 = enabled transition according to atomic prop values */
- next_pair = new Pair();
- next_pair->graph_state = MC_state_new();
- next_pair->automaton_state = transition_succ->dst;
- next_pair->atomic_propositions = this->getPropositionValues();
- next_pair->depth = current_pair->depth + 1;
- /* Get enabled processes and insert them in the interleave set of the next graph_state */
- for (auto& p : mc_model_checker->process().simix_processes())
- if (simgrid::mc::process_is_enabled(&p.copy))
- MC_state_interleave_process(next_pair->graph_state, &p.copy);
-
- next_pair->requests = MC_state_interleave_size(next_pair->graph_state);
-
- /* FIXME : get search_cycle value for each acceptant state */
- if (next_pair->automaton_state->type == 1 || current_pair->search_cycle)
- next_pair->search_cycle = 1;
-
- /* Add new pair to the exploration stack */
- xbt_fifo_unshift(liveness_stack, next_pair);
-
- }
- cursor--;
- }
-
- } /* End of visited_pair test */
+ /* Pair already visited ? stop the exploration on the current path */
+ int visited_num = -1;
+ if ((!current_pair->exploration_started)
+ && (visited_num = this->insertVisitedPair(
+ reached_pair, current_pair.get())) != -1) {
+ if (dot_output != nullptr){
+ fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n",
+ this->previousPair_, visited_num,
+ this->previousRequest_.c_str());
+ fflush(dot_output);
+ }
+ XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
+ current_pair->requests = 0;
+ this->backtrack();
+ continue;
+ }