4 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc,
5 "Logging specific to algorithms for liveness properties verification");
7 xbt_dynar_t initial_pairs = NULL;
8 xbt_dynar_t reached_pairs;
9 extern mc_snapshot_t initial_snapshot;
11 mc_pair_t new_pair(mc_snapshot_t sn, mc_state_t sg, xbt_state_t st){
13 p = xbt_new0(s_mc_pair_t, 1);
15 p->automaton_state = st;
17 mc_stats_pair->expanded_pairs++;
22 int reached(mc_pair_t pair){
24 if(xbt_dynar_is_empty(reached_pairs)){
29 xbt_sha((const char *)&pair, hash);
30 if(xbt_dynar_member(reached_pairs, hash)){
41 void set_pair_reached(mc_pair_t pair){
44 xbt_sha((const char *)&pair, hash);
45 XBT_DEBUG("Hash to pushed %s", hash);
46 if(strcmp(hash, "da39a3ee5e6b4b0d3255bfef95601890afd80709") == 0){
47 XBT_DEBUG("Error in hash, pair empty !");
50 xbt_dynar_push(reached_pairs, &hash);
54 void MC_pair_delete(mc_pair_t pair){
55 xbt_free(pair->graph_state->proc_status);
56 xbt_free(pair->graph_state);
57 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
62 int MC_automaton_evaluate_label(xbt_automaton_t a, xbt_exp_label_t l){
66 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
67 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
68 return (left_res || right_res);
72 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
73 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
74 return (left_res && right_res);
78 int res = MC_automaton_evaluate_label(a, l->u.exp_not);
83 unsigned int cursor = 0;
84 xbt_propositional_symbol_t p = NULL;
85 xbt_dynar_foreach(a->propositional_symbols, cursor, p){
86 if(strcmp(p->pred, l->u.predicat) == 0){
87 int (*f)() = p->function;
105 /******************************* DFS with visited state *******************************/
107 xbt_dynar_t visited_pairs;
109 void set_pair_visited(mc_pair_t pair, int sc){
112 mc_visited_pair_t p = NULL;
113 p = xbt_new0(s_mc_visited_pair_t, 1);
115 p->search_cycle = sc;
117 xbt_sha((const char *)&p, hash);
118 xbt_dynar_push(visited_pairs, &hash);
123 int visited(mc_pair_t pair, int sc){
127 mc_visited_pair_t p = NULL;
128 p = xbt_new0(s_mc_visited_pair_t, 1);
130 p->search_cycle = sc;
132 xbt_sha((const char *)&p, hash);
133 if(xbt_dynar_member(visited_pairs, hash)){
143 void MC_vddfs_stateful_init(xbt_automaton_t a){
145 XBT_DEBUG("**************************************************");
146 XBT_DEBUG("Double-DFS stateful with visited state init");
147 XBT_DEBUG("**************************************************");
149 mc_pair_t mc_initial_pair;
150 mc_state_t initial_graph_state;
151 smx_process_t process;
152 mc_snapshot_t init_snapshot;
154 MC_wait_for_requests();
158 init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
160 initial_graph_state = MC_state_pair_new();
161 xbt_swag_foreach(process, simix_global->process_list){
162 if(MC_process_is_enabled(process)){
163 MC_state_interleave_process(initial_graph_state, process);
167 visited_pairs = xbt_dynar_new(sizeof(char *), NULL);
168 reached_pairs = xbt_dynar_new(sizeof(char *), NULL);
170 MC_take_snapshot(init_snapshot);
174 unsigned int cursor = 0;
175 xbt_state_t state = NULL;
177 xbt_dynar_foreach(a->states, cursor, state){
178 if(state->type == -1){
181 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
182 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
186 MC_vddfs_stateful(a, 0, 0);
188 MC_restore_snapshot(init_snapshot);
190 MC_vddfs_stateful(a, 0, 0);
193 if(state->type == 2){
196 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
197 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
201 MC_vddfs_stateful(a, 1, 0);
203 MC_restore_snapshot(init_snapshot);
205 MC_vddfs_stateful(a, 1, 0);
213 void MC_vddfs_stateful(xbt_automaton_t a, int search_cycle, int restore){
215 smx_process_t process = NULL;
218 if(xbt_fifo_size(mc_stack_liveness_stateful) == 0)
222 MC_restore_snapshot(((mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful)))->system_state);
227 /* Get current state */
228 mc_pair_t current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
231 xbt_swag_foreach(process, simix_global->process_list){
232 if(MC_process_is_enabled(process)){
233 MC_state_interleave_process(current_pair->graph_state, process);
238 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateful), search_cycle);
239 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));
242 mc_stats_pair->visited_pairs++;
245 mc_state_t next_graph_state = NULL;
246 smx_req_t req = NULL;
250 xbt_transition_t transition_succ;
254 xbt_dynar_t successors = NULL;
256 mc_pair_t next_pair = NULL;
257 mc_snapshot_t next_snapshot = NULL;
258 mc_snapshot_t current_snapshot = NULL;
259 mc_pair_t pair_succ = NULL;
262 successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
266 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
269 current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
270 MC_take_snapshot(current_snapshot);
274 /* Debug information */
275 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
276 req_str = MC_request_to_string(req, value);
277 XBT_DEBUG("Execute: %s", req_str);
281 MC_state_set_executed_request(current_pair->graph_state, req, value);
283 /* Answer the request */
284 SIMIX_request_pre(req, value);
286 /* Wait for requests (schedules processes) */
287 MC_wait_for_requests();
290 /* Create the new expanded graph_state */
293 next_graph_state = MC_state_pair_new();
295 /* Get enabled process and insert it in the interleave set of the next graph_state */
296 xbt_swag_foreach(process, simix_global->process_list){
297 if(MC_process_is_enabled(process)){
298 MC_state_interleave_process(next_graph_state, process);
302 next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
303 MC_take_snapshot(next_snapshot);
305 xbt_dynar_reset(successors);
310 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
312 res = MC_automaton_evaluate_label(a, transition_succ->label);
316 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
317 xbt_dynar_push(successors, &next_pair);
323 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
325 res = MC_automaton_evaluate_label(a, transition_succ->label);
329 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
330 xbt_dynar_push(successors, &next_pair);
337 if(xbt_dynar_length(successors) == 0){
340 next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state);
341 xbt_dynar_push(successors, &next_pair);
347 //XBT_DEBUG("Successors length %lu", xbt_dynar_length(successors));
351 xbt_dynar_foreach(successors, cursor, pair_succ){
353 XBT_DEBUG("Search reached pair %p : graph=%p, automaton=%p", pair_succ, pair_succ->graph_state, pair_succ->automaton_state);
355 XBT_DEBUG("Const char pair %s", (const char *)&pair_succ);
356 xbt_sha((const char *)&pair_succ, hash);
357 XBT_DEBUG("Hash pair_succ %s", hash);
359 if((search_cycle == 1) && (reached(pair_succ) == 1)){
360 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
361 XBT_INFO("| ACCEPTANCE CYCLE |");
362 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
363 XBT_INFO("Counter-example that violates formula :");
364 MC_show_stack_liveness_stateful(mc_stack_liveness_stateful);
365 MC_dump_stack_liveness_stateful(mc_stack_liveness_stateful);
366 MC_print_statistics_pairs(mc_stats_pair);
370 XBT_DEBUG("Search visited pair %p : graph %p, automaton %p", pair_succ, pair_succ->graph_state, pair_succ->automaton_state);
372 if(visited(pair_succ, search_cycle) == 0){
374 //mc_stats_pair->executed_transitions++;
377 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
378 set_pair_visited(pair_succ, search_cycle);
381 MC_vddfs_stateful(a, search_cycle, 0);
383 //XBT_DEBUG("Pair (graph=%p, automaton=%p) expanded", pair_succ->graph_state, pair_succ->automaton_state);
385 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
387 set_pair_reached(pair_succ);
388 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
391 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
394 MC_vddfs_stateful(a, 1, 1);
397 xbt_dynar_pop(reached_pairs, NULL);
404 XBT_DEBUG("Pair already visited !");
410 if(MC_state_interleave_size(current_pair->graph_state) > 0){
411 MC_restore_snapshot(current_snapshot);
419 xbt_fifo_shift(mc_stack_liveness_stateful);
420 XBT_DEBUG("Pair (graph=%p, automaton =%p) shifted in stack", current_pair->graph_state, current_pair->automaton_state);
429 /********************* Double-DFS stateful without visited state *******************/
432 void MC_ddfs_stateful_init(xbt_automaton_t a){
434 XBT_DEBUG("**************************************************");
435 XBT_DEBUG("Double-DFS stateful without visited state init");
436 XBT_DEBUG("**************************************************");
438 mc_pair_t mc_initial_pair;
439 mc_state_t initial_graph_state;
440 smx_process_t process;
441 mc_snapshot_t init_snapshot;
443 MC_wait_for_requests();
447 init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
449 initial_graph_state = MC_state_pair_new();
450 xbt_swag_foreach(process, simix_global->process_list){
451 if(MC_process_is_enabled(process)){
452 MC_state_interleave_process(initial_graph_state, process);
456 reached_pairs = xbt_dynar_new(sizeof(char *), NULL);
458 MC_take_snapshot(init_snapshot);
462 unsigned int cursor = 0;
463 xbt_state_t state = NULL;
465 xbt_dynar_foreach(a->states, cursor, state){
466 if(state->type == -1){
469 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
470 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
474 MC_ddfs_stateful(a, 0, 0);
476 MC_restore_snapshot(init_snapshot);
478 MC_ddfs_stateful(a, 0, 0);
481 if(state->type == 2){
484 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
485 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
489 MC_ddfs_stateful(a, 1, 0);
491 MC_restore_snapshot(init_snapshot);
493 MC_ddfs_stateful(a, 1, 0);
501 void MC_ddfs_stateful(xbt_automaton_t a, int search_cycle, int restore){
503 smx_process_t process = NULL;
504 mc_pair_t current_pair = NULL;
506 if(xbt_fifo_size(mc_stack_liveness_stateful) == 0)
510 MC_restore_snapshot(((mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful)))->system_state);
514 /* Get current state */
515 current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
518 xbt_swag_foreach(process, simix_global->process_list){
519 if(MC_process_is_enabled(process)){
520 MC_state_interleave_process(current_pair->graph_state, process);
525 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateful), search_cycle);
526 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));
528 mc_stats_pair->visited_pairs++;
531 mc_state_t next_graph_state = NULL;
532 smx_req_t req = NULL;
536 xbt_transition_t transition_succ;
540 xbt_dynar_t successors = NULL;
542 mc_pair_t next_pair = NULL;
543 mc_snapshot_t next_snapshot = NULL;
544 mc_snapshot_t current_snapshot = NULL;
548 successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
551 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
554 current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
555 MC_take_snapshot(current_snapshot);
559 /* Debug information */
560 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
561 req_str = MC_request_to_string(req, value);
562 XBT_DEBUG("%u Execute: %s", search_cycle, req_str);
566 MC_state_set_executed_request(current_pair->graph_state, req, value);
568 /* Answer the request */
569 SIMIX_request_pre(req, value);
571 /* Wait for requests (schedules processes) */
572 MC_wait_for_requests();
575 /* Create the new expanded graph_state */
578 next_graph_state = MC_state_pair_new();
580 /* Get enabled process and insert it in the interleave set of the next graph_state */
581 xbt_swag_foreach(process, simix_global->process_list){
582 if(MC_process_is_enabled(process)){
583 MC_state_interleave_process(next_graph_state, process);
587 next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
588 MC_take_snapshot(next_snapshot);
590 xbt_dynar_reset(successors);
596 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
598 res = MC_automaton_evaluate_label(a, transition_succ->label);
600 if(res == 1){ // enabled transition in automaton
602 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
603 xbt_dynar_push(successors, &next_pair);
610 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
612 res = MC_automaton_evaluate_label(a, transition_succ->label);
614 if(res == 2){ // transition always enabled in automaton
616 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
617 xbt_dynar_push(successors, &next_pair);
625 if(xbt_dynar_length(successors) == 0){
628 next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state);
629 xbt_dynar_push(successors, &next_pair);
634 //XBT_DEBUG("Successors in automaton %lu", xbt_dynar_length(successors));
637 xbt_dynar_foreach(successors, cursor, pair_succ){
639 //XBT_DEBUG("Search visited pair : graph=%p, automaton=%p", pair_succ->graph_state, pair_succ->automaton_state);
641 if((search_cycle == 1) && (reached(pair_succ) == 1)){
642 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
643 XBT_INFO("| ACCEPTANCE CYCLE |");
644 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
645 XBT_INFO("Counter-example that violates formula :");
646 MC_show_stack_liveness_stateful(mc_stack_liveness_stateful);
647 MC_dump_stack_liveness_stateful(mc_stack_liveness_stateful);
648 MC_print_statistics_pairs(mc_stats_pair);
652 //mc_stats_pair->executed_transitions++;
655 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
658 MC_ddfs_stateful(a, search_cycle, 0);
661 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
663 set_pair_reached(pair_succ);
664 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
667 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
670 MC_ddfs_stateful(a, 1, 1);
673 xbt_dynar_pop(reached_pairs, NULL);
679 if(MC_state_interleave_size(current_pair->graph_state) > 0){
680 XBT_DEBUG("Backtracking to depth %u", xbt_fifo_size(mc_stack_liveness_stateful));
681 MC_restore_snapshot(current_snapshot);
689 xbt_fifo_shift(mc_stack_liveness_stateful);
690 XBT_DEBUG("Pair (graph=%p, automaton =%p) shifted in stack", current_pair->graph_state, current_pair->automaton_state);
697 /********************* Double-DFS stateless *******************/
699 void MC_pair_stateless_delete(mc_pair_stateless_t pair){
700 xbt_free(pair->graph_state->proc_status);
701 xbt_free(pair->graph_state);
702 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
706 mc_pair_stateless_t new_pair_stateless(mc_state_t sg, xbt_state_t st){
707 mc_pair_stateless_t p = NULL;
708 p = xbt_new0(s_mc_pair_stateless_t, 1);
709 p->automaton_state = st;
711 mc_stats_pair->expanded_pairs++;
716 int reached_stateless(mc_pair_stateless_t pair){
718 if(xbt_dynar_is_empty(reached_pairs)){
724 xbt_sha((const char*)&pair, hash);
725 XBT_DEBUG("Hash : %s", hash);
726 if(xbt_dynar_member(reached_pairs, hash)){
727 XBT_DEBUG("Pair already reached");
737 void set_pair_stateless_reached(mc_pair_stateless_t pair){
741 xbt_sha((const char*)&pair, hash);
742 XBT_DEBUG("Hash to pushed %s", hash);
743 if(strcmp(hash, "da39a3ee5e6b4b0d3255bfef95601890afd80709") == 0){
744 XBT_DEBUG("Error in hash, pair empty !");
748 xbt_dynar_push(reached_pairs, &hash);
754 void MC_ddfs_stateless_init(xbt_automaton_t a){
756 XBT_DEBUG("**************************************************");
757 XBT_DEBUG("Double-DFS stateless init");
758 XBT_DEBUG("**************************************************");
760 mc_pair_stateless_t mc_initial_pair = NULL;
761 mc_state_t initial_graph_state = NULL;
762 smx_process_t process;
764 MC_wait_for_requests();
767 initial_graph_state = MC_state_pair_new();
768 xbt_swag_foreach(process, simix_global->process_list){
769 if(MC_process_is_enabled(process)){
770 MC_state_interleave_process(initial_graph_state, process);
774 reached_pairs = xbt_dynar_new(sizeof(char *), NULL);
777 unsigned int cursor = 0;
780 xbt_dynar_foreach(a->states, cursor, state){
781 if(state->type == -1){
784 mc_initial_pair = new_pair_stateless(initial_graph_state, state);
785 xbt_fifo_unshift(mc_stack_liveness_stateless, mc_initial_pair);
787 initial_snapshot = xbt_new0(s_mc_snapshot_t, 1);
788 MC_take_snapshot(initial_snapshot);
793 MC_ddfs_stateless(a, 0, 0);
795 MC_restore_snapshot(initial_snapshot);
797 MC_ddfs_stateless(a, 0, 0);
800 if(state->type == 2){
803 mc_initial_pair = new_pair_stateless(initial_graph_state, state);
804 xbt_fifo_unshift(mc_stack_liveness_stateless, mc_initial_pair);
806 initial_snapshot = xbt_new0(s_mc_snapshot_t, 1);
807 MC_take_snapshot(initial_snapshot);
812 MC_ddfs_stateless(a, 1, 0);
814 MC_restore_snapshot(initial_snapshot);
816 MC_ddfs_stateless(a, 1, 0);
825 void MC_ddfs_stateless(xbt_automaton_t a, int search_cycle, int replay){
827 smx_process_t process;
828 mc_pair_stateless_t current_pair = NULL;
830 if(xbt_fifo_size(mc_stack_liveness_stateless) == 0)
834 MC_replay_liveness(mc_stack_liveness_stateless);
835 current_pair = (mc_pair_stateless_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateless));
836 xbt_swag_foreach(process, simix_global->process_list){
837 if(MC_process_is_enabled(process)){
838 MC_state_interleave_process(current_pair->graph_state, process);
843 /* Get current state */
844 current_pair = (mc_pair_stateless_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateless));
846 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateless), search_cycle);
847 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));
850 mc_stats_pair->visited_pairs++;
853 mc_state_t next_graph_state = NULL;
854 smx_req_t req = NULL;
857 xbt_transition_t transition_succ;
858 unsigned int cursor = 0;
861 mc_pair_stateless_t next_pair = NULL;
862 mc_pair_stateless_t pair_succ;
864 xbt_dynar_t successors = NULL;
867 successors = xbt_dynar_new(sizeof(mc_pair_stateless_t), NULL);
870 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
873 /* Debug information */
874 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
875 req_str = MC_request_to_string(req, value);
876 XBT_DEBUG("Execute: %s", req_str);
882 MC_state_set_executed_request(current_pair->graph_state, req, value);
884 /* Answer the request */
885 SIMIX_request_pre(req, value);
887 /* Wait for requests (schedules processes) */
888 MC_wait_for_requests();
892 /* Create the new expanded graph_state */
894 next_graph_state = MC_state_pair_new();
896 /* Get enabled process and insert it in the interleave set of the next graph_state */
897 xbt_swag_foreach(process, simix_global->process_list){
898 if(MC_process_is_enabled(process)){
899 MC_state_interleave_process(next_graph_state, process);
903 xbt_dynar_reset(successors);
910 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
912 res = MC_automaton_evaluate_label(a, transition_succ->label);
914 if(res == 1){ // enabled transition in automaton
916 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst);
917 xbt_dynar_push(successors, &next_pair);
925 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
927 res = MC_automaton_evaluate_label(a, transition_succ->label);
929 if(res == 2){ // enabled transition in automaton
931 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst);
932 xbt_dynar_push(successors, &next_pair);
939 if(xbt_dynar_length(successors) == 0){
941 next_pair = new_pair_stateless(next_graph_state, current_pair->automaton_state);
942 xbt_dynar_push(successors, &next_pair);
950 xbt_dynar_foreach(successors, cursor, pair_succ){
952 if((search_cycle == 1) && (reached_stateless(pair_succ) == 1)){
953 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
954 XBT_INFO("| ACCEPTANCE CYCLE |");
955 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
956 XBT_INFO("Counter-example that violates formula :");
957 MC_show_stack_liveness_stateless(mc_stack_liveness_stateless);
958 MC_dump_stack_liveness_stateless(mc_stack_liveness_stateless);
959 MC_print_statistics_pairs(mc_stats_pair);
964 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
967 MC_ddfs_stateless(a, search_cycle, 0);
970 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
972 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
973 set_pair_stateless_reached(pair_succ);
976 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
979 MC_ddfs_stateless(a, 1, 1);
982 xbt_dynar_pop(reached_pairs, NULL);
987 if(MC_state_interleave_size(current_pair->graph_state) > 0){
988 XBT_DEBUG("Backtracking to depth %u", xbt_fifo_size(mc_stack_liveness_stateless));
989 MC_replay_liveness(mc_stack_liveness_stateless);
995 xbt_fifo_shift(mc_stack_liveness_stateless);
996 XBT_DEBUG("Pair (graph=%p, automaton =%p, search_cycle = %u) shifted in stack", current_pair->graph_state, current_pair->automaton_state, search_cycle);