Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
ExactSubtreeAutomaton.h
Go to the documentation of this file.
1
6#pragma once
7
10
11namespace arbology {
12
13namespace exact {
14
16public:
21 template < class SymbolType >
23
24};
25
26template < class SymbolType >
29
30 for ( const common::ranked_symbol < SymbolType > & symbol : tree.getAlphabet ( ) ) {
31 res.addInputSymbol ( symbol );
32 res.setPushdownStoreOperation ( symbol, ext::vector < char > ( 1, 'S' ), ext::vector < char > ( symbol.getRank ( ), 'S' ) );
33 }
34
35 unsigned i = 1;
36
37 for ( const common::ranked_symbol < SymbolType > & symbol : tree.getContent ( ) ) {
38 res.addState ( i );
39 res.addTransition ( i - 1, symbol, i );
40 res.addTransition ( 0, std::move ( symbol ), i );
41 i++;
42 }
43
44 return res;
45}
46
47} /* namespace exact */
48
49} /* namespace arbology */
50
Definition: ExactSubtreeAutomaton.h:15
static automaton::InputDrivenNPDA< common::ranked_symbol< SymbolType >, char, unsigned > construct(const tree::PrefixRankedTree< SymbolType > &tree)
Definition: ExactSubtreeAutomaton.h:27
Nondeterministic input driven pushdown automaton. Accepts subset of context free languages.
Definition: InputDrivenNPDA.h:79
Definition: ranked_symbol.hpp:20
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Tree structure represented as linear sequece as result of preorder traversal. The representation is s...
Definition: PrefixRankedTree.h:71
Definition: BoyerMooreHorspool.h:22
int i
Definition: AllEpsilonClosure.h:118
return res
Definition: MinimizeByPartitioning.h:145
Definition: BackwardOccurrenceTest.h:17