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 xbt_dynar_t successors = NULL;
10 extern mc_snapshot_t initial_snapshot;
12 /* Global variables for stateless algorithm */
13 mc_snapshot_t snapshot = NULL;
15 /* Global variables for stateful algorithm */
16 mc_snapshot_t next_snapshot = NULL;
17 mc_snapshot_t current_snapshot = NULL;
20 mc_pair_t new_pair(mc_snapshot_t sn, mc_state_t sg, xbt_state_t st){
22 p = xbt_new0(s_mc_pair_t, 1);
24 p->automaton_state = st;
26 mc_stats_pair->expanded_pairs++;
31 int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
33 if(s1->num_reg != s2->num_reg)
38 for(i=0 ; i< s1->num_reg ; i++){
40 if(s1->regions[i]->size != s2->regions[i]->size)
43 if(s1->regions[i]->start_addr != s2->regions[i]->start_addr)
46 if(s1->regions[i]->type != s2->regions[i]->type)
49 if(s1->regions[i]->type == 0){
50 if(mmalloc_compare_heap(s1->regions[i]->start_addr, s2->regions[i]->start_addr)){
51 XBT_DEBUG("Different heap (mmalloc_compare)");
56 if(memcmp(s1->regions[i]->data, s2->regions[i]->data, s1->regions[i]->size) != 0){
57 XBT_DEBUG("Different memcmp for data in libsimgrid");
70 int reached(xbt_automaton_t a, xbt_state_t st, mc_snapshot_t s){
73 if(xbt_dynar_is_empty(reached_pairs)){
78 xbt_dynar_t prop_ato = xbt_dynar_new(sizeof(int), NULL);
80 /* Get values of propositional symbols */
81 unsigned int cursor = 0;
82 xbt_propositional_symbol_t ps = NULL;
83 xbt_dynar_foreach(a->propositional_symbols, cursor, ps){
84 int (*f)() = ps->function;
86 xbt_dynar_push_as(prop_ato, int, res);
90 mc_pair_reached_t pair_test;
92 xbt_dynar_foreach(reached_pairs, cursor, pair_test){
93 if(automaton_state_compare(pair_test->automaton_state, st) == 0){
94 if(propositional_symbols_compare_value(pair_test->prop_ato, prop_ato) == 0){
95 if(snapshot_compare(pair_test->system_state, s) == 0){
109 void set_pair_reached(xbt_automaton_t a, xbt_state_t st, mc_snapshot_t sn){
114 mc_pair_reached_t pair = NULL;
115 pair = xbt_new0(s_mc_pair_reached_t, 1);
116 pair->automaton_state = st;
117 pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
118 pair->system_state = sn;
120 /* Get values of propositional symbols */
121 unsigned int cursor = 0;
122 xbt_propositional_symbol_t ps = NULL;
123 xbt_dynar_foreach(a->propositional_symbols, cursor, ps){
124 int (*f)() = ps->function;
126 xbt_dynar_push_as(pair->prop_ato, int, res);
129 xbt_dynar_push(reached_pairs, &pair);
136 void MC_pair_delete(mc_pair_t pair){
137 xbt_free(pair->graph_state->proc_status);
138 xbt_free(pair->graph_state);
139 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
145 int MC_automaton_evaluate_label(xbt_automaton_t a, xbt_exp_label_t l){
149 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
150 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
151 return (left_res || right_res);
155 int left_res = MC_automaton_evaluate_label(a, l->u.or_and.left_exp);
156 int right_res = MC_automaton_evaluate_label(a, l->u.or_and.right_exp);
157 return (left_res && right_res);
161 int res = MC_automaton_evaluate_label(a, l->u.exp_not);
166 unsigned int cursor = 0;
167 xbt_propositional_symbol_t p = NULL;
168 xbt_dynar_foreach(a->propositional_symbols, cursor, p){
169 if(strcmp(p->pred, l->u.predicat) == 0){
170 int (*f)() = p->function;
190 /********************* Double-DFS stateless *******************/
192 void MC_pair_stateless_delete(mc_pair_stateless_t pair){
193 xbt_free(pair->graph_state->proc_status);
194 xbt_free(pair->graph_state);
195 //xbt_free(pair->automaton_state); -> FIXME : à implémenter
199 mc_pair_stateless_t new_pair_stateless(mc_state_t sg, xbt_state_t st, int r){
200 mc_pair_stateless_t p = NULL;
201 p = xbt_new0(s_mc_pair_stateless_t, 1);
202 p->automaton_state = st;
205 mc_stats_pair->expanded_pairs++;
211 void MC_ddfs_stateless_init(xbt_automaton_t a){
213 XBT_DEBUG("**************************************************");
214 XBT_DEBUG("Double-DFS stateless init");
215 XBT_DEBUG("**************************************************");
217 mc_pair_stateless_t mc_initial_pair = NULL;
218 mc_state_t initial_graph_state = NULL;
219 smx_process_t process;
221 MC_wait_for_requests();
225 initial_graph_state = MC_state_pair_new();
226 xbt_swag_foreach(process, simix_global->process_list){
227 if(MC_process_is_enabled(process)){
228 MC_state_interleave_process(initial_graph_state, process);
232 reached_pairs = xbt_dynar_new(sizeof(mc_pair_reached_t), NULL);
233 successors = xbt_dynar_new(sizeof(mc_pair_stateless_t), NULL);
234 snapshot = xbt_new0(s_mc_snapshot_t, 1);
236 initial_snapshot = xbt_new0(s_mc_snapshot_t, 1);
237 MC_take_snapshot(initial_snapshot);
241 unsigned int cursor = 0;
244 xbt_dynar_foreach(a->states, cursor, state){
245 if(state->type == -1){
248 mc_initial_pair = new_pair_stateless(initial_graph_state, state, MC_state_interleave_size(initial_graph_state));
249 xbt_fifo_unshift(mc_stack_liveness_stateless, mc_initial_pair);
253 MC_ddfs_stateless(a, 0, 0);
255 MC_restore_snapshot(initial_snapshot);
257 MC_ddfs_stateless(a, 0, 0);
260 if(state->type == 2){
263 mc_initial_pair = new_pair_stateless(initial_graph_state, state, MC_state_interleave_size(initial_graph_state));
264 xbt_fifo_unshift(mc_stack_liveness_stateless, mc_initial_pair);
268 MC_ddfs_stateless(a, 1, 0);
270 MC_restore_snapshot(initial_snapshot);
272 MC_ddfs_stateless(a, 1, 0);
281 void MC_ddfs_stateless(xbt_automaton_t a, int search_cycle, int replay){
283 smx_process_t process;
284 mc_pair_stateless_t current_pair = NULL;
286 if(xbt_fifo_size(mc_stack_liveness_stateless) == 0)
290 MC_replay_liveness(mc_stack_liveness_stateless);
291 current_pair = (mc_pair_stateless_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateless));
292 xbt_swag_foreach(process, simix_global->process_list){
293 if(MC_process_is_enabled(process)){
294 MC_state_interleave_process(current_pair->graph_state, process);
299 /* Get current pair */
300 current_pair = (mc_pair_stateless_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateless));
302 /* Update current state in buchi automaton */
303 a->current_state = current_pair->automaton_state;
306 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateless), search_cycle);
307 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));
310 mc_stats_pair->visited_pairs++;
313 mc_state_t next_graph_state = NULL;
314 smx_req_t req = NULL;
317 xbt_transition_t transition_succ;
318 unsigned int cursor = 0;
321 mc_pair_stateless_t next_pair = NULL;
322 mc_pair_stateless_t pair_succ;
325 if(MC_state_interleave_size(current_pair->graph_state) > 0){
327 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL && (xbt_fifo_size(mc_stack_liveness_stateless) < MAX_DEPTH_LIVENESS)){
329 /* Debug information */
330 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
331 req_str = MC_request_to_string(req, value);
332 XBT_DEBUG("Execute: %s", req_str);
338 MC_state_set_executed_request(current_pair->graph_state, req, value);
340 /* Answer the request */
341 SIMIX_request_pre(req, value);
343 /* Wait for requests (schedules processes) */
344 MC_wait_for_requests();
349 /* Create the new expanded graph_state */
350 next_graph_state = MC_state_pair_new();
352 /* Get enabled process and insert it in the interleave set of the next graph_state */
353 xbt_swag_foreach(process, simix_global->process_list){
354 if(MC_process_is_enabled(process)){
355 MC_state_interleave_process(next_graph_state, process);
359 xbt_dynar_reset(successors);
365 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
367 res = MC_automaton_evaluate_label(a, transition_succ->label);
369 if(res == 1){ // enabled transition in automaton
371 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
372 xbt_dynar_push(successors, &next_pair);
380 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
382 res = MC_automaton_evaluate_label(a, transition_succ->label);
384 if(res == 2){ // true transition in automaton
386 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
387 xbt_dynar_push(successors, &next_pair);
394 if(xbt_dynar_length(successors) == 0){
396 next_pair = new_pair_stateless(next_graph_state, current_pair->automaton_state, MC_state_interleave_size(next_graph_state));
397 xbt_dynar_push(successors, &next_pair);
403 xbt_dynar_foreach(successors, cursor, pair_succ){
407 if((search_cycle == 1) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2)) ){
410 MC_take_snapshot(snapshot);
413 if(reached(a, pair_succ->automaton_state, snapshot) == 1){
415 XBT_DEBUG("Next pair (depth = %d) already reached !", xbt_fifo_size(mc_stack_liveness_stateless) + 1);
417 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
418 XBT_INFO("| ACCEPTANCE CYCLE |");
419 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
420 XBT_INFO("Counter-example that violates formula :");
421 MC_show_stack_liveness_stateless(mc_stack_liveness_stateless);
422 MC_dump_stack_liveness_stateless(mc_stack_liveness_stateless);
423 MC_print_statistics_pairs(mc_stats_pair);
429 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
430 XBT_DEBUG("Take snapshot of acceptance pair (depth = %d)", xbt_fifo_size(mc_stack_liveness_stateless) + 1 );
432 MC_take_snapshot(snapshot);
437 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
440 MC_ddfs_stateless(a, search_cycle, 0);
443 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
445 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
448 set_pair_reached(a, pair_succ->automaton_state, snapshot);
451 /* Pair shifted from stack when first MC_ddfs finished and returned at this point */
453 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
456 MC_ddfs_stateless(a, 1, 1);
458 /* No acceptance cycle with this acceptance pair, we remove it from the list reached_pairs */
460 xbt_dynar_pop(reached_pairs, NULL);
467 XBT_DEBUG("Backtracking to depth %u", xbt_fifo_size(mc_stack_liveness_stateless));
468 MC_replay_liveness(mc_stack_liveness_stateless);
473 }else{ /*No request to execute, search evolution in Büchi automaton */
475 if((xbt_fifo_size(mc_stack_liveness_stateless) < MAX_DEPTH_LIVENESS)){
477 // MC_state_set_executed_request(current_pair->graph_state, NULL, value);
479 /* Answer the request */
480 //SIMIX_request_pre(req, value);
482 /* Wait for requests (schedules processes) */
483 //MC_wait_for_requests();
487 /* Create the new expanded graph_state */
488 next_graph_state = MC_state_pair_new();
490 xbt_dynar_reset(successors);
496 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
498 res = MC_automaton_evaluate_label(a, transition_succ->label);
500 if(res == 1){ // enabled transition in automaton
502 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
503 xbt_dynar_push(successors, &next_pair);
511 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
513 res = MC_automaton_evaluate_label(a, transition_succ->label);
515 if(res == 2){ // true transition in automaton
517 next_pair = new_pair_stateless(next_graph_state, transition_succ->dst, MC_state_interleave_size(next_graph_state));
518 xbt_dynar_push(successors, &next_pair);
525 if(xbt_dynar_length(successors) == 0){
527 next_pair = new_pair_stateless(next_graph_state, current_pair->automaton_state, MC_state_interleave_size(next_graph_state));
528 xbt_dynar_push(successors, &next_pair);
534 xbt_dynar_foreach(successors, cursor, pair_succ){
536 if((search_cycle == 1) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2)) ){
539 MC_take_snapshot(snapshot);
542 if(reached(a, pair_succ->automaton_state, snapshot) == 1){
544 XBT_DEBUG("Next pair (depth = %d) already reached !", xbt_fifo_size(mc_stack_liveness_stateless) + 1);
546 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
547 XBT_INFO("| ACCEPTANCE CYCLE |");
548 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
549 XBT_INFO("Counter-example that violates formula :");
550 MC_show_stack_liveness_stateless(mc_stack_liveness_stateless);
551 MC_dump_stack_liveness_stateless(mc_stack_liveness_stateless);
552 MC_print_statistics_pairs(mc_stats_pair);
558 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
559 XBT_DEBUG("Take snapshot of acceptance pair (depth = %d)", xbt_fifo_size(mc_stack_liveness_stateless) + 1 );
561 MC_take_snapshot(snapshot);
566 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
569 MC_ddfs_stateless(a, search_cycle, 0);
572 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
574 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
577 set_pair_reached(a, pair_succ->automaton_state, snapshot);
580 /* Pair shifted from stack when first MC_ddfs finished and returned at this point */
582 xbt_fifo_unshift(mc_stack_liveness_stateless, pair_succ);
585 MC_ddfs_stateless(a, 1, 1);
587 /* No acceptance cycle with this acceptance pair, we remove it from the list reached_pairs */
589 xbt_dynar_pop(reached_pairs, NULL);
599 xbt_fifo_shift(mc_stack_liveness_stateless);
600 XBT_DEBUG("Pair (graph=%p, automaton =%p, search_cycle = %u) shifted in stack", current_pair->graph_state, current_pair->automaton_state, search_cycle);
605 /********************* Double-DFS stateful without visited state *******************/
608 void MC_ddfs_stateful_init(xbt_automaton_t a){
610 XBT_DEBUG("**************************************************");
611 XBT_DEBUG("Double-DFS stateful without visited state init");
612 XBT_DEBUG("**************************************************");
614 mc_pair_t mc_initial_pair;
615 mc_state_t initial_graph_state;
616 smx_process_t process;
617 mc_snapshot_t init_snapshot;
619 MC_wait_for_requests();
623 initial_graph_state = MC_state_pair_new();
624 xbt_swag_foreach(process, simix_global->process_list){
625 if(MC_process_is_enabled(process)){
626 MC_state_interleave_process(initial_graph_state, process);
630 reached_pairs = xbt_dynar_new(sizeof(mc_pair_reached_t), NULL);
631 successors = xbt_dynar_new(sizeof(mc_pair_t), NULL);
632 current_snapshot = xbt_new0(s_mc_snapshot_t, 1);
633 next_snapshot = xbt_new0(s_mc_snapshot_t, 1);
635 init_snapshot = xbt_new0(s_mc_snapshot_t, 1);
636 MC_take_snapshot(init_snapshot);
640 unsigned int cursor = 0;
641 xbt_state_t state = NULL;
643 xbt_dynar_foreach(a->states, cursor, state){
644 if(state->type == -1){
647 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
648 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
652 MC_ddfs_stateful(a, 0, 0);
654 MC_restore_snapshot(init_snapshot);
656 MC_ddfs_stateful(a, 0, 0);
659 if(state->type == 2){
662 mc_initial_pair = new_pair(init_snapshot, initial_graph_state, state);
663 xbt_fifo_unshift(mc_stack_liveness_stateful, mc_initial_pair);
667 MC_ddfs_stateful(a, 1, 0);
669 MC_restore_snapshot(init_snapshot);
671 MC_ddfs_stateful(a, 1, 0);
679 void MC_ddfs_stateful(xbt_automaton_t a, int search_cycle, int restore){
681 smx_process_t process = NULL;
682 mc_pair_t current_pair = NULL;
684 if(xbt_fifo_size(mc_stack_liveness_stateful) == 0)
688 current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
689 MC_restore_snapshot(current_pair->system_state);
690 xbt_swag_foreach(process, simix_global->process_list){
691 if(MC_process_is_enabled(process)){
692 MC_state_interleave_process(current_pair->graph_state, process);
698 /* Get current state */
699 current_pair = (mc_pair_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack_liveness_stateful));
702 XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d )", xbt_fifo_size(mc_stack_liveness_stateful), search_cycle);
703 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));
705 a->current_state = current_pair->automaton_state;
709 mc_stats_pair->visited_pairs++;
712 mc_state_t next_graph_state = NULL;
713 smx_req_t req = NULL;
717 xbt_transition_t transition_succ;
721 mc_pair_t next_pair = NULL;
723 while((req = MC_state_get_request(current_pair->graph_state, &value)) != NULL){
726 MC_take_snapshot(current_snapshot);
729 /* Debug information */
730 if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
731 req_str = MC_request_to_string(req, value);
732 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));
733 XBT_DEBUG("Execute: %s", req_str);
737 MC_state_set_executed_request(current_pair->graph_state, req, value);
739 /* Answer the request */
740 SIMIX_request_pre(req, value);
742 /* Wait for requests (schedules processes) */
743 MC_wait_for_requests();
746 /* Create the new expanded graph_state */
749 next_graph_state = MC_state_pair_new();
751 /* Get enabled process and insert it in the interleave set of the next graph_state */
752 xbt_swag_foreach(process, simix_global->process_list){
753 if(MC_process_is_enabled(process)){
754 MC_state_interleave_process(next_graph_state, process);
758 MC_take_snapshot(next_snapshot);
760 xbt_dynar_reset(successors);
766 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
768 res = MC_automaton_evaluate_label(a, transition_succ->label);
770 if(res == 1){ // enabled transition in automaton
772 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
773 xbt_dynar_push(successors, &next_pair);
780 xbt_dynar_foreach(current_pair->automaton_state->out, cursor, transition_succ){
782 res = MC_automaton_evaluate_label(a, transition_succ->label);
784 if(res == 2){ // transition always enabled in automaton
786 next_pair = new_pair(next_snapshot,next_graph_state, transition_succ->dst);
787 xbt_dynar_push(successors, &next_pair);
795 if(xbt_dynar_length(successors) == 0){
798 next_pair = new_pair(next_snapshot, next_graph_state, current_pair->automaton_state);
799 xbt_dynar_push(successors, &next_pair);
805 xbt_dynar_foreach(successors, cursor, pair_succ){
807 if((search_cycle == 1) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
809 if(reached(a, pair_succ->automaton_state, next_snapshot) == 1){
810 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
811 XBT_INFO("| ACCEPTANCE CYCLE |");
812 XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
813 XBT_INFO("Counter-example that violates formula :");
814 MC_show_stack_liveness_stateful(mc_stack_liveness_stateful);
815 MC_dump_stack_liveness_stateful(mc_stack_liveness_stateful);
816 MC_print_statistics_pairs(mc_stats_pair);
823 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
826 MC_ddfs_stateful(a, search_cycle, 0);
829 if((search_cycle == 0) && ((pair_succ->automaton_state->type == 1) || (pair_succ->automaton_state->type == 2))){
831 XBT_DEBUG("Acceptance pair : graph=%p, automaton=%p(%s)", pair_succ->graph_state, pair_succ->automaton_state, pair_succ->automaton_state->id);
832 set_pair_reached(a, pair_succ->automaton_state, next_snapshot);
835 xbt_fifo_unshift(mc_stack_liveness_stateful, pair_succ);
838 MC_ddfs_stateful(a, 1, 0);
842 xbt_dynar_pop(reached_pairs, NULL);
848 if(MC_state_interleave_size(current_pair->graph_state) > 0){
849 XBT_DEBUG("Backtracking to depth %u", xbt_fifo_size(mc_stack_liveness_stateful));
850 MC_restore_snapshot(current_snapshot);
858 xbt_fifo_shift(mc_stack_liveness_stateful);
859 XBT_DEBUG("Pair (graph=%p, automaton =%p) shifted in stack", current_pair->graph_state, current_pair->automaton_state);