Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Nonlinear tree pattern represented as linear sequece as result of preorder traversal. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer. Additionally the pattern contains a special wildcard symbol representing any subtree and nonlinear variables each to represent same subtree (in the particular occurrence in a tree). More...
#include <PrefixRankedNonlinearPattern.h>
Public Member Functions | |
PrefixRankedNonlinearPattern (common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > nonlinearVariables, ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the pattern with concrete alphabet, content, wildcard, and nonlinear variables. More... | |
PrefixRankedNonlinearPattern (common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > nonlinearVariables, ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the pattern with concrete content, wildcard, and nonlinear variables. The alphabet is deduced from the content. More... | |
PrefixRankedNonlinearPattern (common::ranked_symbol< SymbolType > subtreeWildcard, ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the pattern with concrete content and wildcard. The alphabet is deduced from the content. Nonlinear variables are defaultly constructed to empty set. More... | |
PrefixRankedNonlinearPattern (const PrefixRankedTree< SymbolType > &tree) | |
Creates a new instance of the pattern based on the PrefixRankedTree. The linear representation is copied from tree. Alphabet as well. subtree wildcard is defaultly constructed and nonlinear variables are defaultly constructed to empty set. More... | |
PrefixRankedNonlinearPattern (const PrefixRankedPattern< SymbolType > &tree) | |
Creates a new instance of the pattern based on the PrefixRankedPattern. The linear representation is copied from tree. Subtree wildcard and alphabet as well. Nonlinear variables are defaultly constructed to empty set. More... | |
PrefixRankedNonlinearPattern (const RankedTree< SymbolType > &tree) | |
Creates a new instance of the pattern based on the RankedTree. The linear representation is constructed by preorder traversal on the tree parameter. The subtree wildcard is defaultly constructed and nonlinear variables are defaultly constructed to empty set. More... | |
PrefixRankedNonlinearPattern (const RankedPattern< SymbolType > &tree) | |
Creates a new instance of the pattern based on the RankedPattern. The linear representation is constructed by preorder traversal on the tree parameter. The subtree wildcard is provided by the pattern parameter and nonlinear variables are defaultly constructed to empty set. More... | |
PrefixRankedNonlinearPattern (const RankedNonlinearPattern< SymbolType > &tree) | |
Creates a new instance of the pattern based on the RankedNonlinearPattern. The linear representation is constructed by preorder traversal on the tree parameter. The subtree wildcard and nonlinear variables are provided by the pattern parameter. More... | |
const ext::set< common::ranked_symbol< SymbolType > > & | getAlphabet () const & |
ext::set< common::ranked_symbol< SymbolType > > && | getAlphabet () && |
void | extendAlphabet (const ext::set< common::ranked_symbol< SymbolType > > &symbols) |
const common::ranked_symbol< SymbolType > & | getSubtreeWildcard () const & |
common::ranked_symbol< SymbolType > && | getSubtreeWildcard () && |
const ext::set< common::ranked_symbol< SymbolType > > & | getNonlinearVariables () const & |
ext::set< common::ranked_symbol< SymbolType > > && | getNonlinearVariables () && |
const ext::vector< common::ranked_symbol< SymbolType > > & | getContent () const & |
ext::vector< common::ranked_symbol< SymbolType > > && | getContent () && |
void | setContent (ext::vector< common::ranked_symbol< SymbolType > > data) |
bool | isEmpty () const |
auto | operator<=> (const PrefixRankedNonlinearPattern &other) const |
bool | operator== (const PrefixRankedNonlinearPattern &other) const |
operator string::LinearString< common::ranked_symbol< SymbolType > > () const | |
Creates a new instance of the string from a linear representation of a tree. More... | |
![]() | |
void | accessComponent () |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const PrefixRankedNonlinearPattern &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Nonlinear tree pattern represented as linear sequece as result of preorder traversal. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer. Additionally the pattern contains a special wildcard symbol representing any subtree and nonlinear variables each to represent same subtree (in the particular occurrence in a tree).
T = (A, C, W \in A, V \in A ), A (Alphabet) = finite set of ranked symbols, C (Content) = linear representation of the pattern content W (Wildcard) = special symbol representing any subtree V (Variables) = finite set of special symbols each representing same subtree
SymbolType | used for the symbol part of the ranked symbol |
|
explicit |
Creates a new instance of the pattern with concrete alphabet, content, wildcard, and nonlinear variables.
subtreeWildcard | the wildcard symbol |
nonlinearVariables | the set of nonlinear variables |
alphabet | the initial alphabet of the pattern |
data | the initial pattern in linear representation |
|
explicit |
Creates a new instance of the pattern with concrete content, wildcard, and nonlinear variables. The alphabet is deduced from the content.
subtreeWildcard | the wildcard symbol |
nonlinearVariables | the set of nonlinear variables |
data | the initial pattern in linear representation |
|
explicit |
Creates a new instance of the pattern with concrete content and wildcard. The alphabet is deduced from the content. Nonlinear variables are defaultly constructed to empty set.
subtreeWildcard | the wildcard symbol |
data | the initial pattern in linear representation |
|
explicit |
Creates a new instance of the pattern based on the PrefixRankedTree. The linear representation is copied from tree. Alphabet as well. subtree wildcard is defaultly constructed and nonlinear variables are defaultly constructed to empty set.
tree | representation of a tree. |
|
explicit |
Creates a new instance of the pattern based on the PrefixRankedPattern. The linear representation is copied from tree. Subtree wildcard and alphabet as well. Nonlinear variables are defaultly constructed to empty set.
tree | representation of a tree. |
|
explicit |
Creates a new instance of the pattern based on the RankedTree. The linear representation is constructed by preorder traversal on the tree parameter. The subtree wildcard is defaultly constructed and nonlinear variables are defaultly constructed to empty set.
tree | representation of a tree. |
|
explicit |
Creates a new instance of the pattern based on the RankedPattern. The linear representation is constructed by preorder traversal on the tree parameter. The subtree wildcard is provided by the pattern parameter and nonlinear variables are defaultly constructed to empty set.
tree | representation of a pattern. |
|
explicit |
Creates a new instance of the pattern based on the RankedNonlinearPattern. The linear representation is constructed by preorder traversal on the tree parameter. The subtree wildcard and nonlinear variables are provided by the pattern parameter.
tree | representation of a pattern. |
|
inline |
Adder of an alphabet symbols.
symbols | the new symbols to be added to the alphabet |
|
inline |
Getter of the alphabet.
|
inline |
Getter of the alphabet.
ext::vector< common::ranked_symbol< SymbolType > > && tree::PrefixRankedNonlinearPattern< SymbolType >::getContent | ( | ) | && |
Getter of the pattern representation.
const ext::vector< common::ranked_symbol< SymbolType > > & tree::PrefixRankedNonlinearPattern< SymbolType >::getContent | ( | ) | const & |
Getter of the pattern representation.
|
inline |
Getter of the nonlinear variables.
|
inline |
Getter of the nonlinear variables.
|
inline |
Getter of the wildcard symbol.
|
inline |
Getter of the wildcard symbol.
bool tree::PrefixRankedNonlinearPattern< SymbolType >::isEmpty |
|
inlineexplicit |
Creates a new instance of the string from a linear representation of a tree.
|
inline |
The three way comparison implementation
other | the other instance |
other
.
|
inline |
The equality comparison implementation.
other | the other object to compare with. |
void tree::PrefixRankedNonlinearPattern< SymbolType >::setContent | ( | ext::vector< common::ranked_symbol< SymbolType > > | data | ) |
Setter of the representation of the pattern.
TreeException | when new pattern representation is not valid or when symbol of the representation are not present in the alphabet |
data | new List of symbols forming the representation of the pattern. |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |