55 requires isDFA < T > || isNFA < T >
61requires isDFA < T > || isNFA < T >
72 for (
const auto & state :
automaton.getStates ( ) ) {
73 grammar.addNonterminalSymbol ( state );
77 for (
const auto & transition :
automaton.getTransitions ( ) ) {
78 const StateType & from = transition.first.first;
79 const SymbolType & input = transition.first.second;
85 if (
automaton.getFinalStates ( ).contains ( to ) )
88 if (
automaton.getInitialState ( ) == from ) {
91 if (
automaton.getFinalStates ( ).contains ( to ) )
97 grammar.setGeneratesEpsilon (
true );
Definition: ToGrammarLeftRG.h:43
static grammar::LeftRG< typename T::SymbolType, typename T::StateType > convert(const T &automaton)
Left regular grammar in Chomsky hierarchy or type 3 in Chomsky hierarchy. Generates regular languages...
Definition: LeftRG.h:70
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
return grammar
Definition: ToGrammarLeftRG.h:99
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: ToGrammar.h:31
Definition: converterCommon.hpp:8
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: ToAutomaton.h:24