71 template <
class SymbolType,
class StateType >
84 template <
class SymbolType,
class StateType >
95 template <
class SymbolType,
class StateType >
104 if (
automaton.getFinalStates ( ).empty ( ) )
109 extendExtendedNFA ( extendedAutomaton );
115 statesToEliminate.erase ( * extendedAutomaton.
getFinalStates ( ).begin ( ) );
117 for (
const StateType & state : statesToEliminate )
118 extendedAutomaton = eliminateState ( extendedAutomaton, state );
126template <
class SymbolType,
class StateType >
129 newAutomaton.setStates ( extendedAutomaton.
getStates ( ) );
130 newAutomaton.removeState (
q );
132 newAutomaton.setFinalStates ( extendedAutomaton.
getFinalStates ( ) );
134 for (
const StateType & p: newAutomaton.getStates ( ) ) {
135 for (
const StateType & r : newAutomaton.getStates ( ) ) {
149template <
class SymbolType,
class StateType >
153 for (
const auto & transition:
automaton.getTransitionsFromState ( from ) )
154 if ( transition.second == to )
160template <
class SymbolType,
class StateType >
163 if (
automaton.getFinalStates ( ).contains ( initState ) || !
automaton.getTransitionsToState ( initState ).empty ( ) ) {
173 if (
automaton.getFinalStates ( ).size ( ) > 1 ) {
183 newFinalStates.insert ( f );
184 automaton.setFinalStates ( newFinalStates );
Extended nondeterministic finite automaton. Accepts regular languages. The automaton has a regular ex...
Definition: ExtendedNFA.h:80
const StateType & getInitialState() const &
Definition: ExtendedNFA.h:156
const ext::set< SymbolType > & getInputAlphabet() const &
Definition: ExtendedNFA.h:283
const ext::set< StateType > & getStates() const &
Definition: ExtendedNFA.h:185
const ext::set< StateType > & getFinalStates() const &
Definition: ExtendedNFA.h:234
Definition: ToRegExpStateElimination.h:51
static regexp::UnboundedRegExp< typename T::SymbolType > convert(const T &automaton)
Definition: ToRegExpStateElimination.h:100
Represents the empty expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEmpty.h:41
Represents the epsilon expression in the regular expression. The node can't have any children.
Definition: UnboundedRegExpEpsilon.h:41
Represents unbounded regular expression structure. Regular expression is stored as a tree of Unbounde...
Definition: UnboundedRegExpStructure.h:47
Unbounded regular expression represents regular expression. It describes regular languages....
Definition: UnboundedRegExp.h:80
static regexp::UnboundedRegExp< SymbolType > optimize(const regexp::UnboundedRegExp< SymbolType > ®exp)
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
ext::set< ext::pair< StateType, StateType > > ret(const ext::set< ext::pair< StateType, StateType > > &S, const DeterministicPushdownStoreSymbolType &pdaSymbol, const InputSymbolType &input, const N &nondeterministic)
Definition: RHDPDACommon.h:57
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
q
Definition: SingleInitialStateEpsilonTransition.h:85
StateType q0
Definition: SingleInitialState.h:96
Definition: ToGrammar.h:31
T createUnique(T object, const Alphabets &... alphabets)
Definition: createUnique.hpp:46
Definition: converterCommon.hpp:8
Definition: ToAutomaton.h:15