- MC_SET_RAW_MEM;
- MC_take_snapshot(snapshot);
- MC_UNSET_RAW_MEM;
-
- set_pair_reached(a, pair_succ->automaton_state, snapshot);
-
- /* Pair shifted from stack when first MC_ddfs finished and returned at this point */
- MC_SET_RAW_MEM;
- xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
- MC_UNSET_RAW_MEM;
-
- XBT_DEBUG("Backtracking to depth %d, detection of acceptance cycle enabled", xbt_fifo_size(mc_stack_liveness_stateless));
-
- MC_ddfs_stateless(a, 1, 1);
-
- /* No acceptance cycle with this acceptance pair, we remove it from the list reached_pairs */
- MC_SET_RAW_MEM;
- xbt_dynar_pop(reached_pairs, NULL);
- MC_UNSET_RAW_MEM;
-
- }
-
- /* Restore system before checking others successors */
- MC_replay_liveness(mc_stack_liveness_stateless, 1);
-
- }
- }
-
- }
-
- MC_SET_RAW_MEM;
- if(xbt_fifo_size(mc_stack_liveness_stateless) == MAX_DEPTH_LIVENESS - 1){
- XBT_DEBUG("Pair (graph=%p, automaton =%p, search_cycle = %u) shifted in stack, maximum depth reached", current_pair->graph_state, current_pair->automaton_state, search_cycle);
- }else{
- XBT_DEBUG("Pair (graph=%p, automaton =%p, search_cycle = %u) shifted in stack", current_pair->graph_state, current_pair->automaton_state, search_cycle);
- }
- xbt_fifo_shift(mc_stack_liveness_stateless);
- MC_UNSET_RAW_MEM;
-
-}
-
-/********************* Double-DFS stateful without visited state *******************/
-
-mc_pair_t new_pair(mc_snapshot_t sn, mc_state_t sg, xbt_state_t st){
- mc_pair_t p = NULL;
- p = xbt_new0(s_mc_pair_t, 1);
- p->system_state = sn;
- p->automaton_state = st;
- p->graph_state = sg;
- mc_stats_pair->expanded_pairs++;
- return p;
-
-}
-
-void MC_ddfs_stateful_init(xbt_automaton_t a){
-
- XBT_DEBUG("**************************************************");
- XBT_DEBUG("Double-DFS stateful without visited state init");
- XBT_DEBUG("**************************************************");
-
- mc_pair_t mc_initial_pair;
- mc_state_t initial_graph_state;
- smx_process_t process;
- mc_snapshot_t init_snapshot;
-
- MC_wait_for_requests();
-
- MC_SET_RAW_MEM;
-
- initial_graph_state = MC_state_pair_new();
- xbt_swag_foreach(process, simix_global->process_list){
- if(MC_process_is_enabled(process)){
- MC_state_interleave_process(initial_graph_state, process);
- }
- }
-
- reached_pairs = xbt_dynar_new(sizeof(mc_pair_reached_t), NULL);
- successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
- current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
- next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
-
- init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
- MC_take_snapshot(init_snapshot);
-
- MC_UNSET_RAW_MEM;
-
- unsigned int cursor = 0;
- xbt_state_t state = NULL;
-
- xbt_dynar_foreach(a->states, cursor, state){
- if(state->type == -1){
-
- MC_SET_RAW_MEM;
- mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
- xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
- MC_UNSET_RAW_MEM;
-
- if(cursor == 0){
- MC_ddfs_stateful(a, 0, 0);
- }else{
- MC_restore_snapshot(init_snapshot);
- MC_UNSET_RAW_MEM;
- MC_ddfs_stateful(a, 0, 0);
- }
- }else{
- if(state->type == 2){
-
- MC_SET_RAW_MEM;
- mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
- xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
- MC_UNSET_RAW_MEM;
-
- if(cursor == 0){
- MC_ddfs_stateful(a, 1, 0);
- }else{
- MC_restore_snapshot(init_snapshot);
- MC_UNSET_RAW_MEM;
- MC_ddfs_stateful(a, 1, 0);
- }
- }
- }
- }
-}
-
-
-void MC_ddfs_stateful(xbt_automaton_t a, int search_cycle, int restore){
-
- smx_process_t process = NULL;
- mc_pair_t current_pair = NULL;
-
- if(xbt_fifo_size(mc_stack_liveness_stateful) == 0)
- return;
-
- if(restore == 1){
- current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
- MC_restore_snapshot(current_pair->system_state);
- xbt_swag_foreach(process, simix_global->process_list){
- if(MC_process_is_enabled(process)){
- MC_state_interleave_process(current_pair->graph_state, process);
- }
- }
- MC_UNSET_RAW_MEM;
- }
-
- /* Get current state */
- current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
-
-
- XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateful), search_cycle);
- XBT_DEBUG("Pair : graph=%p, automaton=%p(%s), %u interleave", current_pair->graph_state, current_pair->automaton_state, current_pair->automaton_state->id,MC_state_interleave_size(current_pair->graph_state));
-
- a->current_state = current_pair->automaton_state;
-
- //sleep(1);
-
- mc_stats_pair->visited_pairs++;
-
- int value;
- mc_state_t next_graph_state = NULL;
- smx_req_t req = NULL;
- char *req_str;