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

Tree pattern represented in its natural representation. The representation is so called unranked, therefore it consists of unranked symbols. Additionally the pattern contains a special wildcard symbol representing any subtree. More...

#include <UnrankedPattern.h>

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

Public Member Functions

 UnrankedPattern (SymbolType subtreeWildcard, SymbolType subtreeGap, ext::set< SymbolType > alphabet, ext::tree< SymbolType > pattern)
 Creates a new instance of the pattern with concrete alphabet, content, and wildcard. More...
 
 UnrankedPattern (SymbolType subtreeWildcard, SymbolType subtreeGap, ext::tree< SymbolType > pattern)
 Creates a new instance of the pattern with concrete content and wildcard. The alphabet is deduced from the content. More...
 
 UnrankedPattern (const RankedPattern< SymbolType > &other)
 Creates a new instance of the pattern based on RankedPattern, the alphabet is created from the content of the RankedPattern. More...
 
const ext::set< SymbolType > & getAlphabet () const &
 
ext::set< SymbolType > && getAlphabet () &&
 
void extendAlphabet (const ext::set< SymbolType > &symbols)
 
const SymbolType & getSubtreeWildcard () const &
 
SymbolType && getSubtreeWildcard () &&
 
const SymbolType & getSubtreeGap () const &
 
SymbolType && getSubtreeGap () &&
 
const ext::tree< SymbolType > & getContent () const &
 
ext::tree< SymbolType > && getContent () &&
 
void setTree (ext::tree< SymbolType > pattern)
 
auto operator<=> (const UnrankedPattern &other) const
 
bool operator== (const UnrankedPattern &other) const
 
void nicePrint (ext::ostream &os) const
 
- Public Member Functions inherited from core::Components< UnrankedPattern< SymbolType >, ext::set< SymbolType >, component::Set, GeneralAlphabet, SymbolType, component::Value, std::tuple< SubtreeWildcard, SubtreeGap > >
void accessComponent ()
 

Friends

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

Additional Inherited Members

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

Detailed Description

template<class SymbolType>
class tree::UnrankedPattern< SymbolType >

Tree pattern represented in its natural representation. The representation is so called unranked, therefore it consists of unranked symbols. Additionally the pattern contains a special wildcard symbol representing any subtree.

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

Template Parameters
SymbolTypeused for the symbol of the alphabet

Constructor & Destructor Documentation

◆ UnrankedPattern() [1/3]

template<class SymbolType >
tree::UnrankedPattern< SymbolType >::UnrankedPattern ( SymbolType  subtreeWildcard,
SymbolType  subtreeGap,
ext::set< SymbolType >  alphabet,
ext::tree< SymbolType >  pattern 
)
explicit

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

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

◆ UnrankedPattern() [2/3]

template<class SymbolType >
tree::UnrankedPattern< SymbolType >::UnrankedPattern ( SymbolType  subtreeWildcard,
SymbolType  subtreeGap,
ext::tree< 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
subtreeGapeffectively wildcard^*
patternthe initial content in it's natural representation

◆ UnrankedPattern() [3/3]

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

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

Parameters
otherthe pattern represented as RankedNonlinearPattern

Member Function Documentation

◆ extendAlphabet()

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

Adder of an alphabet symbols.

Parameters
symbolsthe new symbols to be added to the alphabet

◆ getAlphabet() [1/2]

template<class SymbolType >
ext::set< SymbolType > && tree::UnrankedPattern< 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< SymbolType > & tree::UnrankedPattern< 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< SymbolType > && tree::UnrankedPattern< SymbolType >::getContent ( ) &&

Getter of the pattern representation.

Returns
the natural representation of the pattern.

◆ getContent() [2/2]

template<class SymbolType >
const ext::tree< SymbolType > & tree::UnrankedPattern< SymbolType >::getContent ( ) const &

Getter of the pattern representation.

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

◆ getSubtreeGap() [1/2]

template<class SymbolType >
SymbolType && tree::UnrankedPattern< SymbolType >::getSubtreeGap ( ) &&
inline

Getter of the wildcard symbol.

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

◆ getSubtreeGap() [2/2]

template<class SymbolType >
const SymbolType & tree::UnrankedPattern< SymbolType >::getSubtreeGap ( ) const &
inline

Getter of the wildcard symbol.

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

◆ getSubtreeWildcard() [1/2]

template<class SymbolType >
SymbolType && tree::UnrankedPattern< 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 SymbolType & tree::UnrankedPattern< 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::UnrankedPattern< 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::UnrankedPattern< SymbolType >::operator<=> ( const UnrankedPattern< 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::UnrankedPattern< SymbolType >::operator== ( const UnrankedPattern< 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::UnrankedPattern< SymbolType >::setTree ( ext::tree< SymbolType >  pattern)

Setter of the representation of the pattern.

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

Friends And Related Function Documentation

◆ operator<<

template<class SymbolType >
ext::ostream & operator<< ( ext::ostream out,
const UnrankedPattern< 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: