18namespace determinize {
20template <
class StateType >
24 id.insert(entry.second);
29template <
class StateType >
38template <
class InputSymbolType,
class StateType,
class N >
42 for (
const auto & entry : S ) {
46 for (
const auto & transition : nondeterministic.getReturnTransitions ( ).equal_range (
ext::make_tuple ( q2, input, nondeterministic.getBottomOfTheStackSymbol ( ) ) ) ) {
56template <
class InputSymbolType,
class DeterministicPushdownStoreSymbolType,
class StateType,
class N >
60 for(
const auto& transition : nondeterministic.getCallTransitions()) {
61 if(pdaSymbol.second != std::get<1>(transition.first))
continue;
63 const StateType &
q = std::get<0>(transition.first);
64 const StateType & q1 = transition.second.first;
65 const auto & gamma = transition.second.second;
70 for (
const auto & returnTransition : nondeterministic.getReturnTransitions ( ).equal_range (
ext::make_tuple ( q2, input, gamma ) ) ) {
71 const StateType & qI = returnTransition.second;
80 for(
const auto& entry : S1) {
93template <
class InputSymbolType,
class StateType,
class N >
98 for (
const auto & to : nondeterministic.getCallTransitions ( ).equal_range (
ext::make_pair (
q, input ) ) ) {
108template <
class InputSymbolType,
class StateType,
class N >
112 for (
const auto & entry : S ) {
116 for (
const auto & transition : nondeterministic.getLocalTransitions ( ).equal_range (
ext::make_pair ( q2, input ) ) ) {
117 const StateType & q1 = transition.second;
125template <
class DeterministicStateType,
class DeterministicPushdownStoreSymbolType >
128 std::set_difference ( newSymbols.
begin ( ), newSymbols.
end ( ), topSymbols [ state ].begin ( ), topSymbols [ state ].end ( ), std::inserter ( missingSymbols, missingSymbols.
end ( ) ) );
130 if ( missingSymbols.empty ( ) )
133 topSymbols [ state ].insert ( missingSymbols.
begin ( ), missingSymbols.
end ( ) );
135 for (
const DeterministicStateType & adv : localClosure [ state ] )
136 updateTopSymbols ( localClosure, topSymbols, dirtyStateSymbols, adv, missingSymbols );
138 for ( DeterministicPushdownStoreSymbolType && symbol :
ext::make_mover ( missingSymbols ) )
139 dirtyStateSymbols.push (
ext::make_pair ( state, std::move ( symbol ) ) );
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
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
auto equal_range(K &&key) const &
Make range of elements with key equal to the key.
Definition: set.hpp:200
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
void updateTopSymbols(ext::map< DeterministicStateType, ext::set< DeterministicStateType > > &localClosure, ext::map< DeterministicStateType, ext::set< DeterministicPushdownStoreSymbolType > > &topSymbols, std::queue< ext::pair< DeterministicStateType, DeterministicPushdownStoreSymbolType > > &dirtyStateSymbols, const DeterministicStateType &state, const ext::set< DeterministicPushdownStoreSymbolType > &newSymbols)
Definition: RHDPDACommon.h:126
ext::set< ext::pair< StateType, StateType > > call(const ext::set< ext::pair< StateType, StateType > > &S, const InputSymbolType &input, const N &nondeterministic)
Definition: RHDPDACommon.h:94
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
ext::set< ext::pair< StateType, StateType > > createIdentity(const ext::set< StateType > &states)
Definition: RHDPDACommon.h:30
ext::set< StateType > retrieveDSubSet(const ext::set< ext::pair< StateType, StateType > > &localOperation)
Definition: RHDPDACommon.h:21
ext::set< ext::pair< StateType, StateType > > retInitial(const ext::set< ext::pair< StateType, StateType > > &S, const InputSymbolType &input, const N &nondeterministic)
Definition: RHDPDACommon.h:39
q
Definition: SingleInitialStateEpsilonTransition.h:85
Definition: ToGrammar.h:31
reference_mover< T > make_mover(T ¶m)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
SliceComp< Ts ... > slice_comp(const Ts &... inst)
Definition: functional.hpp:95
constexpr auto make_tuple(Elements &&... args)
Helper of extended tuple construction. The tuple is constructed from values pack, types are deduced.
Definition: tuple.hpp:203
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79