Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Friends
tree::RankedExtendedPattern< SymbolType > Class Template Reference

Extended tree pattern represented in its natural representation. 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 other special wildcard symbols representing any label at the corresponding node in the match. More...

#include <RankedExtendedPattern.h>

Inheritance diagram for tree::RankedExtendedPattern< SymbolType >:
[legend]
Collaboration diagram for tree::RankedExtendedPattern< SymbolType >:
[legend]

Public Member Functions

 RankedExtendedPattern (common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > nodeWildcards, ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::tree< common::ranked_symbol< SymbolType > > pattern)
 Creates a new instance of the pattern with concrete alphabet, content, and wildcard. More...
 
 RankedExtendedPattern (common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > nodeWildcards, ext::tree< common::ranked_symbol< SymbolType > > pattern)
 Creates a new instance of the pattern with concrete content and wildcard. The alphabet is deduced from the content. More...
 
 RankedExtendedPattern (const RankedPattern< SymbolType > &other)
 Creates a new instance of the pattern based on RankedPattern, the alphabet is taken from the RankedPattern. 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 ext::set< common::ranked_symbol< SymbolType > > & getNodeWildcards () const &
 
ext::set< common::ranked_symbol< SymbolType > > && getNodeWildcards () &&
 
void extendNodeWildcards (const ext::set< common::ranked_symbol< SymbolType > > &symbols)
 
const common::ranked_symbol< SymbolType > & getSubtreeWildcard () const &
 
common::ranked_symbol< SymbolType > && getSubtreeWildcard () &&
 
const ext::tree< common::ranked_symbol< SymbolType > > & getContent () const &
 
ext::tree< common::ranked_symbol< SymbolType > > && getContent () &&
 
void setTree (ext::tree< common::ranked_symbol< SymbolType > > pattern)
 
auto operator<=> (const RankedExtendedPattern &other) const
 
bool operator== (const RankedExtendedPattern &other) const
 
void nicePrint (ext::ostream &os) const
 
- Public Member Functions inherited from core::Components< RankedExtendedPattern< SymbolType >, ext::set< common::ranked_symbol< SymbolType > >, component::Set, std::tuple< GeneralAlphabet, NodeWildcards >, common::ranked_symbol< SymbolType >, component::Value, SubtreeWildcard >
void accessComponent ()
 

Friends

ext::ostreamoperator<< (ext::ostream &out, const RankedExtendedPattern &instance)
 

Additional Inherited Members

- Static Public Member Functions inherited from core::Components< RankedExtendedPattern< SymbolType >, ext::set< common::ranked_symbol< SymbolType > >, component::Set, std::tuple< GeneralAlphabet, NodeWildcards >, common::ranked_symbol< SymbolType >, component::Value, SubtreeWildcard >
static void registerComponent ()
 
static void unregisterComponent ()
 

Detailed Description

template<class SymbolType>
class tree::RankedExtendedPattern< SymbolType >

Extended tree pattern represented in its natural representation. 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 other special wildcard symbols representing any label at the corresponding node in the match.

T = (A, C, W \in A, N \in A), A (Alphabet) = finite set of ranked symbols, C (Content) = pattern in its natural representation W (Wildcard) = special symbol representing any subtree N (Node Wildcards) = special symbol representing any label

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol

Constructor & Destructor Documentation

◆ RankedExtendedPattern() [1/3]

template<class SymbolType >
tree::RankedExtendedPattern< SymbolType >::RankedExtendedPattern ( common::ranked_symbol< SymbolType >  subtreeWildcard,
ext::set< common::ranked_symbol< SymbolType > >  nodeWildcards,
ext::set< common::ranked_symbol< SymbolType > >  alphabet,
ext::tree< common::ranked_symbol< SymbolType > >  pattern 
)
explicit

Creates a new instance of the pattern with concrete alphabet, content, and wildcard.

Parameters
subtreeWildcardthe wildcard symbol
alphabetthe initial alphabet of the pattern
patternthe initial content in it's natural representation

◆ RankedExtendedPattern() [2/3]

template<class SymbolType >
tree::RankedExtendedPattern< SymbolType >::RankedExtendedPattern ( common::ranked_symbol< SymbolType >  subtreeWildcard,
ext::set< common::ranked_symbol< SymbolType > >  nodeWildcards,
ext::tree< common::ranked_symbol< SymbolType > >  pattern 
)
explicit

Creates a new instance of the pattern with concrete content and wildcard. The alphabet is deduced from the content.

Parameters
subtreeWildcardthe wildcard symbol
patternthe initial content in it's natural representation

◆ RankedExtendedPattern() [3/3]

template<class SymbolType >
tree::RankedExtendedPattern< SymbolType >::RankedExtendedPattern ( const RankedPattern< SymbolType > &  other)
explicit

Creates a new instance of the pattern based on RankedPattern, the alphabet is taken from the RankedPattern.

Parameters
otherthe pattern represented as RrankedPattern

Member Function Documentation

◆ extendAlphabet()

template<class SymbolType >
void tree::RankedExtendedPattern< SymbolType >::extendAlphabet ( const ext::set< common::ranked_symbol< SymbolType > > &  symbols)
inline

Adder of an alphabet symbols.

Parameters
symbolsthe new symbols to be added to the alphabet

◆ extendNodeWildcards()

template<class SymbolType >
void tree::RankedExtendedPattern< SymbolType >::extendNodeWildcards ( const ext::set< common::ranked_symbol< SymbolType > > &  symbols)
inline

Adder of the node wildcard symbols.

Parameters
symbolsthe new symbols to be added to the node wildcard symbols

◆ getAlphabet() [1/2]

template<class SymbolType >
ext::set< common::ranked_symbol< SymbolType > > && tree::RankedExtendedPattern< SymbolType >::getAlphabet ( ) &&
inline

Getter of the alphabet.

Returns
the alphabet of the pattern
Here is the call graph for this function:

◆ getAlphabet() [2/2]

template<class SymbolType >
const ext::set< common::ranked_symbol< SymbolType > > & tree::RankedExtendedPattern< SymbolType >::getAlphabet ( ) const &
inline

Getter of the alphabet.

Returns
the alphabet of the pattern
Here is the caller graph for this function:

◆ getContent() [1/2]

template<class SymbolType >
ext::tree< common::ranked_symbol< SymbolType > > && tree::RankedExtendedPattern< SymbolType >::getContent ( ) &&

Getter of the pattern representation.

Returns
the natural representation of the pattern.

◆ getContent() [2/2]

template<class SymbolType >
const ext::tree< common::ranked_symbol< SymbolType > > & tree::RankedExtendedPattern< SymbolType >::getContent ( ) const &

Getter of the pattern representation.

Returns
the natural representation of the pattern.
Here is the caller graph for this function:

◆ getNodeWildcards() [1/2]

template<class SymbolType >
ext::set< common::ranked_symbol< SymbolType > > && tree::RankedExtendedPattern< SymbolType >::getNodeWildcards ( ) &&
inline

Getter of the node wildcards.

Returns
the node wildcards of the pattern
Here is the call graph for this function:

◆ getNodeWildcards() [2/2]

template<class SymbolType >
const ext::set< common::ranked_symbol< SymbolType > > & tree::RankedExtendedPattern< SymbolType >::getNodeWildcards ( ) const &
inline

Getter of the node wildcards.

Returns
the node wildcards of the pattern
Here is the caller graph for this function:

◆ getSubtreeWildcard() [1/2]

template<class SymbolType >
common::ranked_symbol< SymbolType > && tree::RankedExtendedPattern< SymbolType >::getSubtreeWildcard ( ) &&
inline

Getter of the wildcard symbol.

Returns
the wildcard symbol of the pattern
Here is the call graph for this function:

◆ getSubtreeWildcard() [2/2]

template<class SymbolType >
const common::ranked_symbol< SymbolType > & tree::RankedExtendedPattern< SymbolType >::getSubtreeWildcard ( ) const &
inline

Getter of the wildcard symbol.

Returns
the wildcard symbol of the pattern
Here is the caller graph for this function:

◆ nicePrint()

template<class SymbolType >
void tree::RankedExtendedPattern< SymbolType >::nicePrint ( ext::ostream os) const

Nice printer of the tree natural representation

Parameters
osthe output stream to print to
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<=>()

template<class SymbolType >
auto tree::RankedExtendedPattern< SymbolType >::operator<=> ( const RankedExtendedPattern< SymbolType > &  other) const
inline

The three way comparison implementation

Parameters
otherthe other instance
Returns
the ordering between this object and the other.
Here is the call graph for this function:

◆ operator==()

template<class SymbolType >
bool tree::RankedExtendedPattern< SymbolType >::operator== ( const RankedExtendedPattern< SymbolType > &  other) const
inline

The equality comparison implementation.

Parameters
otherthe other object to compare with.
Returns
true if this and other objects are equal, false othervise
Here is the call graph for this function:

◆ setTree()

template<class SymbolType >
void tree::RankedExtendedPattern< SymbolType >::setTree ( ext::tree< common::ranked_symbol< SymbolType > >  pattern)

Setter of the representation of the pattern.

Exceptions
TreeExceptionin same situations as checkAlphabet and checkArities
Parameters
patternnew representation of the pattern.

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType >
ext::ostream & operator<< ( ext::ostream out,
const RankedExtendedPattern< SymbolType > &  instance 
)
friend

Print this object as raw representation to ostream.

Parameters
outostream where to print
instanceobject to print
Returns
modified output stream

The documentation for this class was generated from the following file: