6#include <ext/algorithm>
13namespace determinize {
15template <
class SymbolType,
class StateType >
24 for (
auto & transition :
range )
25 dfaState.insert ( transition.second );
27 res.addState ( dfaState );
29 res.addTransition ( input, dfaState );
38 for (
const StateType & nfaState1 : dfaState1 ) {
39 for (
const StateType & nfaState2 : dfaState2 ) {
42 for (
auto & transition :
range )
43 dfaState.insert ( transition.second );
47 changed |=
res.addState ( dfaState );
49 res.addTransition (
ext::make_pair ( dfaState1, dfaState2 ), std::move ( dfaState ) );
56 if ( !
ext::excludes ( finalLabels.
begin ( ), finalLabels.
end ( ), dfaState.begin ( ), dfaState.end ( ) ) )
57 res.addFinalState ( dfaState );
Deterministic Z-Automaton in Arc-Factored Normal Form. Computation model for unranked regular tree la...
Definition: ArcFactoredDeterministicZAutomaton.h:65
Nondeterministic Z-Automaton in Arc-Factored Normal Form. Computation model for unranked regular tree...
Definition: ArcFactoredNondeterministicZAutomaton.h:67
static automaton::DFA< SymbolType, StateType > determinize(const automaton::DFA< SymbolType, StateType > &automaton)
Definition: Determinize.h:276
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: set.hpp:99
auto end() &
Inherited behavior of end for non-const instance.
Definition: set.hpp:129
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
return res
Definition: MinimizeByPartitioning.h:145
Definition: ToGrammar.h:31
auto range(Container &&cont) -> decltype(std::forward< Container >(cont).range())
Definition: range.hpp:247
bool excludes(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp)
Tests two sorted ranges wheter all elements from the second are not present in the first.
Definition: algorithm.hpp:46
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79