44 template <
class SymbolType >
47 template <
class SymbolType >
50 template <
class SymbolType >
53 template <
class SymbolType >
56 template <
class SymbolType >
59 template <
class SymbolType >
62 template <
class SymbolType >
65 template <
class SymbolType >
68 template <
class SymbolType >
71 template <
class SymbolType >
74 template <
class SymbolType >
79template <
class SymbolType >
83 unsigned rank = content [
i ].getRank ( );
89 for (
unsigned ranki = 0; ranki < rank; ranki++ ) {
91 res.push_back (
'R' );
94 res.push_back (
'T' );
96 i = patternSubtreeJumpTable [
i ];
103template <
class SymbolType >
110 res.addInputSymbol ( symbol );
113 res.setPushdownStoreAlphabet ( {
'T',
'R' } );
132 if ( alphabetSymbol.getRank ( ) == 0 ) {
140 push [ alphabetSymbol.getRank ( ) - 1 ] =
'R';
151 res.addFinalState (
i - 1 );
156template <
class SymbolType >
161template <
class SymbolType >
166 res.addInitialState ( 0 );
171 if ( pattern.
getBars ( ).count ( symbol ) )
172 res.addReturnInputSymbol ( symbol );
174 res.addCallInputSymbol ( symbol );
177 res.setPushdownStoreAlphabet ( { alphabet::BottomOfTheStackSymbol::instance < char > ( ) ,
'T',
'R' } );
182 if ( pattern.
getBars ( ).count ( symbol ) )
183 res.addReturnTransition ( 0, symbol,
'T', 0 );
185 res.addCallTransition ( 0, symbol, 0,
'T' );
197 res.addCallTransition (
i - 1, alphabetSymbol,
i,
'R' );
203 if ( pattern.
getBars ( ).count ( alphabetSymbol ) )
204 res.addReturnTransition (
i - 1, alphabetSymbol,
'T',
i - 1 );
206 res.addCallTransition (
i - 1, alphabetSymbol,
i - 1,
'T' );
212 res.addReturnTransition (
i - 1, alphabetSymbol,
'R',
i );
214 }
else if ( pattern.
getBars ( ).count ( symbol ) ) {
215 res.addReturnTransition (
i - 1, symbol,
'T',
i );
217 res.addCallTransition (
i - 1, symbol,
i,
'T' );
223 res.addFinalState (
i - 1 );
227template <
class SymbolType >
232template <
class SymbolType >
237template <
class SymbolType >
239 if (
node.getData ( ) == subtreeWildcard ) {
240 unsigned state = nextState++;
241 res.addState ( state );
245 states.reserve ( symbol.getRank ( ) );
247 for (
unsigned i = 0;
i < symbol.getRank ( );
i++ )
248 states.push_back ( state );
250 res.addTransition ( symbol, states, state );
256 states.reserve (
node.getData ( ).getRank ( ) );
261 unsigned state = nextState++;
262 res.addState ( state );
263 res.addTransition (
node.getData ( ), states, state );
268template <
class SymbolType >
277 unsigned nextState = 0;
283template <
class SymbolType >
288template <
class SymbolType >
290 if (
node.getData ( ) == subtreeWildcard ) {
291 unsigned state = nextState++;
292 res.addState ( state );
297 for (
unsigned i = 0;
i < symbol.getRank ( );
i++ )
298 states.insert ( state );
300 res.addTransition ( symbol, states, state );
310 unsigned state = nextState++;
311 res.addState ( state );
312 res.addTransition (
node.getData ( ), states, state );
317template <
class SymbolType >
326 unsigned nextState = 0;
332template <
class SymbolType >
337template <
class SymbolType >
342template <
class SymbolType >
344 unsigned state = nextState ++;
345 res.addState ( state );
346 if (
node.getData ( ) == nodeWildcard ) {
347 for (
const SymbolType & symbol :
res.getInputAlphabet ( ) ) {
348 res.addTransition ( symbol, { }, state );
351 res.addTransition (
node.getData ( ), { }, state );
355 res.addState ( nextState );
356 unsigned target = nextState ++;
357 if ( child.getData ( ) == subtreeWildcard ) {
358 res.addTransition ( state, { 0u }, target );
359 }
else if ( child.getData ( ) == subtreeGap ) {
360 res.addTransition ( state, { 0u }, state );
362 res.addTransition ( state, { }, target );
365 res.addTransition ( state, {
result }, target );
373template <
class SymbolType >
387 res.addTransition ( symbol, { }, 0 );
389 res.addTransition ( 0u, { 0u }, 0 );
391 unsigned nextState = 1;
Definition: ExactPatternMatchingAutomaton.h:38
static automaton::NPDA< common::ranked_symbol< SymbolType >, char, unsigned > construct(const tree::PrefixRankedPattern< SymbolType > &pattern)
Definition: ExactPatternMatchingAutomaton.h:104
static automaton::InputDrivenNPDA< common::ranked_symbol< SymbolType >, char, unsigned > construct(const tree::PrefixRankedTree< SymbolType > &pattern)
Definition: ExactSubtreeMatchingAutomaton.h:48
Nondeterministic finite tree automaton without epsilon transitions. Accepts regular tree languages.
Definition: NFTA.h:72
Nondeterministic Z-Automaton. Computation model for unranked regular tree languages.
Definition: NondeterministicZAutomaton.h:68
Nondeterministic unordered finite tree automaton without epsilon transitions. Accepts regular tree la...
Definition: UnorderedNFTA.h:72
Nondeterministic visibly pushdown automaton. Accepts subset of context free languages.
Definition: VisiblyPushdownNPDA.h:81
Definition: ranked_symbol.hpp:20
Definition: multiset.hpp:44
Class introducing a tree with interface trying to be close to the interface of standard library conta...
Definition: tree.hpp:52
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Tree pattern represented as linear sequece as result of preorder traversal with additional bar symbol...
Definition: PrefixRankedBarPattern.h:85
const common::ranked_symbol< SymbolType > & getVariablesBar() const &
Definition: PrefixRankedBarPattern.h:220
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: PrefixRankedBarPattern.h:202
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: PrefixRankedBarPattern.h:148
const ext::set< common::ranked_symbol< SymbolType > > & getBars() const &
Definition: PrefixRankedBarPattern.h:175
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedBarPattern.h:334
Tree structure represented as linear sequece as result of preorder traversal with additional bar symb...
Definition: PrefixRankedBarTree.h:78
Tree pattern represented as linear sequece as result of preorder traversal. The representation is so ...
Definition: PrefixRankedPattern.h:77
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedPattern.h:262
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: PrefixRankedPattern.h:127
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: PrefixRankedPattern.h:154
Tree structure represented as linear sequece as result of preorder traversal. The representation is s...
Definition: PrefixRankedTree.h:71
Tree pattern represented in its natural representation. The representation is so called ranked,...
Definition: RankedPattern.h:72
const ext::tree< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: RankedPattern.h:251
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: RankedPattern.h:126
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: RankedPattern.h:153
Tree structure represented in its natural representation. The representation is so called ranked,...
Definition: RankedTree.h:72
Tree pattern represented in its natural representation. The representation is so called ranked,...
Definition: UnorderedRankedPattern.h:72
const ext::tree< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: UnorderedRankedPattern.h:251
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: UnorderedRankedPattern.h:126
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: UnorderedRankedPattern.h:153
Tree structure represented in its natural representation. The representation is so called ranked,...
Definition: UnorderedRankedTree.h:70
Extended tree pattern represented in its natural representation. The representation is so called unra...
Definition: UnrankedExtendedPattern.h:76
const SymbolType & getNodeWildcard() const &
Definition: UnrankedExtendedPattern.h:150
const ext::set< SymbolType > & getAlphabet() const &
Definition: UnrankedExtendedPattern.h:123
const SymbolType & getSubtreeGap() const &
Definition: UnrankedExtendedPattern.h:186
const SymbolType & getSubtreeWildcard() const &
Definition: UnrankedExtendedPattern.h:168
const ext::tree< SymbolType > & getContent() const &
Definition: UnrankedExtendedPattern.h:285
Tree pattern represented in its natural representation. The representation is so called unranked,...
Definition: UnrankedPattern.h:73
Tree represented in its natural representation. The representation is so called unranked,...
Definition: UnrankedTree.h:69
static ext::vector< int > compute(const tree::PrefixRankedBarTree< SymbolType > &subject)
Definition: SubtreeJumpTable.h:49
Definition: BarSymbol.cpp:12
unsigned constructRecursivePattern(const ext::tree< common::ranked_symbol< SymbolType > > &node, automaton::NFTA< SymbolType, unsigned > &res, const common::ranked_symbol< SymbolType > &subtreeWildcard, unsigned &nextState)
Definition: ExactPatternMatchingAutomaton.h:238
ext::vector< char > computeRHS(const tree::PrefixRankedPattern< SymbolType > &pattern, const ext::vector< int > &patternSubtreeJumpTable, int i)
Definition: ExactPatternMatchingAutomaton.h:80
Definition: BoyerMooreHorspool.h:22
int i
Definition: AllEpsilonClosure.h:118
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
return res
Definition: MinimizeByPartitioning.h:145
for(const StateType &state :fsm.getStates()) renamingData.insert(std Rename::RenamedAutomaton< T > result(renamingData.at(fsm.getInitialState()))
Definition: Rename.h:253