Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Rename.h
Go to the documentation of this file.
1
6/*
7 * This file is part of Algorithms library toolkit.
8 * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
9
10 * Algorithms library toolkit is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14
15 * Algorithms library toolkit is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19
20 * You should have received a copy of the GNU General Public License
21 * along with Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
26#include <ext/algorithm>
27
28#include <alib/map>
29#include <alib/vector>
30
31#include <automaton/FSM/DFA.h>
32#include <automaton/FSM/NFA.h>
34#include <automaton/TA/DFTA.h>
35#include <automaton/TA/NFTA.h>
38#include <automaton/PDA/DPDA.h>
39#include <automaton/PDA/NPDA.h>
44
45namespace automaton {
46
47namespace simplify {
48
57class Rename {
58 template < class T >
59 struct DFATra {
61 };
62
63 template < class T >
64 struct NFATra {
66 };
67
68 template < class T >
69 struct EpsilonNFATra {
71 };
72
73 template < class T >
74 using RenamedAutomaton = typename ext::casional <
75 ext::boolean < isDFA < T > >, DFATra < T >,
76 ext::boolean < isNFA < T > >, NFATra < T >,
77 ext::boolean < isEpsilonNFA < T > >, EpsilonNFATra < T >
78 >::type::type;
79
80 template < class T >
81 struct DFTATra {
83 };
84
85 template < class T >
86 struct NFTATra {
88 };
89
90 template < class T >
91 using RenamedTreeAutomaton = typename ext::casional <
92 ext::boolean < isDFTA < T > >, DFTATra < T >,
93 ext::boolean < isNFTA < T > >, NFTATra < T >
94 >::type::type;
95
96public:
106 template < class T >
107 requires isDFA < T > || isNFA < T >
108 static Rename::RenamedAutomaton < T > rename ( const T & fsm );
109
119 template < class T >
120 requires isDFTA < T > || isNFTA < T >
121 static Rename::RenamedTreeAutomaton < T > rename ( const T & fta );
122
135 template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
137
150 template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
152
165 template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
167
180 template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
182
195 template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
197
210 template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
212
224 template < class InputSymbolType, class StateType >
226
238 template < class InputSymbolType, class StateType >
240};
241
242template < class T >
243requires isDFA < T > || isNFA < T >
244Rename::RenamedAutomaton < T > Rename::rename ( const T & fsm ) {
245 using StateType = typename T::StateType;
246
247 unsigned counter = 0;
249
250 for ( const StateType & state : fsm.getStates ( ) )
251 renamingData.insert ( std::make_pair ( state, counter++ ) );
252
253 Rename::RenamedAutomaton < T > result ( renamingData.at ( fsm.getInitialState ( ) ) );
254
255 result.setInputAlphabet ( fsm.getInputAlphabet ( ) );
256
257 for ( const StateType & state : fsm.getStates ( ) )
258 result.addState ( renamingData.at ( state ) );
259
260 for ( const StateType & state : fsm.getFinalStates ( ) )
261 result.addFinalState ( renamingData.at ( state ) );
262
263 for ( const auto & transition : fsm.getTransitions ( ) )
264 result.addTransition ( renamingData.at ( transition.first.first ), transition.first.second, renamingData.at ( transition.second ) );
265
266 return result;
267}
268
269template < class T >
270requires isDFTA < T > || isNFTA < T >
271Rename::RenamedTreeAutomaton < T > Rename::rename ( const T & fta ) {
272 using StateType = typename T::StateType;
273
274 unsigned counter = 0;
276
277 for ( const StateType & state : fta.getStates ( ) )
278 renamingData.insert ( std::make_pair ( state, counter++ ) );
279
280 Rename::RenamedTreeAutomaton < T > result;
281
282 result.setInputAlphabet ( fta.getInputAlphabet ( ) );
283
284 for ( const StateType & state : fta.getStates ( ) )
285 result.addState ( renamingData.at ( state ) );
286
287 for ( const StateType & state : fta.getFinalStates ( ) )
288 result.addFinalState ( renamingData.at ( state ) );
289
290 for ( const auto & transition : fta.getTransitions ( ) ) {
291 ext::vector < unsigned > sourceStates;
292
293 for ( const StateType & source : transition.first.second )
294 sourceStates.push_back ( renamingData.at ( source ) );
295
296 result.addTransition ( transition.first.first, sourceStates, renamingData.at ( transition.second ) );
297 }
298
299 return result;
300}
301
302template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
304 unsigned counterState = 0;
305 ext::map < StateType, unsigned > renamingDataState;
306 unsigned counterSymbol = 0;
308
309 for ( const StateType & state : pda.getStates ( ) )
310 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
311
312 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
313 renamingDataSymbol.insert ( std::make_pair ( symbol, counterSymbol++ ) );
314
315 automaton::DPDA < InputSymbolType, unsigned, unsigned > result ( renamingDataState.at ( pda.getInitialState ( ) ), renamingDataSymbol.at ( pda.getInitialSymbol ( ) ) );
316
317 result.setInputAlphabet ( pda.getInputAlphabet ( ) );
318
319 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
320 result.addPushdownStoreSymbol ( renamingDataSymbol.at ( symbol ) );
321
322 for ( const StateType & state : pda.getStates ( ) )
323 result.addState ( renamingDataState.at ( state ) );
324
325 for ( const StateType & state : pda.getFinalStates ( ) )
326 result.addFinalState ( renamingDataState.at ( state ) );
327
328 for ( const auto & transition : pda.getTransitions ( ) ) {
330
331 for ( const InputSymbolType & symbol : std::get < 2 > ( transition.first ) )
332 pop.push_back ( renamingDataSymbol.at ( symbol ) );
333
335
336 for ( const InputSymbolType & symbol : transition.second.second )
337 push.push_back ( renamingDataSymbol.at ( symbol ) );
338
339 result.addTransition ( renamingDataState.at ( std::get < 0 > ( transition.first ) ), std::get < 1 > ( transition.first ), pop, renamingDataState.at ( transition.second.first ), push );
340 }
341
342 return result;
343}
344
345template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
347 unsigned counterState = 0;
348 ext::map < StateType, unsigned > renamingDataState;
349 unsigned counterSymbol = 0;
351
352 for ( const StateType & state : pda.getStates ( ) )
353 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
354
355 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
356 renamingDataSymbol.insert ( std::make_pair ( symbol, counterSymbol++ ) );
357
358 automaton::NPDA < InputSymbolType, unsigned, unsigned > result ( renamingDataState.at ( pda.getInitialState ( ) ), renamingDataSymbol.at ( pda.getInitialSymbol ( ) ) );
359
360 result.setInputAlphabet ( pda.getInputAlphabet ( ) );
361
362 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
363 result.addPushdownStoreSymbol ( renamingDataSymbol.at ( symbol ) );
364
365 for ( const StateType & state : pda.getStates ( ) )
366 result.addState ( renamingDataState.at ( state ) );
367
368 for ( const StateType & state : pda.getFinalStates ( ) )
369 result.addFinalState ( renamingDataState.at ( state ) );
370
371 for ( const auto & transition : pda.getTransitions ( ) ) {
373 for ( const InputSymbolType & symbol : std::get < 2 > ( transition.first ) )
374 pop.push_back ( renamingDataSymbol.at ( symbol ) );
375
377 for ( const InputSymbolType & symbol : transition.second.second )
378 push.push_back ( renamingDataSymbol.at ( symbol ) );
379
380 result.addTransition ( renamingDataState.at ( std::get < 0 > ( transition.first ) ), std::get < 1 > ( transition.first ), pop, renamingDataState.at ( transition.second.first ), push );
381 }
382
383 return result;
384}
385
386template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
388 int counterState = 0;
389 ext::map < StateType, unsigned > renamingDataState;
390 int counterSymbol = 0;
392
393 for ( const StateType & state : pda.getStates ( ) )
394 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
395
396 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
397 renamingDataSymbol.insert ( std::make_pair ( symbol, counterSymbol++ ) );
398
399 automaton::SinglePopDPDA < InputSymbolType, unsigned, unsigned > result ( renamingDataState.at ( pda.getInitialState ( ) ), renamingDataSymbol.at ( pda.getInitialSymbol ( ) ) );
400
401 result.setInputAlphabet ( pda.getInputAlphabet ( ) );
402
403 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
404 result.addPushdownStoreSymbol ( renamingDataSymbol.at ( symbol ) );
405
406 for ( const StateType & state : pda.getStates ( ) )
407 result.addState ( renamingDataState.at ( state ) );
408
409 for ( const StateType & state : pda.getFinalStates ( ) )
410 result.addFinalState ( renamingDataState.at ( state ) );
411
412 for ( const auto & transition : pda.getTransitions ( ) ) {
414
415 for ( const PushdownStoreSymbolType & symbol : transition.second.second )
416 push.push_back ( renamingDataSymbol.at ( symbol ) );
417
418 result.addTransition ( renamingDataState.at ( std::get < 0 > ( transition.first ) ), std::get < 1 > ( transition.first ), renamingDataSymbol.at ( std::get < 2 > ( transition.first ) ), renamingDataState.at ( transition.second.first ), push );
419 }
420
421 return result;
422}
423
424template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
426 int counterState = 0;
427 ext::map < StateType, unsigned > renamingDataState;
428 int counterSymbol = 0;
430
431 for ( const StateType & state : pda.getStates ( ) )
432 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
433
434 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
435 renamingDataSymbol.insert ( std::make_pair ( symbol, counterSymbol++ ) );
436
437 automaton::InputDrivenDPDA < InputSymbolType, unsigned, unsigned > result ( renamingDataState.at ( pda.getInitialState ( ) ), renamingDataSymbol.at ( pda.getInitialSymbol ( ) ) );
438
439 result.setInputAlphabet ( pda.getInputAlphabet ( ) );
440
441 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
442 result.addPushdownStoreSymbol ( renamingDataSymbol.at ( symbol ) );
443
444 for ( const std::pair < const InputSymbolType, ext::pair < ext::vector < PushdownStoreSymbolType >, ext::vector < PushdownStoreSymbolType > > > & operation : pda.getPushdownStoreOperations ( ) ) {
446
447 for ( const PushdownStoreSymbolType & symbol : operation.second.first )
448 pop.push_back ( renamingDataSymbol.at ( symbol ) );
449
451
452 for ( const PushdownStoreSymbolType & symbol : operation.second.second )
453 push.push_back ( renamingDataSymbol.at ( symbol ) );
454
455 result.setPushdownStoreOperation ( operation.first, pop, push );
456 }
457
458 for ( const StateType & state : pda.getStates ( ) )
459 result.addState ( renamingDataState.at ( state ) );
460
461 for ( const StateType & state : pda.getFinalStates ( ) )
462 result.addFinalState ( renamingDataState.at ( state ) );
463
464 for ( const auto & transition : pda.getTransitions ( ) )
465 result.addTransition ( renamingDataState.at ( transition.first.first ), transition.first.second, renamingDataState.at ( transition.second ) );
466
467 return result;
468}
469
470template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
472 int counterState = 0;
473 ext::map < StateType, unsigned > renamingDataState;
474 int counterSymbol = 0;
476
477 for ( const StateType & state : pda.getStates ( ) )
478 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
479
480 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
481 renamingDataSymbol.insert ( std::make_pair ( symbol, counterSymbol++ ) );
482
484
485 result.setCallInputAlphabet ( pda.getCallInputAlphabet ( ) );
486 result.setLocalInputAlphabet ( pda.getLocalInputAlphabet ( ) );
487 result.setReturnInputAlphabet ( pda.getReturnInputAlphabet ( ) );
488
489 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
490 result.addPushdownStoreSymbol ( renamingDataSymbol.at ( symbol ) );
491
492 for ( const StateType & state : pda.getStates ( ) )
493 result.addState ( renamingDataState.at ( state ) );
494
495 for ( const StateType & state : pda.getFinalStates ( ) )
496 result.addFinalState ( renamingDataState.at ( state ) );
497
498 for ( const auto & transition : pda.getCallTransitions ( ) )
499 result.addCallTransition ( renamingDataState.at ( transition.first.first ), transition.first.second, renamingDataState.at ( transition.second.first ), renamingDataSymbol.at ( transition.second.second ) );
500
501 for ( const auto & transition : pda.getLocalTransitions ( ) )
502 result.addLocalTransition ( renamingDataState.at ( transition.first.first ), transition.first.second, renamingDataState.at ( transition.second ) );
503
504 for ( const auto & transition : pda.getReturnTransitions ( ) )
505 result.addReturnTransition ( renamingDataState.at ( std::get < 0 > ( transition.first ) ), std::get < 1 > ( transition.first ), renamingDataSymbol.at ( std::get < 2 > ( transition.first ) ), renamingDataState.at ( transition.second ) );
506
507 return result;
508}
509
510template < class InputSymbolType, class PushdownStoreSymbolType, class StateType >
512 int counterState = 0;
513 ext::map < StateType, unsigned > renamingDataState;
514 int counterSymbol = 0;
516
517 for ( const StateType & state : pda.getStates ( ) )
518 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
519
520 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
521 renamingDataSymbol.insert ( std::make_pair ( symbol, counterSymbol++ ) );
522
524
525 result.setInputAlphabet ( pda.getInputAlphabet ( ) );
526
527 for ( const InputSymbolType & symbol : pda.getPushdownStoreAlphabet ( ) )
528 result.addPushdownStoreSymbol ( renamingDataSymbol.at ( symbol ) );
529
530 for ( const StateType & state : pda.getStates ( ) )
531 result.addState ( renamingDataState.at ( state ) );
532
533 for ( const StateType & state : pda.getFinalStates ( ) )
534 result.addFinalState ( renamingDataState.at ( state ) );
535
536 for ( const auto & transition : pda.getCallTransitions ( ) )
537 result.addCallTransition ( renamingDataState.at ( transition.first.first ), transition.first.second, renamingDataState.at ( transition.second.first ), renamingDataSymbol.at ( transition.second.second ) );
538
539 for ( const auto & transition : pda.getLocalTransitions ( ) )
540 result.addLocalTransition ( renamingDataState.at ( transition.first.first ), transition.first.second, renamingDataState.at ( transition.second ) );
541
542 for ( const auto & transition : pda.getReturnTransitions ( ) )
543 result.addReturnTransition ( renamingDataState.at ( std::get < 0 > ( transition.first ) ), std::get < 1 > ( transition.first ), renamingDataSymbol.at ( std::get < 2 > ( transition.first ) ), renamingDataState.at ( transition.second ) );
544
545 return result;
546}
547
548template < class SymbolType, class StateType >
550 int counterState = 0;
551 ext::map < StateType, unsigned > renamingDataState;
552
553 for ( const StateType & state : a.getStates ( ) )
554 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
555
557
558 result.setInputAlphabet ( a.getInputAlphabet ( ) );
559
560 for ( const StateType & state : a.getStates ( ) )
561 result.addState ( renamingDataState.at ( state ) );
562
563 for ( const StateType & state : a.getFinalStates ( ) )
564 result.addFinalState ( renamingDataState.at ( state ) );
565
566 for ( const std::pair < const ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType > & transition : a.getTransitions ( ) ) {
567 if ( transition.first.template is < SymbolType > ( ) ) {
568 result.addTransition ( transition.first.template get < SymbolType > ( ), renamingDataState.at ( transition.second ) );
569 } else {
570 auto source = transition.first.template get < ext::pair < StateType, StateType > > ( );
571 result.addTransition ( ext::make_pair ( renamingDataState.at ( source.first ), renamingDataState.at ( source.second ) ), renamingDataState.at ( transition.second ) );
572 }
573 }
574
575 return result;
576}
577
578template < class SymbolType, class StateType >
580 int counterState = 0;
581 ext::map < StateType, unsigned > renamingDataState;
582
583 for ( const StateType & state : a.getStates ( ) )
584 renamingDataState.insert ( std::make_pair ( state, counterState++ ) );
585
587
588 result.setInputAlphabet ( a.getInputAlphabet ( ) );
589
590 for ( const StateType & state : a.getStates ( ) )
591 result.addState ( renamingDataState.at ( state ) );
592
593 for ( const StateType & state : a.getFinalStates ( ) )
594 result.addFinalState ( renamingDataState.at ( state ) );
595
596 for ( const std::pair < const ext::variant < SymbolType, ext::pair < StateType, StateType > >, StateType > & transition : a.getTransitions ( ) ) {
597 if ( transition.first.template is < SymbolType > ( ) ) {
598 result.addTransition ( transition.first.template get < SymbolType > ( ), renamingDataState.at ( transition.second ) );
599 } else {
600 auto source = transition.first.template get < ext::pair < StateType, StateType > > ( );
601 result.addTransition ( ext::make_pair ( renamingDataState.at ( source.first ), renamingDataState.at ( source.second ) ), renamingDataState.at ( transition.second ) );
602 }
603 }
604
605 return result;
606}
607
608} /* namespace simplify */
609
610} /* namespace automaton */
611
Deterministic Z-Automaton in Arc-Factored Normal Form. Computation model for unranked regular tree la...
Definition: ArcFactoredDeterministicZAutomaton.h:65
const ext::set< StateType > & getFinalStates() const &
Definition: ArcFactoredDeterministicZAutomaton.h:145
const ext::map< ext::variant< SymbolType, ext::pair< StateType, StateType > >, StateType > & getTransitions() const &
Definition: ArcFactoredDeterministicZAutomaton.h:284
const ext::set< SymbolType > & getInputAlphabet() const &
Definition: ArcFactoredDeterministicZAutomaton.h:194
const ext::set< StateType > & getStates() const &
Definition: ArcFactoredDeterministicZAutomaton.h:96
Nondeterministic Z-Automaton in Arc-Factored Normal Form. Computation model for unranked regular tree...
Definition: ArcFactoredNondeterministicZAutomaton.h:67
const ext::set< SymbolType > & getInputAlphabet() const &
Definition: ArcFactoredNondeterministicZAutomaton.h:203
const ext::set< StateType > & getFinalStates() const &
Definition: ArcFactoredNondeterministicZAutomaton.h:154
const ext::multimap< ext::variant< SymbolType, ext::pair< StateType, StateType > >, StateType > & getTransitions() const &
Definition: ArcFactoredNondeterministicZAutomaton.h:293
const ext::set< StateType > & getStates() const &
Definition: ArcFactoredNondeterministicZAutomaton.h:105
Deterministic finite automaton. Accepts regular languages.
Definition: DFA.h:71
Nondeterministic finite tree automaton without epsilon transitions. Accepts regular tree languages.
Definition: DFTA.h:74
Deterministic pushdown automaton. Accepts subset of context free languages.
Definition: DPDA.h:78
const PushdownStoreSymbolType & getInitialSymbol() const &
Definition: DPDA.h:301
const ext::set< PushdownStoreSymbolType > & getPushdownStoreAlphabet() const &
Definition: DPDA.h:243
const ext::set< InputSymbolType > & getInputAlphabet() const &
Definition: DPDA.h:330
const ext::set< StateType > & getStates() const &
Definition: DPDA.h:145
const ext::map< ext::tuple< StateType, common::symbol_or_epsilon< InputSymbolType >, ext::vector< PushdownStoreSymbolType > >, ext::pair< StateType, ext::vector< PushdownStoreSymbolType > > > & getTransitions() const &
Definition: DPDA.h:682
const ext::set< StateType > & getFinalStates() const &
Definition: DPDA.h:194
const StateType & getInitialState() const &
Definition: DPDA.h:116
Epsilon nondeterministic finite automaton. Accepts regular languages.
Definition: EpsilonNFA.h:74
Deterministic input driven pushdown automaton. Accepts subset of context free languages.
Definition: InputDrivenDPDA.h:79
const ext::map< ext::pair< StateType, InputSymbolType >, StateType > & getTransitions() const &
Definition: InputDrivenDPDA.h:655
const ext::set< StateType > & getStates() const &
Definition: InputDrivenDPDA.h:160
const PushdownStoreSymbolType & getInitialSymbol() const &
Definition: InputDrivenDPDA.h:316
const ext::set< InputSymbolType > & getInputAlphabet() const &
Definition: InputDrivenDPDA.h:345
const ext::set< PushdownStoreSymbolType > & getPushdownStoreAlphabet() const &
Definition: InputDrivenDPDA.h:258
const ext::set< StateType > & getFinalStates() const &
Definition: InputDrivenDPDA.h:209
const ext::map< InputSymbolType, ext::pair< ext::vector< PushdownStoreSymbolType >, ext::vector< PushdownStoreSymbolType > > > & getPushdownStoreOperations() const &
Definition: InputDrivenDPDA.h:604
const StateType & getInitialState() const &
Definition: InputDrivenDPDA.h:131
Nondeterministic finite automaton. Accepts regular languages.
Definition: NFA.h:66
Nondeterministic finite tree automaton without epsilon transitions. Accepts regular tree languages.
Definition: NFTA.h:72
Definition: NPDA.h:74
const PushdownStoreSymbolType & getInitialSymbol() const &
Definition: NPDA.h:304
const ext::set< StateType > & getFinalStates() const &
Definition: NPDA.h:197
const StateType & getInitialState() const &
Definition: NPDA.h:119
const ext::set< StateType > & getStates() const &
Definition: NPDA.h:148
const ext::multimap< ext::tuple< StateType, common::symbol_or_epsilon< InputSymbolType >, ext::vector< PushdownStoreSymbolType > >, ext::pair< StateType, ext::vector< PushdownStoreSymbolType > > > & getTransitions() const &
Definition: NPDA.h:644
const ext::set< InputSymbolType > & getInputAlphabet() const &
Definition: NPDA.h:333
const ext::set< PushdownStoreSymbolType > & getPushdownStoreAlphabet() const &
Definition: NPDA.h:246
Deterministic real time height deterministic pushdown automaton. Accepts subset of context free langu...
Definition: RealTimeHeightDeterministicDPDA.h:89
const ext::set< InputSymbolType > & getInputAlphabet() const &
Definition: RealTimeHeightDeterministicDPDA.h:363
const StateType & getInitialState() const &
Definition: RealTimeHeightDeterministicDPDA.h:149
const ext::map< ext::pair< StateType, common::symbol_or_epsilon< InputSymbolType > >, ext::pair< StateType, PushdownStoreSymbolType > > & getCallTransitions() const &
Definition: RealTimeHeightDeterministicDPDA.h:1062
const ext::set< PushdownStoreSymbolType > & getPushdownStoreAlphabet() const &
Definition: RealTimeHeightDeterministicDPDA.h:276
const ext::map< ext::pair< StateType, common::symbol_or_epsilon< InputSymbolType > >, StateType > & getLocalTransitions() const &
Definition: RealTimeHeightDeterministicDPDA.h:1082
const ext::map< ext::tuple< StateType, common::symbol_or_epsilon< InputSymbolType >, PushdownStoreSymbolType >, StateType > & getReturnTransitions() const &
Definition: RealTimeHeightDeterministicDPDA.h:1072
const ext::set< StateType > & getStates() const &
Definition: RealTimeHeightDeterministicDPDA.h:178
const ext::set< StateType > & getFinalStates() const &
Definition: RealTimeHeightDeterministicDPDA.h:227
const PushdownStoreSymbolType & getBottomOfTheStackSymbol() const &
Definition: RealTimeHeightDeterministicDPDA.h:334
Deterministic pushdown automaton requiring a symbol pop from pushdown store on each transition use....
Definition: SinglePopDPDA.h:78
const ext::set< PushdownStoreSymbolType > & getPushdownStoreAlphabet() const &
Definition: SinglePopDPDA.h:243
const StateType & getInitialState() const &
Definition: SinglePopDPDA.h:116
const ext::set< InputSymbolType > & getInputAlphabet() const &
Definition: SinglePopDPDA.h:330
const ext::set< StateType > & getFinalStates() const &
Definition: SinglePopDPDA.h:194
const ext::set< StateType > & getStates() const &
Definition: SinglePopDPDA.h:145
const PushdownStoreSymbolType & getInitialSymbol() const &
Definition: SinglePopDPDA.h:301
const ext::map< ext::tuple< StateType, common::symbol_or_epsilon< InputSymbolType >, PushdownStoreSymbolType >, ext::pair< StateType, ext::vector< PushdownStoreSymbolType > > > & getTransitions() const &
Definition: SinglePopDPDA.h:639
Deterministic visibly pushdown automaton. Accepts subset of context free languages.
Definition: VisiblyPushdownDPDA.h:86
const PushdownStoreSymbolType & getBottomOfTheStackSymbol() const &
Definition: VisiblyPushdownDPDA.h:331
const ext::set< InputSymbolType > & getCallInputAlphabet() const &
Definition: VisiblyPushdownDPDA.h:360
const ext::map< ext::tuple< StateType, InputSymbolType, PushdownStoreSymbolType >, StateType > & getReturnTransitions() const &
Definition: VisiblyPushdownDPDA.h:899
const ext::map< ext::pair< StateType, InputSymbolType >, StateType > & getLocalTransitions() const &
Definition: VisiblyPushdownDPDA.h:909
const ext::set< StateType > & getFinalStates() const &
Definition: VisiblyPushdownDPDA.h:224
const ext::set< InputSymbolType > & getLocalInputAlphabet() const &
Definition: VisiblyPushdownDPDA.h:476
const ext::map< ext::pair< StateType, InputSymbolType >, ext::pair< StateType, PushdownStoreSymbolType > > & getCallTransitions() const &
Definition: VisiblyPushdownDPDA.h:889
const ext::set< StateType > & getStates() const &
Definition: VisiblyPushdownDPDA.h:175
const ext::set< PushdownStoreSymbolType > & getPushdownStoreAlphabet() const &
Definition: VisiblyPushdownDPDA.h:273
const ext::set< InputSymbolType > & getReturnInputAlphabet() const &
Definition: VisiblyPushdownDPDA.h:418
const StateType & getInitialState() const &
Definition: VisiblyPushdownDPDA.h:146
Definition: Rename.h:57
static Rename::RenamedAutomaton< T > rename(const T &fsm)
static automaton::ArcFactoredDeterministicZAutomaton< InputSymbolType, unsigned > rename(const automaton::ArcFactoredDeterministicZAutomaton< InputSymbolType, StateType > &a)
static Rename::RenamedTreeAutomaton< T > rename(const T &fta)
static automaton::ArcFactoredNondeterministicZAutomaton< InputSymbolType, unsigned > rename(const automaton::ArcFactoredNondeterministicZAutomaton< InputSymbolType, StateType > &a)
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
R & at(const T &key, R &defaultValue)
Definition: map.hpp:163
std::pair< iterator, bool > insert(const T &key, const R &value)
Insert variant with explicit key and value parameters.
Definition: map.hpp:118
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Implementation of the variant class allowing to store any type of those listed in the template parame...
Definition: variant.hpp:98
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
typename T::StateType StateType
Definition: ToGrammarLeftRG.h:64
typename T::SymbolType SymbolType
Definition: SingleInitialStateEpsilonTransition.h:72
unsigned counter
Definition: Rename.h:247
ext::map< StateType, unsigned > renamingData
Definition: Rename.h:248
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253
Definition: ToGrammar.h:31
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
typename std::conditional< value, std::true_type, std::false_type >::type boolean
Definition: type_traits.hpp:145
Definition: type_traits.hpp:148