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(xbt_automaton_t a){
24 if(xbt_dynar_is_empty(reached_pairs)){
29 mc_pair_reached_t pair = NULL;
30 pair = xbt_new0(s_mc_pair_reached_t, 1);
31 pair->automaton_state = a->current_state;
32 pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
34 /* Get values of propositional symbols */
35 unsigned int cursor = 0;
36 xbt_propositional_symbol_t ps = NULL;
37 xbt_dynar_foreach(a->propositional_symbols, cursor, ps){
38 int (*f)() = ps->function;
40 xbt_dynar_push(pair->prop_ato, &res);
44 mc_pair_reached_t pair_test;
45 //int size = xbt_dynar_length(pair->prop_ato);
48 xbt_dynar_foreach(reached_pairs, cursor, pair_test){
49 /*if(memcmp(pair_test->automaton_state, pair->automaton_state, sizeof(xbt_state_t)) == 0){
50 for(i=0; i< size; i++){
51 d1 = xbt_dynar_get_as(pair->prop_ato, i, int);
52 d2 = xbt_dynar_get_as(pair_test->prop_ato, i, int);
60 if(memcmp(pair_test, pair, sizeof(mc_pair_reached_t)) == 0){
72 int set_pair_reached(xbt_automaton_t a){
78 mc_pair_reached_t pair = NULL;
79 pair = xbt_new0(s_mc_pair_reached_t, 1);
80 pair->automaton_state = a->current_state;
81 pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
83 /* Get values of propositional symbols */
84 unsigned int cursor = 0;
85 xbt_propositional_symbol_t ps = NULL;
86 xbt_dynar_foreach(a->propositional_symbols, cursor, ps){
87 int (*f)() = ps->function;
89 xbt_dynar_push(pair->prop_ato, &res);
92 xbt_dynar_push(reached_pairs, &pair);
103 void MC_pair_delete(mc_pair_t pair){
104 xbt_free(pair->graph_state->proc_status);
105 xbt_free(pair->graph_state);
106 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
111 int MC_automaton_evaluate_label(xbt_automaton_t a, xbt_exp_label_t l){
115 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
116 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
117 return (left_res || right_res);
121 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
122 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
123 return (left_res && right_res);
127 int res = MC_automaton_evaluate_label(a, l->u.exp_not);
132 unsigned int cursor = 0;
133 xbt_propositional_symbol_t p = NULL;
134 xbt_dynar_foreach(a->propositional_symbols, cursor, p){
135 if(strcmp(p->pred, l->u.predicat) == 0){
136 int (*f)() = p->function;
154 /******************************* DFS with visited state *******************************/
156 xbt_dynar_t visited_pairs;
158 void set_pair_visited(mc_pair_t pair, int sc){
161 mc_visited_pair_t p = NULL;
162 p = xbt_new0(s_mc_visited_pair_t, 1);
164 p->search_cycle = sc;
166 xbt_sha((const char *)&p, hash);
167 xbt_dynar_push(visited_pairs, &hash);
172 int visited(mc_pair_t pair, int sc){
176 mc_visited_pair_t p = NULL;
177 p = xbt_new0(s_mc_visited_pair_t, 1);
179 p->search_cycle = sc;
181 xbt_sha((const char *)&p, hash);
182 if(xbt_dynar_member(visited_pairs, hash)){
192 void MC_vddfs_stateful_init(xbt_automaton_t a){
194 XBT_DEBUG("**************************************************");
195 XBT_DEBUG("Double-DFS stateful with visited state init");
196 XBT_DEBUG("**************************************************");
198 mc_pair_t mc_initial_pair;
199 mc_state_t initial_graph_state;
200 smx_process_t process;
201 mc_snapshot_t init_snapshot;
203 MC_wait_for_requests();
207 init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
209 initial_graph_state = MC_state_pair_new();
210 xbt_swag_foreach(process, simix_global->process_list){
211 if(MC_process_is_enabled(process)){
212 MC_state_interleave_process(initial_graph_state, process);
216 visited_pairs = xbt_dynar_new(sizeof(char *), NULL);
217 reached_pairs = xbt_dynar_new(sizeof(mc_pair_reached_t), NULL);
219 MC_take_snapshot(init_snapshot);
223 unsigned int cursor = 0;
224 xbt_state_t state = NULL;
226 xbt_dynar_foreach(a->states, cursor, state){
227 if(state->type == -1){
230 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
231 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
235 MC_vddfs_stateful(a, 0, 0);
237 MC_restore_snapshot(init_snapshot);
239 MC_vddfs_stateful(a, 0, 0);
242 if(state->type == 2){
245 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
246 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
250 MC_vddfs_stateful(a, 1, 0);
252 MC_restore_snapshot(init_snapshot);
254 MC_vddfs_stateful(a, 1, 0);
262 void MC_vddfs_stateful(xbt_automaton_t a, int search_cycle, int restore){
264 smx_process_t process = NULL;
267 if(xbt_fifo_size(mc_stack_liveness_stateful) == 0)
271 MC_restore_snapshot(((mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful)))->system_state);
276 /* Get current state */
277 mc_pair_t current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
280 xbt_swag_foreach(process, simix_global->process_list){
281 if(MC_process_is_enabled(process)){
282 MC_state_interleave_process(current_pair->graph_state, process);
287 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateful), search_cycle);
288 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));
290 a->current_state = current_pair->automaton_state;
292 mc_stats_pair->visited_pairs++;
295 mc_state_t next_graph_state = NULL;
296 smx_req_t req = NULL;
300 xbt_transition_t transition_succ;
304 xbt_dynar_t successors = NULL;
306 mc_pair_t next_pair = NULL;
307 mc_snapshot_t next_snapshot = NULL;
308 mc_snapshot_t current_snapshot = NULL;
309 mc_pair_t pair_succ = NULL;
312 successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
316 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
319 current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
320 MC_take_snapshot(current_snapshot);
324 /* Debug information */
325 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
326 req_str = MC_request_to_string(req, value);
327 XBT_DEBUG("Execute: %s", req_str);
331 MC_state_set_executed_request(current_pair->graph_state, req, value);
333 /* Answer the request */
334 SIMIX_request_pre(req, value);
336 /* Wait for requests (schedules processes) */
337 MC_wait_for_requests();
340 /* Create the new expanded graph_state */
343 next_graph_state = MC_state_pair_new();
345 /* Get enabled process and insert it in the interleave set of the next graph_state */
346 xbt_swag_foreach(process, simix_global->process_list){
347 if(MC_process_is_enabled(process)){
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);
355 xbt_dynar_reset(successors);
360 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
362 res = MC_automaton_evaluate_label(a, transition_succ->label);
366 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
367 xbt_dynar_push(successors, &next_pair);
373 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
375 res = MC_automaton_evaluate_label(a, transition_succ->label);
379 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
380 xbt_dynar_push(successors, &next_pair);
387 if(xbt_dynar_length(successors) == 0){
390 next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state);
391 xbt_dynar_push(successors, &next_pair);
397 //XBT_DEBUG("Successors length %lu", xbt_dynar_length(successors));
401 xbt_dynar_foreach(successors, cursor, pair_succ){
403 /*XBT_DEBUG("Search reached pair %p : graph=%p, automaton=%p", pair_succ, pair_succ->graph_state, pair_succ->automaton_state);
405 XBT_DEBUG("Const char pair %s", (const char *)&pair_succ);
406 xbt_sha((const char *)&pair_succ, hash);
407 XBT_DEBUG("Hash pair_succ %s", hash);*/
409 if((search_cycle == 1) && (reached(a) == 1)){
410 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
411 XBT_INFO("| ACCEPTANCE CYCLE |");
412 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
413 XBT_INFO("Counter-example that violates formula :");
414 MC_show_stack_liveness_stateful(mc_stack_liveness_stateful);
415 MC_dump_stack_liveness_stateful(mc_stack_liveness_stateful);
416 MC_print_statistics_pairs(mc_stats_pair);
420 XBT_DEBUG("Search visited pair %p : graph %p, automaton %p", pair_succ, pair_succ->graph_state, pair_succ->automaton_state);
422 if(visited(pair_succ, search_cycle) == 0){
424 //mc_stats_pair->executed_transitions++;
425 set_pair_visited(pair_succ, search_cycle);
428 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
431 MC_vddfs_stateful(a, search_cycle, 0);
433 //XBT_DEBUG("Pair (graph=%p, automaton=%p) expanded", pair_succ->graph_state, pair_succ->automaton_state);
435 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
437 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
438 int res = set_pair_reached(a);
441 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
444 MC_vddfs_stateful(a, 1, 1);
448 xbt_dynar_pop(reached_pairs, NULL);
456 XBT_DEBUG("Pair already visited !");
462 if(MC_state_interleave_size(current_pair->graph_state) > 0){
463 MC_restore_snapshot(current_snapshot);
471 xbt_fifo_shift(mc_stack_liveness_stateful);
472 XBT_DEBUG("Pair (graph=%p, automaton =%p) shifted in stack", current_pair->graph_state, current_pair->automaton_state);
481 /********************* Double-DFS stateful without visited state *******************/
484 void MC_ddfs_stateful_init(xbt_automaton_t a){
486 XBT_DEBUG("**************************************************");
487 XBT_DEBUG("Double-DFS stateful without visited state init");
488 XBT_DEBUG("**************************************************");
490 mc_pair_t mc_initial_pair;
491 mc_state_t initial_graph_state;
492 smx_process_t process;
493 mc_snapshot_t init_snapshot;
495 MC_wait_for_requests();
499 init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
501 initial_graph_state = MC_state_pair_new();
502 xbt_swag_foreach(process, simix_global->process_list){
503 if(MC_process_is_enabled(process)){
504 MC_state_interleave_process(initial_graph_state, process);
508 reached_pairs = xbt_dynar_new(sizeof(mc_pair_reached_t), NULL);
510 MC_take_snapshot(init_snapshot);
514 unsigned int cursor = 0;
515 xbt_state_t state = NULL;
517 xbt_dynar_foreach(a->states, cursor, state){
518 if(state->type == -1){
521 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
522 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
526 MC_ddfs_stateful(a, 0, 0);
528 MC_restore_snapshot(init_snapshot);
530 MC_ddfs_stateful(a, 0, 0);
533 if(state->type == 2){
536 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
537 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
541 MC_ddfs_stateful(a, 1, 0);
543 MC_restore_snapshot(init_snapshot);
545 MC_ddfs_stateful(a, 1, 0);
553 void MC_ddfs_stateful(xbt_automaton_t a, int search_cycle, int restore){
555 smx_process_t process = NULL;
556 mc_pair_t current_pair = NULL;
558 if(xbt_fifo_size(mc_stack_liveness_stateful) == 0)
562 current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
563 MC_restore_snapshot(current_pair->system_state);
564 xbt_swag_foreach(process, simix_global->process_list){
565 if(MC_process_is_enabled(process)){
566 MC_state_interleave_process(current_pair->graph_state, process);
572 /* Get current state */
573 current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
576 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateful), search_cycle);
577 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));
579 a->current_state = current_pair->automaton_state;
581 mc_stats_pair->visited_pairs++;
584 mc_state_t next_graph_state = NULL;
585 smx_req_t req = NULL;
589 xbt_transition_t transition_succ;
593 xbt_dynar_t successors = NULL;
595 mc_pair_t next_pair = NULL;
596 mc_snapshot_t next_snapshot = NULL;
597 mc_snapshot_t current_snapshot = NULL;
601 successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
604 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
607 current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
608 MC_take_snapshot(current_snapshot);
612 /* Debug information */
613 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
614 req_str = MC_request_to_string(req, value);
615 XBT_DEBUG("Execute: %s", req_str);
619 MC_state_set_executed_request(current_pair->graph_state, req, value);
621 /* Answer the request */
622 SIMIX_request_pre(req, value);
624 /* Wait for requests (schedules processes) */
625 MC_wait_for_requests();
628 /* Create the new expanded graph_state */
631 next_graph_state = MC_state_pair_new();
633 /* Get enabled process and insert it in the interleave set of the next graph_state */
634 xbt_swag_foreach(process, simix_global->process_list){
635 if(MC_process_is_enabled(process)){
636 MC_state_interleave_process(next_graph_state, process);
640 next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
641 MC_take_snapshot(next_snapshot);
643 xbt_dynar_reset(successors);
649 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
651 res = MC_automaton_evaluate_label(a, transition_succ->label);
653 if(res == 1){ // enabled transition in automaton
655 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
656 xbt_dynar_push(successors, &next_pair);
663 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
665 res = MC_automaton_evaluate_label(a, transition_succ->label);
667 if(res == 2){ // transition always enabled in automaton
669 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
670 xbt_dynar_push(successors, &next_pair);
678 if(xbt_dynar_length(successors) == 0){
681 next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state);
682 xbt_dynar_push(successors, &next_pair);
687 //XBT_DEBUG("Successors in automaton %lu", xbt_dynar_length(successors));
690 xbt_dynar_foreach(successors, cursor, pair_succ){
692 //XBT_DEBUG("Search visited pair : graph=%p, automaton=%p", pair_succ->graph_state, pair_succ->automaton_state);
694 if((search_cycle == 1) && (reached(a) == 1)){
695 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
696 XBT_INFO("| ACCEPTANCE CYCLE |");
697 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
698 XBT_INFO("Counter-example that violates formula :");
699 MC_show_stack_liveness_stateful(mc_stack_liveness_stateful);
700 MC_dump_stack_liveness_stateful(mc_stack_liveness_stateful);
701 MC_print_statistics_pairs(mc_stats_pair);
705 //mc_stats_pair->executed_transitions++;
708 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
711 MC_ddfs_stateful(a, search_cycle, 0);
714 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
716 int res = set_pair_reached(a);
717 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
720 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
723 MC_ddfs_stateful(a, 1, 1);
727 xbt_dynar_pop(reached_pairs, NULL);
734 if(MC_state_interleave_size(current_pair->graph_state) > 0){
735 XBT_DEBUG("Backtracking to depth %u", xbt_fifo_size(mc_stack_liveness_stateful));
736 MC_restore_snapshot(current_snapshot);
744 xbt_fifo_shift(mc_stack_liveness_stateful);
745 XBT_DEBUG("Pair (graph=%p, automaton =%p) shifted in stack", current_pair->graph_state, current_pair->automaton_state);
752 /********************* Double-DFS stateless *******************/
754 void MC_pair_stateless_delete(mc_pair_stateless_t pair){
755 xbt_free(pair->graph_state->proc_status);
756 xbt_free(pair->graph_state);
757 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
761 mc_pair_stateless_t new_pair_stateless(mc_state_t sg, xbt_state_t st){
762 mc_pair_stateless_t p = NULL;
763 p = xbt_new0(s_mc_pair_stateless_t, 1);
764 p->automaton_state = st;
766 mc_stats_pair->expanded_pairs++;
772 void MC_ddfs_stateless_init(xbt_automaton_t a){
774 XBT_DEBUG("**************************************************");
775 XBT_DEBUG("Double-DFS stateless init");
776 XBT_DEBUG("**************************************************");
778 mc_pair_stateless_t mc_initial_pair = NULL;
779 mc_state_t initial_graph_state = NULL;
780 smx_process_t process;
782 MC_wait_for_requests();
785 initial_graph_state = MC_state_pair_new();
786 xbt_swag_foreach(process, simix_global->process_list){
787 if(MC_process_is_enabled(process)){
788 MC_state_interleave_process(initial_graph_state, process);
792 reached_pairs = xbt_dynar_new(sizeof(mc_pair_reached_t), NULL);
794 initial_snapshot = xbt_new0(s_mc_snapshot_t, 1);
795 MC_take_snapshot(initial_snapshot);
799 unsigned int cursor = 0;
802 xbt_dynar_foreach(a->states, cursor, state){
803 if(state->type == -1){
806 mc_initial_pair = new_pair_stateless(initial_graph_state, state);
807 xbt_fifo_unshift(mc_stack_liveness_stateless, mc_initial_pair);
811 MC_ddfs_stateless(a, 0, 0);
813 MC_restore_snapshot(initial_snapshot);
815 MC_ddfs_stateless(a, 0, 0);
818 if(state->type == 2){
821 mc_initial_pair = new_pair_stateless(initial_graph_state, state);
822 xbt_fifo_unshift(mc_stack_liveness_stateless, mc_initial_pair);
826 MC_ddfs_stateless(a, 1, 0);
828 MC_restore_snapshot(initial_snapshot);
830 MC_ddfs_stateless(a, 1, 0);
839 void MC_ddfs_stateless(xbt_automaton_t a, int search_cycle, int replay){
841 smx_process_t process;
842 mc_pair_stateless_t current_pair = NULL;
844 if(xbt_fifo_size(mc_stack_liveness_stateless) == 0)
848 MC_replay_liveness(mc_stack_liveness_stateless);
849 current_pair = (mc_pair_stateless_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateless));
850 xbt_swag_foreach(process, simix_global->process_list){
851 if(MC_process_is_enabled(process)){
852 MC_state_interleave_process(current_pair->graph_state, process);
857 /* Get current state */
858 current_pair = (mc_pair_stateless_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateless));
860 /* Update current state in automaton */
861 a->current_state = current_pair->automaton_state;
863 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateless), search_cycle);
864 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));
867 mc_stats_pair->visited_pairs++;
870 mc_state_t next_graph_state = NULL;
871 smx_req_t req = NULL;
874 xbt_transition_t transition_succ;
875 unsigned int cursor = 0;
878 mc_pair_stateless_t next_pair = NULL;
879 mc_pair_stateless_t pair_succ;
881 xbt_dynar_t successors = NULL;
884 successors = xbt_dynar_new(sizeof(mc_pair_stateless_t), NULL);
887 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
890 /* Debug information */
891 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
892 req_str = MC_request_to_string(req, value);
893 XBT_DEBUG("Execute: %s", req_str);
899 MC_state_set_executed_request(current_pair->graph_state, req, value);
901 /* Answer the request */
902 SIMIX_request_pre(req, value);
904 /* Wait for requests (schedules processes) */
905 MC_wait_for_requests();
910 /* Create the new expanded graph_state */
911 next_graph_state = MC_state_pair_new();
913 /* Get enabled process and insert it in the interleave set of the next graph_state */
914 xbt_swag_foreach(process, simix_global->process_list){
915 if(MC_process_is_enabled(process)){
916 MC_state_interleave_process(next_graph_state, process);
920 xbt_dynar_reset(successors);
927 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
929 res = MC_automaton_evaluate_label(a, transition_succ->label);
931 if(res == 1){ // enabled transition in automaton
933 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst);
934 xbt_dynar_push(successors, &next_pair);
942 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
944 res = MC_automaton_evaluate_label(a, transition_succ->label);
946 if(res == 2){ // enabled transition in automaton
948 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst);
949 xbt_dynar_push(successors, &next_pair);
956 if(xbt_dynar_length(successors) == 0){
958 next_pair = new_pair_stateless(next_graph_state, current_pair->automaton_state);
959 xbt_dynar_push(successors, &next_pair);
967 xbt_dynar_foreach(successors, cursor, pair_succ){
969 if((search_cycle == 1) && (reached(a) == 1)){
970 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
971 XBT_INFO("| ACCEPTANCE CYCLE |");
972 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
973 XBT_INFO("Counter-example that violates formula :");
974 MC_show_stack_liveness_stateless(mc_stack_liveness_stateless);
975 MC_dump_stack_liveness_stateless(mc_stack_liveness_stateless);
976 MC_print_statistics_pairs(mc_stats_pair);
981 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
984 MC_ddfs_stateless(a, search_cycle, 0);
987 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
989 XBT_DEBUG("Acceptance pair %p : graph=%p, automaton=%p(%s)", pair_succ, pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
990 int res = set_pair_reached(a);
993 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
996 MC_ddfs_stateless(a, 1, 1);
1000 xbt_dynar_pop(reached_pairs, NULL);
1006 if(MC_state_interleave_size(current_pair->graph_state) > 0){
1007 XBT_DEBUG("Backtracking to depth %u", xbt_fifo_size(mc_stack_liveness_stateless));
1008 MC_replay_liveness(mc_stack_liveness_stateless);
1014 xbt_fifo_shift(mc_stack_liveness_stateless);
1015 XBT_DEBUG("Pair (graph=%p, automaton =%p, search_cycle = %u) shifted in stack", current_pair->graph_state, current_pair->automaton_state, search_cycle);