Skip to content
Snippets Groups Projects
Commit 6164bf5b authored by Jan Trávníček's avatar Jan Trávníček
Browse files

format code

parent 96141d3d
No related branches found
No related tags found
No related merge requests found
......@@ -25,45 +25,50 @@ namespace arbology {
namespace exact {
 
automaton::Automaton ExactPatternMatchingAutomaton::construct ( const tree::RankedTreeWrapper & pattern ) {
return getInstance().dispatch(pattern.getData());
return getInstance ( ).dispatch ( pattern.getData ( ) );
}
 
automaton::InputDrivenNPDA ExactPatternMatchingAutomaton::construct(const tree::PrefixRankedTree& pattern) {
automaton::InputDrivenNPDA res(automaton::State(0), alphabet::symbolFrom('S'));
automaton::InputDrivenNPDA ExactPatternMatchingAutomaton::construct ( const tree::PrefixRankedTree & pattern ) {
automaton::InputDrivenNPDA res ( automaton::State ( 0 ), alphabet::symbolFrom ( 'S' ) );
 
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
res.addInputSymbol(alphabet::Symbol{symbol});
res.setPushdownStoreOperation(alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('S')}, std::vector<alphabet::Symbol>{symbol.getRank().getData(), alphabet::symbolFrom('S')});
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
res.addInputSymbol ( alphabet::Symbol { symbol } );
res.setPushdownStoreOperation ( alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'S' ) }, std::vector < alphabet::Symbol > { symbol.getRank ( ).getData ( ), alphabet::symbolFrom ( 'S' ) } );
}
 
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
res.addTransition(automaton::State(0), alphabet::Symbol{symbol}, automaton::State(0));
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
res.addTransition ( automaton::State ( 0 ), alphabet::Symbol { symbol }, automaton::State ( 0 ) );
}
int i = 1;
for(const alphabet::RankedSymbol& symbol : pattern.getContent()) {
res.addState(automaton::State(i));
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, automaton::State(i));
for ( const alphabet::RankedSymbol & symbol : pattern.getContent ( ) ) {
res.addState ( automaton::State ( i ) );
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, automaton::State ( i ) );
i++;
}
res.addFinalState(automaton::State(i-1));
res.addFinalState ( automaton::State ( i - 1 ) );
return res;
}
 
auto ExactPatternMatchingAutomatonPrefixRankedTree = ExactPatternMatchingAutomaton::RegistratorWrapper<automaton::InputDrivenNPDA, tree::PrefixRankedTree>(ExactPatternMatchingAutomaton::getInstance(), ExactPatternMatchingAutomaton::construct);
auto ExactPatternMatchingAutomatonPrefixRankedTree = ExactPatternMatchingAutomaton::RegistratorWrapper < automaton::InputDrivenNPDA, tree::PrefixRankedTree > ( ExactPatternMatchingAutomaton::getInstance ( ), ExactPatternMatchingAutomaton::construct );
std::vector < alphabet::Symbol > computeRHS ( const tree::PrefixRankedPattern & pattern, const std::vector < int > & patternSubtreeJumpTable, int i ) {
const std::vector < alphabet::RankedSymbol > & content = pattern.getContent ( );
 
std::vector<alphabet::Symbol> computeRHS(const tree::PrefixRankedPattern& pattern, const std::vector<int>& patternSubtreeJumpTable, int i) {
const std::vector<alphabet::RankedSymbol>& content = pattern.getContent();
unsigned rank = content[i].getRank ( ).getData ( );
 
unsigned rank = content[i].getRank().getData();
i++;
 
std::vector<alphabet::Symbol> res;
for(unsigned ranki = 0; ranki < rank; ranki++) {
if(content[i] == pattern.getSubtreeWildcard()) {
res.push_back(alphabet::symbolFrom('R'));
std::vector < alphabet::Symbol > res;
for ( unsigned ranki = 0; ranki < rank; ranki++ ) {
if ( content[i] == pattern.getSubtreeWildcard ( ) ) {
res.push_back ( alphabet::symbolFrom ( 'R' ) );
i++;
} else {
res.push_back(alphabet::symbolFrom('T'));
res.push_back ( alphabet::symbolFrom ( 'T' ) );
 
i = patternSubtreeJumpTable[i];
}
......@@ -72,127 +77,143 @@ std::vector<alphabet::Symbol> computeRHS(const tree::PrefixRankedPattern& patter
return res;
}
 
automaton::NPDA ExactPatternMatchingAutomaton::construct(const tree::PrefixRankedPattern& pattern) {
automaton::NPDA res(automaton::State(0), alphabet::symbolFrom('T'));
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
res.addInputSymbol(alphabet::Symbol{symbol});
automaton::NPDA ExactPatternMatchingAutomaton::construct ( const tree::PrefixRankedPattern & pattern ) {
automaton::NPDA res ( automaton::State ( 0 ), alphabet::symbolFrom ( 'T' ) );
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
res.addInputSymbol ( alphabet::Symbol { symbol } );
}
res.setStackAlphabet({alphabet::symbolFrom('T'), alphabet::symbolFrom('R')});
 
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
if(symbol == pattern.getSubtreeWildcard()) continue;
res.setStackAlphabet ( { alphabet::symbolFrom ( 'T' ), alphabet::symbolFrom ( 'R' ) } );
 
res.addTransition(automaton::State(0), alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('T')}, automaton::State(0), std::vector<alphabet::Symbol>{symbol.getRank().getData(), alphabet::symbolFrom('T')});
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
if ( symbol == pattern.getSubtreeWildcard ( ) ) continue;
res.addTransition ( automaton::State ( 0 ), alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'T' ) }, automaton::State ( 0 ), std::vector < alphabet::Symbol > { symbol.getRank ( ).getData ( ), alphabet::symbolFrom ( 'T' ) } );
}
 
std::vector < int > patternSubtreeJumpTable = SubtreeJumpTable::compute ( pattern );
 
int i = 1;
for(const alphabet::RankedSymbol& symbol : pattern.getContent()) {
res.addState(automaton::State(i));
if(symbol == pattern.getSubtreeWildcard()) {
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
if(symbol == pattern.getSubtreeWildcard()) continue;
 
if(symbol.getRank().getData() == 0) {
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('T')}, automaton::State(i-1), std::vector<alphabet::Symbol>{});
for ( const alphabet::RankedSymbol & symbol : pattern.getContent ( ) ) {
res.addState ( automaton::State ( i ) );
if ( symbol == pattern.getSubtreeWildcard ( ) )
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
if ( symbol == pattern.getSubtreeWildcard ( ) ) continue;
 
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('R')}, automaton::State(i), std::vector<alphabet::Symbol>{});
if ( symbol.getRank ( ).getData ( ) == 0 ) {
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'T' ) }, automaton::State ( i - 1 ), std::vector < alphabet::Symbol > { } );
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'R' ) }, automaton::State ( i ), std::vector < alphabet::Symbol > { } );
} else {
std::vector<alphabet::Symbol> push{symbol.getRank().getData(), alphabet::symbolFrom('T')};
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('T')}, automaton::State(i-1), push);
std::vector < alphabet::Symbol > push {
symbol.getRank ( ).getData ( ), alphabet::symbolFrom ( 'T' )
};
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'T' ) }, automaton::State ( i - 1 ), push );
 
push[symbol.getRank().getData() - 1] = alphabet::symbolFrom('R');
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('R')}, automaton::State(i-1), push);
push[symbol.getRank ( ).getData ( ) - 1] = alphabet::symbolFrom ( 'R' );
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'R' ) }, automaton::State ( i - 1 ), push );
}
}
 
} else {
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('T')}, automaton::State(i), computeRHS(pattern, patternSubtreeJumpTable, i-1));
}
else
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'T' ) }, automaton::State ( i ), computeRHS ( pattern, patternSubtreeJumpTable, i - 1 ) );
i++;
}
 
res.addFinalState(automaton::State(i-1));
res.addFinalState ( automaton::State ( i - 1 ) );
return res;
}
 
auto ExactPatternMatchingAutomatonPrefixRankedPattern = ExactPatternMatchingAutomaton::RegistratorWrapper<automaton::NPDA, tree::PrefixRankedPattern>(ExactPatternMatchingAutomaton::getInstance(), ExactPatternMatchingAutomaton::construct);
auto ExactPatternMatchingAutomatonPrefixRankedPattern = ExactPatternMatchingAutomaton::RegistratorWrapper < automaton::NPDA, tree::PrefixRankedPattern > ( ExactPatternMatchingAutomaton::getInstance ( ), ExactPatternMatchingAutomaton::construct );
 
automaton::State constructRecursiveTree(const tree::RankedNode & node, automaton::NFTA & res, int & nextState) {
std::vector<automaton::State> states;
states.reserve(node.getSymbol().getRank().getData());
for(const auto & child : node.getChildren()) {
states.push_back(constructRecursiveTree(*child, res, nextState));
}
automaton::State state (nextState++);
res.addState(state);
res.addTransition(node.getSymbol(), states, state);
automaton::State constructRecursiveTree ( const tree::RankedNode & node, automaton::NFTA & res, int & nextState ) {
std::vector < automaton::State > states;
states.reserve ( node.getSymbol ( ).getRank ( ).getData ( ) );
for ( const auto & child : node.getChildren ( ) )
states.push_back ( constructRecursiveTree ( * child, res, nextState ) );
automaton::State state ( nextState++ );
res.addState ( state );
res.addTransition ( node.getSymbol ( ), states, state );
return state;
}
 
automaton::NFTA ExactPatternMatchingAutomaton::construct(const tree::RankedTree & pattern) {
const std::set<alphabet::RankedSymbol>& alphabet = pattern.getAlphabet();
automaton::NFTA ExactPatternMatchingAutomaton::construct ( const tree::RankedTree & pattern ) {
const std::set < alphabet::RankedSymbol > & alphabet = pattern.getAlphabet ( );
automaton::NFTA res;
res.setInputSymbols(alphabet);
res.setInputSymbols ( alphabet );
int nextState = 0;
res.addFinalState(constructRecursiveTree(pattern.getRoot(), res, nextState));
res.addFinalState ( constructRecursiveTree ( pattern.getRoot ( ), res, nextState ) );
return res;
}
 
auto ExactPatternMatchingAutomatonRankedTree = ExactPatternMatchingAutomaton::RegistratorWrapper<automaton::NFTA, tree::RankedTree>(ExactPatternMatchingAutomaton::getInstance(), ExactPatternMatchingAutomaton::construct);
automaton::State constructRecursivePattern(const tree::RankedNode & node, automaton::NFTA & res, const alphabet::RankedSymbol& subtreeWildcard, const automaton::State& loopState, int & nextState) {
if(node.getSymbol() == subtreeWildcard) {
automaton::State state (nextState++);
res.addState(state);
for(const alphabet::RankedSymbol& symbol : res.getInputAlphabet()) {
std::vector<automaton::State> states;
states.reserve(symbol.getRank().getData());
for(unsigned i = 0; i < symbol.getRank().getData(); i++) {
states.push_back(loopState);
}
res.addTransition(symbol, states, state);
auto ExactPatternMatchingAutomatonRankedTree = ExactPatternMatchingAutomaton::RegistratorWrapper < automaton::NFTA, tree::RankedTree > ( ExactPatternMatchingAutomaton::getInstance ( ), ExactPatternMatchingAutomaton::construct );
automaton::State constructRecursivePattern ( const tree::RankedNode & node, automaton::NFTA & res, const alphabet::RankedSymbol & subtreeWildcard, const automaton::State & loopState, int & nextState ) {
if ( node.getSymbol ( ) == subtreeWildcard ) {
automaton::State state ( nextState++ );
res.addState ( state );
for ( const alphabet::RankedSymbol & symbol : res.getInputAlphabet ( ) ) {
std::vector < automaton::State > states;
states.reserve ( symbol.getRank ( ).getData ( ) );
for ( unsigned i = 0; i < symbol.getRank ( ).getData ( ); i++ )
states.push_back ( loopState );
res.addTransition ( symbol, states, state );
}
return state;
} else {
std::vector<automaton::State> states;
states.reserve(node.getSymbol().getRank().getData());
for(const auto & child : node.getChildren()) {
states.push_back(constructRecursivePattern(*child, res, subtreeWildcard, loopState, nextState));
}
automaton::State state (nextState++);
res.addState(state);
res.addTransition(node.getSymbol(), states, state);
std::vector < automaton::State > states;
states.reserve ( node.getSymbol ( ).getRank ( ).getData ( ) );
for ( const auto & child : node.getChildren ( ) )
states.push_back ( constructRecursivePattern ( * child, res, subtreeWildcard, loopState, nextState ) );
automaton::State state ( nextState++ );
res.addState ( state );
res.addTransition ( node.getSymbol ( ), states, state );
return state;
}
}
 
automaton::NFTA ExactPatternMatchingAutomaton::construct(const tree::RankedPattern & pattern) {
std::set<alphabet::RankedSymbol> alphabet = pattern.getAlphabet();
alphabet.erase(pattern.getSubtreeWildcard());
automaton::NFTA ExactPatternMatchingAutomaton::construct ( const tree::RankedPattern & pattern ) {
std::set < alphabet::RankedSymbol > alphabet = pattern.getAlphabet ( );
alphabet.erase ( pattern.getSubtreeWildcard ( ) );
 
automaton::NFTA res;
res.setInputSymbols(alphabet);
res.setInputSymbols ( alphabet );
 
int nextState = 0;
 
automaton::State loopState (nextState++);
res.addState(loopState);
for(const alphabet::RankedSymbol& symbol : res.getInputAlphabet()) {
std::vector<automaton::State> states;
states.reserve(symbol.getRank().getData());
for(unsigned i = 0; i < symbol.getRank().getData(); i++) {
states.push_back(loopState);
}
res.addTransition(symbol, states, loopState);
automaton::State loopState ( nextState++ );
res.addState ( loopState );
for ( const alphabet::RankedSymbol & symbol : res.getInputAlphabet ( ) ) {
std::vector < automaton::State > states;
states.reserve ( symbol.getRank ( ).getData ( ) );
for ( unsigned i = 0; i < symbol.getRank ( ).getData ( ); i++ )
states.push_back ( loopState );
res.addTransition ( symbol, states, loopState );
}
 
res.addFinalState(constructRecursivePattern(pattern.getRoot(), res, pattern.getSubtreeWildcard(), loopState, nextState));
res.addFinalState ( constructRecursivePattern ( pattern.getRoot ( ), res, pattern.getSubtreeWildcard ( ), loopState, nextState ) );
return res;
}
 
auto ExactPatternMatchingAutomatonRankedPattern = ExactPatternMatchingAutomaton::RegistratorWrapper<automaton::NFTA, tree::RankedPattern>(ExactPatternMatchingAutomaton::getInstance(), ExactPatternMatchingAutomaton::construct);
auto ExactPatternMatchingAutomatonRankedPattern = ExactPatternMatchingAutomaton::RegistratorWrapper < automaton::NFTA, tree::RankedPattern > ( ExactPatternMatchingAutomaton::getInstance ( ), ExactPatternMatchingAutomaton::construct );
 
} /* namespace exact */
 
......
......@@ -18,9 +18,9 @@ namespace arbology {
 
namespace exact {
 
class ExactPatternMatchingAutomaton : public std::SingleDispatch<automaton::Automaton, tree::RankedTreeBase> {
class ExactPatternMatchingAutomaton : public std::SingleDispatch < automaton::Automaton, tree::RankedTreeBase > {
public:
ExactPatternMatchingAutomaton() {}
ExactPatternMatchingAutomaton ( ) { }
 
/**
* Performs conversion.
......@@ -28,15 +28,17 @@ public:
*/
static automaton::Automaton construct ( const tree::RankedTreeWrapper & pattern );
 
static automaton::NPDA construct(const tree::PrefixRankedPattern& pattern);
static automaton::InputDrivenNPDA construct(const tree::PrefixRankedTree& pattern);
static automaton::NFTA construct(const tree::RankedTree& pattern);
static automaton::NFTA construct(const tree::RankedPattern& pattern);
static automaton::NPDA construct ( const tree::PrefixRankedPattern & pattern );
static automaton::InputDrivenNPDA construct ( const tree::PrefixRankedTree & pattern );
static automaton::NFTA construct ( const tree::RankedTree & pattern );
static automaton::NFTA construct ( const tree::RankedPattern & pattern );
 
static ExactPatternMatchingAutomaton& getInstance() {
static ExactPatternMatchingAutomaton & getInstance ( ) {
static ExactPatternMatchingAutomaton res;
return res;
}
};
 
} /* namespace exact */
......
......@@ -19,54 +19,60 @@ namespace arbology {
 
namespace exact {
 
automaton::Automaton ExactSubtreeMatchingAutomaton::construct(const tree::Tree& pattern) {
return getInstance().dispatch(pattern.getData());
automaton::Automaton ExactSubtreeMatchingAutomaton::construct ( const tree::Tree & pattern ) {
return getInstance ( ).dispatch ( pattern.getData ( ) );
}
 
automaton::InputDrivenNPDA ExactSubtreeMatchingAutomaton::construct(const tree::PrefixRankedTree& pattern) {
automaton::InputDrivenNPDA res(automaton::State(0), alphabet::symbolFrom('S'));
automaton::InputDrivenNPDA ExactSubtreeMatchingAutomaton::construct ( const tree::PrefixRankedTree & pattern ) {
automaton::InputDrivenNPDA res ( automaton::State ( 0 ), alphabet::symbolFrom ( 'S' ) );
 
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
res.addInputSymbol(alphabet::Symbol{symbol});
res.setPushdownStoreOperation(alphabet::Symbol{symbol}, std::vector<alphabet::Symbol>{1, alphabet::symbolFrom('S')}, std::vector<alphabet::Symbol>{symbol.getRank().getData(), alphabet::symbolFrom('S')});
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
res.addInputSymbol ( alphabet::Symbol { symbol } );
res.setPushdownStoreOperation ( alphabet::Symbol { symbol }, std::vector < alphabet::Symbol > { 1, alphabet::symbolFrom ( 'S' ) }, std::vector < alphabet::Symbol > { symbol.getRank ( ).getData ( ), alphabet::symbolFrom ( 'S' ) } );
}
 
for(const alphabet::RankedSymbol& symbol : pattern.getAlphabet()) {
res.addTransition(automaton::State(0), alphabet::Symbol{symbol}, automaton::State(0));
for ( const alphabet::RankedSymbol & symbol : pattern.getAlphabet ( ) ) {
res.addTransition ( automaton::State ( 0 ), alphabet::Symbol { symbol }, automaton::State ( 0 ) );
}
int i = 1;
for(const alphabet::RankedSymbol& symbol : pattern.getContent()) {
res.addState(automaton::State(i));
res.addTransition(automaton::State(i-1), alphabet::Symbol{symbol}, automaton::State(i));
for ( const alphabet::RankedSymbol & symbol : pattern.getContent ( ) ) {
res.addState ( automaton::State ( i ) );
res.addTransition ( automaton::State ( i - 1 ), alphabet::Symbol { symbol }, automaton::State ( i ) );
i++;
}
res.addFinalState(automaton::State(i-1));
res.addFinalState ( automaton::State ( i - 1 ) );
return res;
}
 
auto ExactSubtreeMatchingAutomatonPrefixRankedTree = ExactSubtreeMatchingAutomaton::RegistratorWrapper<automaton::InputDrivenNPDA, tree::PrefixRankedTree>(ExactSubtreeMatchingAutomaton::getInstance(), ExactSubtreeMatchingAutomaton::construct);
auto ExactSubtreeMatchingAutomatonPrefixRankedTree = ExactSubtreeMatchingAutomaton::RegistratorWrapper < automaton::InputDrivenNPDA, tree::PrefixRankedTree > ( ExactSubtreeMatchingAutomaton::getInstance ( ), ExactSubtreeMatchingAutomaton::construct );
 
automaton::State constructRecursive(const tree::RankedNode & node, automaton::NFTA & res, int & nextState) {
std::vector<automaton::State> states;
states.reserve(node.getSymbol().getRank().getData());
for(const auto & child : node.getChildren()) {
states.push_back(constructRecursive(*child, res, nextState));
}
automaton::State state (nextState++);
res.addState(state);
res.addTransition(node.getSymbol(), states, state);
automaton::State constructRecursive ( const tree::RankedNode & node, automaton::NFTA & res, int & nextState ) {
std::vector < automaton::State > states;
states.reserve ( node.getSymbol ( ).getRank ( ).getData ( ) );
for ( const auto & child : node.getChildren ( ) )
states.push_back ( constructRecursive ( * child, res, nextState ) );
automaton::State state ( nextState++ );
res.addState ( state );
res.addTransition ( node.getSymbol ( ), states, state );
return state;
}
 
automaton::NFTA ExactSubtreeMatchingAutomaton::construct(const tree::RankedTree & pattern) {
automaton::NFTA ExactSubtreeMatchingAutomaton::construct ( const tree::RankedTree & pattern ) {
automaton::NFTA res;
res.setInputSymbols(pattern.getAlphabet());
res.setInputSymbols ( pattern.getAlphabet ( ) );
int nextState = 0;
res.addFinalState(constructRecursive(pattern.getRoot(), res, nextState));
res.addFinalState ( constructRecursive ( pattern.getRoot ( ), res, nextState ) );
return res;
}
 
auto ExactSubtreeMatchingAutomatonRankedTree = ExactSubtreeMatchingAutomaton::RegistratorWrapper<automaton::NFTA, tree::RankedTree>(ExactSubtreeMatchingAutomaton::getInstance(), ExactSubtreeMatchingAutomaton::construct);
auto ExactSubtreeMatchingAutomatonRankedTree = ExactSubtreeMatchingAutomaton::RegistratorWrapper < automaton::NFTA, tree::RankedTree > ( ExactSubtreeMatchingAutomaton::getInstance ( ), ExactSubtreeMatchingAutomaton::construct );
 
} /* namespace exact */
 
......
......@@ -18,23 +18,25 @@ namespace arbology {
 
namespace exact {
 
class ExactSubtreeMatchingAutomaton : public std::SingleDispatch<automaton::Automaton, tree::TreeBase> {
class ExactSubtreeMatchingAutomaton : public std::SingleDispatch < automaton::Automaton, tree::TreeBase > {
public:
ExactSubtreeMatchingAutomaton() {}
ExactSubtreeMatchingAutomaton ( ) { }
 
/**
* Performs conversion.
* @return left regular grammar equivalent to source automaton.
*/
static automaton::Automaton construct(const tree::Tree& pattern);
static automaton::Automaton construct ( const tree::Tree & pattern );
 
static automaton::InputDrivenNPDA construct(const tree::PrefixRankedTree& pattern);
static automaton::NFTA construct(const tree::RankedTree& pattern);
static automaton::InputDrivenNPDA construct ( const tree::PrefixRankedTree & pattern );
static automaton::NFTA construct ( const tree::RankedTree & pattern );
 
static ExactSubtreeMatchingAutomaton& getInstance() {
static ExactSubtreeMatchingAutomaton & getInstance ( ) {
static ExactSubtreeMatchingAutomaton res;
return res;
}
};
 
} /* namespace exact */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment