28#include <ext/algorithm>
63 template <
class SymbolType,
class StateType >
77 template <
class SymbolType,
class StateType >
92 requires isDFA < T > || isNFA < T > || isMultiInitialStateNFA < T >
106 template <
class SymbolType,
class StateType >
120 template <
class SymbolType,
class StateType >
124template <
class SymbolType,
class StateType >
130 std::queue < StateType > queue;
133 while ( ! queue.empty( ) ) {
134 StateType p = std::move ( queue.front ( ) );
138 for (
const auto & transition : tos )
139 if (
closure.insert ( transition.second ).second )
140 queue.push ( transition.second );
146template <
class SymbolType,
class StateType >
152 std::queue < StateType > queue;
155 while ( ! queue.empty ( ) ) {
156 StateType p = std::move ( queue.front ( ) );
160 for (
const auto & transition : tos )
161 if (
closure.insert ( transition.second ).second )
162 queue.push ( transition.second );
169requires isDFA < T > || isNFA < T > || isMultiInitialStateNFA < T >
171 if ( ! fsm.getStates ( ).contains (
q ) )
177template <
class SymbolType,
class StateType >
183 std::queue < StateType > queue;
186 while ( ! queue.empty( ) ) {
187 StateType p = std::move ( queue.front ( ) );
192 if (
closure.insert ( transition.second ).second )
193 queue.push ( transition.second );
199template <
class SymbolType,
class StateType >
205 std::queue < StateType > queue;
208 while ( ! queue.empty ( ) ) {
209 StateType p = std::move ( queue.front ( ) );
213 if ( transition.first.second.empty ( ) )
214 if (
closure.insert ( transition.second ).second )
215 queue.push ( transition.second );
Compact nondeterministic finite automaton. Accepts regular languages. The automaton has a list of sym...
Definition: CompactNFA.h:78
const ext::set< StateType > & getStates() const &
Definition: CompactNFA.h:183
ext::multimap< ext::pair< StateType, ext::vector< SymbolType > >, StateType > getTransitionsFromState(const StateType &from) const
Definition: CompactNFA.h:565
Epsilon nondeterministic finite automaton. Accepts regular languages.
Definition: EpsilonNFA.h:74
const ext::set< StateType > & getStates() const &
Definition: EpsilonNFA.h:158
const ext::multimap< ext::pair< StateType, common::symbol_or_epsilon< SymbolType > >, StateType > & getTransitions() const &
Definition: EpsilonNFA.h:666
Epsilon nondeterministic finite tree automaton. Accepts regular tree languages.
Definition: EpsilonNFTA.h:73
const ext::set< StateType > & getStates() const &
Definition: EpsilonNFTA.h:118
const ext::multimap< ext::variant< StateType, ext::pair< common::ranked_symbol< SymbolType >, ext::vector< StateType > > >, StateType > & getTransitions() const &
Definition: EpsilonNFTA.h:354
Extended nondeterministic finite automaton. Accepts regular languages. The automaton has a regular ex...
Definition: ExtendedNFA.h:80
const ext::set< StateType > & getStates() const &
Definition: ExtendedNFA.h:185
ext::multimap< ext::pair< StateType, regexp::UnboundedRegExpStructure< SymbolType > >, StateType > getTransitionsFromState(const StateType &from) const
Definition: ExtendedNFA.h:591
Definition: EpsilonClosure.h:50
static ext::set< StateType > epsilonClosure(const automaton::EpsilonNFA< SymbolType, StateType > &fsm, const StateType &q)
Definition: EpsilonClosure.h:125
static ext::set< typename T::StateType > epsilonClosure(const T &fsm, const typename T::StateType &q)
Definition: symbol_or_epsilon.hpp:24
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
static bool languageContainsEpsilon(const regexp::FormalRegExpElement< SymbolType > ®exp)
Definition: RegExpEpsilon.h:91
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
return closure
Definition: AllEpsilonClosure.h:142
q
Definition: SingleInitialStateEpsilonTransition.h:85
Definition: ToGrammar.h:31
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79