diff --git a/alib2elgo/src/automaton/properties/efficient/UsefulStates.h b/alib2elgo/src/automaton/properties/efficient/UsefulStates.h index 20ab8c3d7328ef2b2df1c0e4614cf3ef2a949600..6bcf0341f244672c43a153b8df0c3fec5ed98f20 100644 --- a/alib2elgo/src/automaton/properties/efficient/UsefulStates.h +++ b/alib2elgo/src/automaton/properties/efficient/UsefulStates.h @@ -33,8 +33,6 @@ public: */ template < class T > static ext::set < typename automaton::StateTypeOfAutomaton < T > > usefulStates( const T & fsm ); - template < class SymbolType, class StateType > - static ext::set<StateType> usefulStates( const automaton::ExtendedNFA < SymbolType, StateType > & fsm ); }; template < class T > @@ -61,28 +59,6 @@ ext::set < typename automaton::StateTypeOfAutomaton < T > > UsefulStates::useful return visited; } -template < class SymbolType, class StateType > -ext::set<StateType> UsefulStates::usefulStates( const automaton::ExtendedNFA < SymbolType, StateType > & fsm ) { - ext::map<StateType, ext::set<StateType>> reversedTransitions; - for(const auto& transition : fsm.getTransitions()) - reversedTransitions[transition.second].insert(transition.first.first); - - ext::deque<StateType> queue ( fsm.getFinalStates( ).begin(), fsm.getFinalStates().end() ); - ext::set<StateType> visited = fsm.getFinalStates( ); - - while( !queue.empty() ) { - const ext::set<StateType>& to = reversedTransitions[queue.front()]; - queue.pop_front(); - - for(const StateType& process : to) - if(visited.insert(process).second) { - queue.push_back(std::move(const_cast<StateType&>(process))); - } - } - - return visited; -} - } /* namespace efficient */ } /* namespace properties */