diff --git a/alib2data/src/automaton/PDA/InputDrivenDPDA.h b/alib2data/src/automaton/PDA/InputDrivenDPDA.h index 5ef7bc0c8e9ddc30a5639e26095c283f6ed12f2f..b12dc84995a84be6218d2329c81753eab497451f 100644 --- a/alib2data/src/automaton/PDA/InputDrivenDPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenDPDA.h @@ -222,6 +222,14 @@ public: InputDrivenDPDA < > * res = new InputDrivenDPDA < > ( std::move ( states ), std::move ( alphabet ), std::move ( pushdownAlphabet ), std::move ( initialState ), std::move ( initialSymbol ), std::move ( finalStates ) ); + for ( std::pair < InputSymbolType, std::pair < std::vector < InputSymbolType >, std::vector < InputSymbolType > > > && pushdownOperation : std::make_moveable_map ( inputSymbolToPushdownStoreOperation ) ) { + DefaultSymbolType target = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( pushdownOperation.first ) ); + std::vector < DefaultSymbolType > pop = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.first ) ); + std::vector < DefaultSymbolType > push = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.second ) ); + + res->setPushdownStoreOperation ( std::move ( target ), std::move ( pop ), std::move ( push ) ); + } + for ( std::pair < std::pair < StateType, InputSymbolType >, StateType > && transition : std::make_moveable_map ( transitions ) ) { DefaultStateType from = AutomatonNormalize::normalizeState ( std::move ( transition.first.first ) ); DefaultSymbolType input = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( transition.first.second ) ); @@ -231,14 +239,6 @@ public: res->addTransition ( std::move ( from ), std::move ( input ), std::move ( to ) ); } - for ( std::pair < InputSymbolType, std::pair < std::vector < InputSymbolType >, std::vector < InputSymbolType > > > && pushdownOperation : std::make_moveable_map ( inputSymbolToPushdownStoreOperation ) ) { - DefaultSymbolType target = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( pushdownOperation.first ) ); - std::vector < DefaultSymbolType > pop = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.first ) ); - std::vector < DefaultSymbolType > push = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.second ) ); - - res->setPushdownStoreOperation ( std::move ( target ), std::move ( pop ), std::move ( push ) ); - } - return res; } }; diff --git a/alib2data/src/automaton/PDA/InputDrivenNPDA.h b/alib2data/src/automaton/PDA/InputDrivenNPDA.h index e1ed9daab625956f7d9750cda64d3fc1e40c321a..c9f8ccb935567701ffa78d68a18411466199a529 100644 --- a/alib2data/src/automaton/PDA/InputDrivenNPDA.h +++ b/alib2data/src/automaton/PDA/InputDrivenNPDA.h @@ -231,6 +231,14 @@ public: InputDrivenNPDA < > * res = new InputDrivenNPDA < > ( std::move ( states ), std::move ( alphabet ), std::move ( pushdownAlphabet ), std::move ( initialState ), std::move ( initialSymbol ), std::move ( finalStates ) ); + for ( std::pair < InputSymbolType, std::pair < std::vector < InputSymbolType >, std::vector < InputSymbolType > > > && pushdownOperation : std::make_moveable_map ( inputSymbolToPushdownStoreOperation ) ) { + DefaultSymbolType target = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( pushdownOperation.first ) ); + std::vector < DefaultSymbolType > pop = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.first ) ); + std::vector < DefaultSymbolType > push = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.second ) ); + + res->setPushdownStoreOperation ( std::move ( target ), std::move ( pop ), std::move ( push ) ); + } + for ( std::pair < std::pair < StateType, InputSymbolType >, std::set < StateType > > && transition : std::make_moveable_map ( transitions ) ) { std::set < DefaultStateType > targets = AutomatonNormalize::normalizeStates ( std::move ( transition.second ) ); @@ -240,14 +248,6 @@ public: res->addTransitions ( std::move ( from ), std::move ( input ), std::move ( targets ) ); } - for ( std::pair < InputSymbolType, std::pair < std::vector < InputSymbolType >, std::vector < InputSymbolType > > > && pushdownOperation : std::make_moveable_map ( inputSymbolToPushdownStoreOperation ) ) { - DefaultSymbolType target = alphabet::SymbolNormalize::normalizeSymbol ( std::move ( pushdownOperation.first ) ); - std::vector < DefaultSymbolType > pop = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.first ) ); - std::vector < DefaultSymbolType > push = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( pushdownOperation.second.second ) ); - - res->setPushdownStoreOperation ( std::move ( target ), std::move ( pop ), std::move ( push ) ); - } - return res; } };