diff --git a/alib2algo/src/automaton/run/Run.cpp b/alib2algo/src/automaton/run/Run.cpp index e4f02210fa1af2396ce9c5a50de41f17ee46ba55..ed07148a2d87e7e580654b8fdbdecee757a22083 100644 --- a/alib2algo/src/automaton/run/Run.cpp +++ b/alib2algo/src/automaton/run/Run.cpp @@ -360,44 +360,48 @@ std::tuple < bool, State, std::set < unsigned >, std::deque < alphabet::Symbol > res = false; } - auto returnTransition = automaton.getReturnTransitions ( ).find ( std::make_tuple ( state, * symbolIter, pushdownStore.back ( ) ) ); + if ( !res ) { + auto returnTransition = automaton.getReturnTransitions ( ).find ( std::make_tuple ( state, * symbolIter, pushdownStore.back ( ) ) ); + + if ( returnTransition != automaton.getReturnTransitions ( ).end ( ) ) { + symbolIter++; + i++; + } else { + returnTransition = automaton.getReturnTransitions ( ).find ( std::make_tuple ( state, string::Epsilon::EPSILON, pushdownStore.back ( ) ) ); + } - if ( returnTransition != automaton.getReturnTransitions ( ).end ( ) ) { - symbolIter++; - i++; - } else { - returnTransition = automaton.getReturnTransitions ( ).find ( std::make_tuple ( state, string::Epsilon::EPSILON, pushdownStore.back ( ) ) ); + if ( returnTransition != automaton.getReturnTransitions ( ).end ( ) ) { + pushdownStore.pop_back ( ); + state = returnTransition->second; + } else { + res = false; + } } - if ( returnTransition != automaton.getReturnTransitions ( ).end ( ) ) { - pushdownStore.pop_back ( ); - state = returnTransition->second; - } else { - res = false; - } + if ( !res ) { + auto localTransition = automaton.getLocalTransitions ( ).find ( std::make_pair ( state, * symbolIter ) ); - auto localTransition = automaton.getLocalTransitions ( ).find ( std::make_pair ( state, * symbolIter ) ); + if ( localTransition != automaton.getLocalTransitions ( ).end ( ) ) { + symbolIter++; + i++; + } else { + localTransition = automaton.getLocalTransitions ( ).find ( std::make_pair ( state, string::Epsilon::EPSILON ) ); + } - if ( localTransition != automaton.getLocalTransitions ( ).end ( ) ) { - symbolIter++; - i++; - } else { - localTransition = automaton.getLocalTransitions ( ).find ( std::make_pair ( state, string::Epsilon::EPSILON ) ); + if ( localTransition != automaton.getLocalTransitions ( ).end ( ) ) + state = localTransition->second; + else + res = false; } - if ( localTransition != automaton.getLocalTransitions ( ).end ( ) ) - state = localTransition->second; - else - res = false; - - if ( res == false ) - break; - if ( automaton.getFinalStates ( ).count ( state ) ) occ.insert ( i ); if ( common::GlobalData::verbose ) std::clog << state << std::endl; + + if ( res == false ) + break; } return std::make_tuple ( res, state, occ, pushdownStore );