4 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dfs, mc,
5 "Logging specific to MC DFS algorithm");
7 xbt_dynar_t initial_pairs = NULL;
9 xbt_dynar_t visited_pairs;
10 xbt_dynar_t reached_pairs;
12 mc_pairs_t new_pair(mc_snapshot_t sn, mc_state_t sg, xbt_state_t st){
14 p = xbt_new0(s_mc_pairs_t, 1);
16 p->automaton_state = st;
24 void set_pair_visited(mc_state_t gs, xbt_state_t as, int sc){
26 //XBT_DEBUG("New visited pair : graph=%p, automaton=%p", gs, as);
28 mc_visited_pairs_t p = NULL;
29 p = xbt_new0(s_mc_visited_pairs_t, 1);
31 p->automaton_state = as;
33 xbt_dynar_push(visited_pairs, &p);
34 //XBT_DEBUG("New visited pair , length of visited pairs : %lu", xbt_dynar_length(visited_pairs));
37 //XBT_DEBUG("New visited pair , length of visited pairs : %lu", xbt_dynar_length(visited_pairs));
40 int reached(mc_state_t gs, xbt_state_t as ){
42 mc_reached_pairs_t rp = NULL;
45 int different_process;
48 xbt_dynar_foreach(reached_pairs, c, rp){
49 if(rp->automaton_state == as){
51 for(i=0; i < gs->max_pid; i++){
52 if(gs->proc_status[i].state != rp->graph_state->proc_status[i].state){
56 if(different_process==0){
58 XBT_DEBUG("Pair (graph=%p, automaton=%p(%s)) already reached (graph=%p)!", gs, as, as->id, rp->graph_state);
61 /* XBT_DEBUG("Pair (graph=%p, automaton=%p(%s)) already reached !", gs, as, as->id); */
69 void set_pair_reached(mc_state_t gs, xbt_state_t as){
71 //XBT_DEBUG("Set pair (graph=%p, automaton=%p) reached ", gs, as);
72 //if(reached(gs, as) == 0){
74 mc_reached_pairs_t p = NULL;
75 p = xbt_new0(s_mc_reached_pairs_t, 1);
77 p->automaton_state = as;
78 xbt_dynar_push(reached_pairs, &p);
79 XBT_DEBUG("New reached pair : graph=%p, automaton=%p(%s)", gs, as, as->id);
85 int visited(mc_state_t gs, xbt_state_t as, int sc){
87 mc_visited_pairs_t p = NULL;
89 int different_process;
91 //XBT_DEBUG("Visited pair length : %lu", xbt_dynar_length(visited_pairs));
94 xbt_dynar_foreach(visited_pairs, c, p){
95 //XBT_DEBUG("Test pair visited");
97 if((p->automaton_state == as) && (p->search_cycle == sc)){
99 for(i=0; i < gs->max_pid; i++){
100 if(gs->proc_status[i].state != p->graph_state->proc_status[i].state){
104 if(different_process==0){
115 void MC_dfs_init(xbt_automaton_t a){
117 XBT_DEBUG("**************************************************");
118 XBT_DEBUG("DFS init");
119 XBT_DEBUG("**************************************************");
121 mc_pairs_t mc_initial_pair;
122 mc_state_t initial_graph_state;
123 smx_process_t process;
124 mc_snapshot_t init_snapshot;
126 MC_wait_for_requests();
130 init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
132 initial_graph_state = MC_state_pair_new();
133 xbt_swag_foreach(process, simix_global->process_list){
134 if(MC_process_is_enabled(process)){
135 MC_state_interleave_process(initial_graph_state, process);
139 visited_pairs = xbt_dynar_new(sizeof(mc_visited_pairs_t), NULL);
140 reached_pairs = xbt_dynar_new(sizeof(mc_reached_pairs_t), NULL);
142 MC_take_snapshot(init_snapshot);
146 /* unsigned int cursor = 0; */
147 /* xbt_state_t state = NULL; */
148 /* int nb_init_state = 0; */
150 /* xbt_dynar_foreach(a->states, cursor, state){ */
151 /* if(state->type == -1){ */
153 /* MC_SET_RAW_MEM; */
154 /* mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state); */
156 /* xbt_fifo_unshift(mc_snapshot_stack, mc_initial_pair); */
158 /* XBT_DEBUG("**************************************************"); */
159 /* XBT_DEBUG("Initial state=%p ", mc_initial_pair); */
161 /* MC_UNSET_RAW_MEM; */
163 /* set_pair_visited(mc_initial_pair->graph_state, mc_initial_pair->automaton_state, 0); */
165 /* if(nb_init_state == 0) */
166 /* MC_dfs(a, 0, 0); */
168 /* MC_dfs(a, 0, 1); */
170 /* nb_init_state++; */
174 /* regarder dans l'automate toutes les transitions activables grâce à l'état initial du système
175 -> donnera les états initiaux de la propriété consistants avec l'état initial du système */
177 unsigned int cursor = 0;
178 unsigned int cursor2 = 0;
179 xbt_state_t state = NULL;
181 xbt_transition_t transition_succ;
182 xbt_dynar_t successors = xbt_dynar_new(sizeof(mc_pairs_t), NULL);
183 xbt_dynar_t elses = xbt_dynar_new(sizeof(mc_pairs_t), NULL);
184 mc_pairs_t pair_succ;
186 xbt_dynar_foreach(a->states, cursor, state){
187 if(state->type == -1){
188 xbt_dynar_foreach(state->out, cursor2, transition_succ){
189 res = MC_automaton_evaluate_label(a, transition_succ->label);
195 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, transition_succ->dst);
196 xbt_dynar_push(successors, &mc_initial_pair);
205 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, transition_succ->dst);
206 xbt_dynar_push(elses, &mc_initial_pair);
217 xbt_dynar_foreach(successors, cursor, pair_succ){
220 xbt_fifo_unshift(mc_snapshot_stack, pair_succ);
222 XBT_DEBUG("**************************************************");
223 XBT_DEBUG("Initial pair=%p (graph=%p, automaton=%p(%s)) ", pair_succ, pair_succ->graph_state, pair_succ->automaton_state,pair_succ->automaton_state->id );
227 set_pair_visited(pair_succ->graph_state, pair_succ->automaton_state, 0);
237 xbt_dynar_foreach(elses, cursor, pair_succ){
240 xbt_fifo_unshift(mc_snapshot_stack, pair_succ);
242 XBT_DEBUG("**************************************************");
243 XBT_DEBUG("Initial pair=%p (graph=%p, automaton=%p(%s)) ", pair_succ, pair_succ->graph_state, pair_succ->automaton_state,pair_succ->automaton_state->id );
247 set_pair_visited(pair_succ->graph_state, pair_succ->automaton_state, 0);
249 if((xbt_dynar_length(successors) == 0) && (cursor == 0)){
259 void MC_dfs(xbt_automaton_t a, int search_cycle, int restore){
261 smx_process_t process = NULL;
264 if(xbt_fifo_size(mc_snapshot_stack) == 0)
268 MC_restore_snapshot(((mc_pairs_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_snapshot_stack)))->system_state);
272 //XBT_DEBUG("Lpv length after restore snapshot: %lu", xbt_dynar_length(visited_pairs));
274 /* Get current state */
275 mc_pairs_t current_pair = (mc_pairs_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_snapshot_stack));
278 xbt_swag_foreach(process, simix_global->process_list){
279 if(MC_process_is_enabled(process)){
280 //XBT_DEBUG("Pid : %lu", process->pid);
281 MC_state_interleave_process(current_pair->graph_state, process);
286 XBT_DEBUG("************************************************** ( search_cycle = %d )", search_cycle);
287 XBT_DEBUG("State : 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));
288 //XBT_DEBUG("Restore : %d", restore);
290 //XBT_DEBUG("Reached pairs : %lu", xbt_dynar_length(reached_pairs));
294 mc_stats_pair->visited_pairs++;
297 mc_state_t next_graph_state = NULL;
298 smx_req_t req = NULL;
301 mc_pairs_t pair_succ;
302 xbt_transition_t transition_succ;
305 //int enabled_transition = 0;
307 xbt_dynar_t successors = xbt_dynar_new(sizeof(mc_pairs_t), NULL);
308 xbt_dynar_t elses = xbt_dynar_new(sizeof(mc_pairs_t), NULL);
310 mc_pairs_t next_pair;
311 mc_snapshot_t next_snapshot;
312 mc_snapshot_t current_snapshot;
315 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
318 current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
319 MC_take_snapshot(current_snapshot);
323 /* Debug information */
324 if(XBT_LOG_ISENABLED(mc_dfs, xbt_log_priority_debug)){
325 req_str = MC_request_to_string(req, value);
326 XBT_DEBUG("Execute: %s", req_str);
330 MC_state_set_executed_request(current_pair->graph_state, req, value);
332 /* Answer the request */
333 SIMIX_request_pre(req, value);
335 /* Wait for requests (schedules processes) */
336 MC_wait_for_requests();
339 /* Create the new expanded graph_state */
342 next_graph_state = MC_state_pair_new();
344 /* Get enabled process and insert it in the interleave set of the next graph_state */
345 xbt_swag_foreach(process, simix_global->process_list){
346 if(MC_process_is_enabled(process)){
347 //XBT_DEBUG("Pid : %lu", process->pid);
348 MC_state_interleave_process(next_graph_state, process);
352 next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
353 MC_take_snapshot(next_snapshot);
357 xbt_dynar_reset(successors);
358 xbt_dynar_reset(elses);
361 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
363 res = MC_automaton_evaluate_label(a, transition_succ->label);
366 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
368 //XBT_DEBUG("Next pair : %p", next_pair);
370 if(res == 1){ // enabled transition in automaton
371 xbt_dynar_push(successors, &next_pair);
372 mc_stats_pair->expanded_pairs++;
374 if(res == 2){ // enabled transition in automaton
375 xbt_dynar_push(elses, &next_pair);
376 mc_stats_pair->expanded_pairs++;
384 if(xbt_dynar_length(successors) == 0){
387 next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state);
388 xbt_dynar_push(successors, &next_pair);
389 mc_stats_pair->expanded_pairs++;
396 xbt_dynar_foreach(successors, cursor, pair_succ){
398 //XBT_DEBUG("Search visited pair : graph=%p, automaton=%p", pair_succ->graph_state, pair_succ->automaton_state);
400 if((search_cycle == 1) && (reached(pair_succ->graph_state, pair_succ->automaton_state) == 1)){
401 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
402 XBT_INFO("| ACCEPTANCE CYCLE |");
403 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
404 XBT_INFO("Counter-example that violates formula :");
405 MC_show_snapshot_stack(mc_snapshot_stack);
406 MC_dump_snapshot_stack(mc_snapshot_stack);
407 MC_print_statistics_pairs(mc_stats_pair);
411 if(visited(pair_succ->graph_state, pair_succ->automaton_state, search_cycle) == 0){
413 //XBT_DEBUG("Unvisited pair !");
415 mc_stats_pair->executed_transitions++;
418 xbt_fifo_unshift(mc_snapshot_stack, pair_succ);
421 set_pair_visited(pair_succ->graph_state, pair_succ->automaton_state, search_cycle);
422 MC_dfs(a, search_cycle, 0);
424 if((search_cycle == 0) && (current_pair->automaton_state->type == 1)){
426 MC_restore_snapshot(current_pair->system_state);
429 xbt_swag_foreach(process, simix_global->process_list){
430 if(MC_process_is_enabled(process)){
431 //XBT_DEBUG("Pid : %lu", process->pid);
432 MC_state_interleave_process(current_pair->graph_state, process);
436 set_pair_reached(current_pair->graph_state, current_pair->automaton_state);
437 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", current_pair->graph_state, current_pair->automaton_state, current_pair->automaton_state->id);
445 xbt_dynar_foreach(elses, cursor, pair_succ){
447 //XBT_DEBUG("Search visited pair : graph=%p, automaton=%p", pair_succ->graph_state, pair_succ->automaton_state);
449 if((search_cycle == 1) && (reached(pair_succ->graph_state, pair_succ->automaton_state) == 1)){
450 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
451 XBT_INFO("| ACCEPTANCE CYCLE |");
452 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
453 XBT_INFO("Counter-example that violates formula :");
454 MC_show_snapshot_stack(mc_snapshot_stack);
455 MC_dump_snapshot_stack(mc_snapshot_stack);
456 MC_print_statistics_pairs(mc_stats_pair);
460 if(visited(pair_succ->graph_state, pair_succ->automaton_state, search_cycle) == 0){
462 //XBT_DEBUG("Unvisited pair !");
464 mc_stats_pair->executed_transitions++;
467 xbt_fifo_unshift(mc_snapshot_stack, pair_succ);
470 set_pair_visited(pair_succ->graph_state, pair_succ->automaton_state, search_cycle);
471 MC_dfs(a, search_cycle, 0);
473 if((search_cycle == 0) && (current_pair->automaton_state->type == 1)){
475 MC_restore_snapshot(current_pair->system_state);
478 xbt_swag_foreach(process, simix_global->process_list){
479 if(MC_process_is_enabled(process)){
480 //XBT_DEBUG("Pid : %lu", process->pid);
481 MC_state_interleave_process(current_pair->graph_state, process);
485 set_pair_reached(current_pair->graph_state, current_pair->automaton_state);
486 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", current_pair->graph_state, current_pair->automaton_state, current_pair->automaton_state->id);
494 if(MC_state_interleave_size(current_pair->graph_state) > 0){
495 MC_restore_snapshot(current_snapshot);
497 //XBT_DEBUG("Snapshot restored");
503 //remove_pair_reached(current_pair->graph_state);
504 xbt_fifo_shift(mc_snapshot_stack);
505 XBT_DEBUG("State (graph=%p, automaton =%p) shifted in snapshot_stack", current_pair->graph_state, current_pair->automaton_state);
510 void MC_show_snapshot_stack(xbt_fifo_t stack){
513 xbt_fifo_item_t item;
515 char *req_str = NULL;
517 for (item = xbt_fifo_get_last_item(stack);
518 (item ? (pair = (mc_pairs_t) (xbt_fifo_get_item_content(item)))
519 : (NULL)); item = xbt_fifo_get_prev_item(item)) {
520 req = MC_state_get_executed_request(pair->graph_state, &value);
522 req_str = MC_request_to_string(req, value);
523 XBT_INFO("%s", req_str);
529 void MC_dump_snapshot_stack(xbt_fifo_t stack){
533 while ((pair = (mc_pairs_t) xbt_fifo_pop(stack)) != NULL)
534 MC_pair_delete(pair);
538 void MC_pair_delete(mc_pairs_t pair){
539 xbt_free(pair->graph_state->proc_status);
540 xbt_free(pair->graph_state);
541 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
546 int MC_automaton_evaluate_label(xbt_automaton_t a, xbt_exp_label_t l){
550 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
551 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
552 return (left_res || right_res);
556 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
557 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
558 return (left_res && right_res);
562 int res = MC_automaton_evaluate_label(a, l->u.exp_not);
567 unsigned int cursor = 0;
568 xbt_propositional_symbol_t p = NULL;
569 xbt_dynar_foreach(a->propositional_symbols, cursor, p){
570 if(strcmp(p->pred, l->u.predicat) == 0){
571 int (*f)() = p->function;
587 /*void MC_dfs(xbt_automaton_t a, int search_cycle){
589 xbt_state_t current_state = (xbt_state_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(stack_automaton_dfs));
590 xbt_transition_t transition_succ = NULL;
591 xbt_state_t successor = NULL;
592 unsigned int cursor = 0;
593 xbt_dynar_t elses = xbt_dynar_new(sizeof(xbt_transition_t), NULL);
596 //printf("++ current state : %s\n", current_state->id);
598 xbt_dynar_foreach(current_state->out, cursor, transition_succ){
599 successor = transition_succ->dst;
600 res = MC_automaton_evaluate_label(a, transition_succ->label);
601 //printf("-- state : %s, transition_label : %d, res = %d\n", successor->id, transition_succ->label->type, res);
603 if(search_cycle == 1 && reached_dfs != NULL){
604 if(strcmp(reached_dfs->id, successor->id) == 0){
605 xbt_dynar_push(state_automaton_visited_dfs, &successor);
606 printf("\n-*-*-*-*-*-*- ACCEPTANCE CYCLE -*-*-*-*-*-*-\n");
607 printf("Visited states : \n");
608 unsigned int cursor2 = 0;
609 xbt_state_t visited_state = NULL;
610 xbt_dynar_foreach(state_automaton_visited_dfs, cursor2, visited_state){
611 printf("State : %s\n", visited_state->id);
616 if(successor->visited == 0){
617 successor->visited = 1;
618 xbt_fifo_unshift(stack_automaton_dfs, successor);
619 xbt_dynar_push(state_automaton_visited_dfs, &successor);
620 MC_dfs(a, search_cycle);
621 if(search_cycle == 0 && successor->type == 1){
622 reached_dfs = successor;
628 xbt_dynar_push(elses,&transition_succ);
634 xbt_dynar_foreach(elses, cursor, transition_succ){
635 successor = transition_succ->dst;
636 if(search_cycle == 1 && reached_dfs != NULL){
637 if(strcmp(reached_dfs->id, successor->id) == 0){
638 xbt_dynar_push(state_automaton_visited_dfs, &successor);
639 printf("\n-*-*-*-*-*-*- ACCEPTANCE CYCLE -*-*-*-*-*-*-\n");
640 printf("Visited states : \n");
641 unsigned int cursor2 = 0;
642 xbt_state_t visited_state = NULL;
643 xbt_dynar_foreach(state_automaton_visited_dfs, cursor2, visited_state){
644 printf("State : %s\n", visited_state->id);
649 if(successor->visited == 0){
650 successor->visited = 1;
651 xbt_fifo_unshift(stack_automaton_dfs, successor);
652 xbt_dynar_push(state_automaton_visited_dfs, &successor);
653 MC_dfs(a, search_cycle);
654 if(search_cycle == 0 && successor->type == 1){
655 reached_dfs = successor;
661 xbt_fifo_shift(stack_automaton_dfs);
665 /* void MC_dfs(xbt_automaton_t a, int search_cycle, int restore){ */
668 /* if(xbt_fifo_size(mc_snapshot_stack) == 0) */
671 /* if(restore == 1){ */
672 /* MC_restore_snapshot(((mc_pairs_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_snapshot_stack)))->system_state); */
673 /* MC_UNSET_RAW_MEM; */
677 /* //XBT_DEBUG("Lpv length after restore snapshot: %lu", xbt_dynar_length(visited_pairs)); */
679 /* /\* Get current state *\/ */
680 /* mc_pairs_t current_pair = (mc_pairs_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_snapshot_stack)); */
682 /* XBT_DEBUG("************************************************** ( search_cycle = %d )", search_cycle); */
683 /* XBT_DEBUG("State : 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)); */
685 /* //XBT_DEBUG("Reached pairs : %lu", xbt_dynar_length(reached_pairs)); */
689 /* smx_process_t process = NULL; */
691 /* mc_state_t next_graph_state = NULL; */
692 /* smx_req_t req = NULL; */
695 /* mc_pairs_t pair_succ; */
696 /* xbt_transition_t transition_succ; */
697 /* unsigned int cursor; */
699 /* //int enabled_transition = 0; */
701 /* xbt_dynar_t elses = xbt_dynar_new(sizeof(mc_pairs_t), NULL); */
702 /* xbt_dynar_t successors = xbt_dynar_new(sizeof(mc_pairs_t), NULL); */
703 /* xbt_dynar_reset(all_successors); */
705 /* mc_pairs_t next_pair; */
706 /* mc_snapshot_t next_snapshot; */
707 /* mc_snapshot_t current_snapshot; */
709 /* while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){ */
711 /* //XBT_DEBUG("Current pair : %p (%u interleave)", current_pair, MC_state_interleave_size(current_pair->graph_state)+1); */
712 /* //XBT_DEBUG("Visited pairs : %lu", xbt_dynar_length(visited_pairs)); */
714 /* MC_SET_RAW_MEM; */
715 /* current_snapshot = xbt_new0(s_mc_snapshot_t, 1); */
716 /* MC_take_snapshot(current_snapshot); */
717 /* MC_UNSET_RAW_MEM; */
720 /* /\* Debug information *\/ */
721 /* if(XBT_LOG_ISENABLED(mc_dfs, xbt_log_priority_debug)){ */
722 /* req_str = MC_request_to_string(req, value); */
723 /* XBT_DEBUG("Execute: %s", req_str); */
724 /* xbt_free(req_str); */
727 /* MC_state_set_executed_request(current_pair->graph_state, req, value); */
728 /* //mc_stats->executed_transitions++; */
730 /* /\* Answer the request *\/ */
731 /* SIMIX_request_pre(req, value); */
733 /* /\* Wait for requests (schedules processes) *\/ */
734 /* MC_wait_for_requests(); */
737 /* /\* Create the new expanded graph_state *\/ */
738 /* MC_SET_RAW_MEM; */
740 /* next_graph_state = MC_state_new(); */
742 /* /\* Get enabled process and insert it in the interleave set of the next graph_state *\/ */
743 /* xbt_swag_foreach(process, simix_global->process_list){ */
744 /* if(MC_process_is_enabled(process)){ */
745 /* MC_state_interleave_process(next_graph_state, process); */
749 /* next_snapshot = xbt_new0(s_mc_snapshot_t, 1); */
750 /* MC_take_snapshot(next_snapshot); */
752 /* MC_UNSET_RAW_MEM; */
754 /* xbt_dynar_reset(elses); */
755 /* xbt_dynar_reset(successors); */
758 /* xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){ */
760 /* res = MC_automaton_evaluate_label(a, transition_succ->label); */
762 /* MC_SET_RAW_MEM; */
763 /* next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst); */
765 /* //XBT_DEBUG("Next pair : %p", next_pair); */
767 /* if(res == 1){ // enabled transition in automaton */
768 /* xbt_dynar_push(successors, &next_pair); */
769 /* //XBT_DEBUG("New Successors length : %lu", xbt_dynar_length(successors)); */
772 /* xbt_dynar_push(elses, &next_pair); */
773 /* //XBT_DEBUG("New Elses length : %lu", xbt_dynar_length(elses)); */
777 /* MC_UNSET_RAW_MEM; */
781 /* if((xbt_dynar_length(successors) == 0) && (xbt_dynar_length(elses) == 0) ){ */
783 /* MC_SET_RAW_MEM; */
784 /* next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state); */
785 /* xbt_dynar_push(successors, &next_pair); */
786 /* MC_UNSET_RAW_MEM; */
790 /* //XBT_DEBUG("Successors length : %lu", xbt_dynar_length(successors)); */
791 /* //XBT_DEBUG("Elses length : %lu", xbt_dynar_length(elses)); */
793 /* if(xbt_dynar_length(successors) > 0){ */
796 /* xbt_dynar_foreach(successors, cursor, pair_succ){ */
797 /* MC_SET_RAW_MEM; */
798 /* xbt_dynar_push(all_successors, &pair_succ); */
799 /* MC_UNSET_RAW_MEM; */
805 /* xbt_dynar_foreach(elses, cursor, pair_succ){ */
806 /* MC_SET_RAW_MEM; */
807 /* xbt_dynar_push(all_successors, &pair_succ); */
808 /* MC_UNSET_RAW_MEM; */
813 /* MC_restore_snapshot(current_snapshot); */
814 /* MC_UNSET_RAW_MEM; */
818 /* //XBT_DEBUG("All successors : %lu", xbt_dynar_length(all_successors)); */
822 /* xbt_dynar_foreach(all_successors, cursor, pair_succ){ */
824 /* if((search_cycle == 1) && (reached(pair_succ->graph_state, pair_succ->automaton_state) == 1)){ */
825 /* XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"); */
826 /* XBT_INFO("| ACCEPTANCE CYCLE |"); */
827 /* XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*"); */
828 /* XBT_INFO("Counter-example that violates formula :"); */
829 /* MC_show_snapshot_stack(mc_snapshot_stack); */
830 /* MC_dump_snapshot_stack(mc_snapshot_stack); */
834 /* if(visited(pair_succ->graph_state, pair_succ->automaton_state, search_cycle) == 0){ */
836 /* //XBT_DEBUG("New pair in stack"); */
838 /* MC_SET_RAW_MEM; */
839 /* xbt_fifo_unshift(mc_snapshot_stack, pair_succ); */
840 /* MC_UNSET_RAW_MEM; */
842 /* set_pair_visited(pair_succ->graph_state, pair_succ->automaton_state, search_cycle); */
843 /* MC_dfs(a, search_cycle, 1); */
845 /* if((search_cycle == 0) && (pair_succ->automaton_state->type == 1)){ */
847 /* set_pair_reached(pair_succ->graph_state, pair_succ->automaton_state); */
848 /* XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id); */
849 /* MC_dfs(a, 1, 1); */
856 /* MC_SET_RAW_MEM; */
857 /* //remove_pair_reached(current_pair->graph_state); */
858 /* xbt_fifo_shift(mc_snapshot_stack); */
859 /* XBT_DEBUG("State (graph=%p, automaton =%p) shifted in snapshot_stack", current_pair->graph_state, current_pair->automaton_state); */
860 /* MC_UNSET_RAW_MEM; */