27 template <
class SymbolType >
34 template <
class SymbolType >
38template <
class SymbolType >
40 char S = alphabet::WildcardSymbol::instance < char > ( );
44 res.addInputSymbol ( symbol );
45 if (
tree.getBars ( ).count ( symbol ) )
51 res.addInputSymbol ( subtreeWildcard );
54 res.addInputSymbol ( variablesBar );
62 res.addTransition (
i - 1, symbol,
i );
64 if (
tree.getBars ( ).count ( symbol ) ) {
65 unsigned source = subtreeJumps.back ( );
66 subtreeJumps.pop_back ( );
68 res.addState ( ~0 -
i );
69 res.addTransition ( source, subtreeWildcard, ~0 -
i );
70 res.addTransition ( ~0 -
i, variablesBar,
i );
72 res.addTransition (
res.getInitialState ( ), symbol,
i );
74 subtreeJumps.push_back (
i - 1 );
83template <
class SymbolType >
85 char S = alphabet::WildcardSymbol::instance < char > ( );
89 res.addInputSymbol ( symbol );
93 res.addInputSymbol ( subtreeWildcard );
100 subtreeJumps.push_back (
std::make_pair ( symbol.getRank ( ),
i - 1 ) );
103 res.addTransition (
i - 1, symbol,
i );
104 res.addTransition ( 0, std::move ( symbol ),
i );
106 while ( !subtreeJumps.empty ( ) && subtreeJumps.back ( ).first == 0 ) {
107 res.addTransition ( subtreeJumps.back ( ).second, subtreeWildcard,
i );
108 subtreeJumps.pop_back ( );
111 if ( !subtreeJumps.empty ( ) ) subtreeJumps.back ( ).first--;
Definition: ExactTreePatternAutomaton.h:21
static automaton::InputDrivenNPDA< common::ranked_symbol< SymbolType >, char, unsigned > construct(const tree::PrefixRankedBarTree< SymbolType > &tree, const common::ranked_symbol< SymbolType > &subtreeWildcard, const common::ranked_symbol< SymbolType > &variablesBar)
Definition: ExactTreePatternAutomaton.h:39
Definition: ranked_symbol.hpp:20
Class extending the deque class from the standard library. Original reason is to allow printing of th...
Definition: deque.hpp:44
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 with additional bar symb...
Definition: PrefixRankedBarTree.h:78
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
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: BackwardOccurrenceTest.h:17