Newer
Older
/*
* ExactNonlinearTreePatternAutomaton.h
*
* Created on: 7. 4. 2015
* Author: Jan Travnicek
*/
#ifndef _EXACT_NONLINEAR_TREE_PATTERN_AUTOMATON_H__
#define _EXACT_NONLINEAR_TREE_PATTERN_AUTOMATON_H__
#include <automaton/AutomatonFeatures.h>
#include <tree/TreeFeatures.h>
#include <core/multipleDispatch.hpp>
#include <alphabet/RankedSymbol.h>
#include <vector>
namespace arbology {
namespace exact {
class ExactNonlinearTreePatternAutomaton : public alib::SingleDispatch < ExactNonlinearTreePatternAutomaton, automaton::Automaton, const tree::TreeBase &, const DefaultSymbolType &, const ext::set < DefaultSymbolType > & > {
static automaton::InputDrivenNPDA < > constructInternal ( const tree::PrefixRankedTree < > & tree, const DefaultSymbolType & subtreeWildcard, const DefaultSymbolType & currentNonlinearVariable, const ext::set < DefaultSymbolType > & nonlinearVariables );
static void constructTail ( automaton::InputDrivenNPDA < > & res, const tree::PrefixRankedTree < > & tree, const DefaultSymbolType & subtreeWildcard, const DefaultSymbolType & currentNonlinearVariable, const ext::set < DefaultSymbolType > & nonlinearVariables, unsigned subtreeId, ext::vector < common::ranked_symbol < > >::const_iterator rankedSymbolsIter, int i, ext::vector < common::ranked_symbol < unsigned, DefaultRankType > >::const_iterator subtreeRepeatsIter );
public:
/**
* Performs conversion.
* @return left regular grammar equivalent to source automaton.
*/
static automaton::Automaton construct ( const tree::Tree & tree, const DefaultSymbolType & subtreeWildcard, const ext::set < DefaultSymbolType > & nonlinearVariables );
static automaton::InputDrivenNPDA < > construct ( const tree::PrefixRankedTree < > & tree, const DefaultSymbolType & subtreeWildcard, const ext::set < DefaultSymbolType > & nonlinearVariables );
};
} /* namespace exact */
} /* namespace arbology */
#endif /* _EXACT_NONLINEAR_TREE_PATTERN_AUTOMATON_H__ */