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

Nonlinear 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 and nonlinear variables each to represent same subtree (in the particular occurrence in a tree). More...

#include <UnrankedNonlinearPattern.h>

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

Public Member Functions

 UnrankedNonlinearPattern (SymbolType subtreeWildcard, SymbolType subtreeGap, ext::set< SymbolType > nonlinearVariables, ext::set< SymbolType > alphabet, ext::tree< SymbolType > pattern)
 Creates a new instance of the pattern with concrete alphabet, content, wildcard, and nonlinear variables. More...
 
 UnrankedNonlinearPattern (SymbolType subtreeWildcard, SymbolType subtreeGap, ext::set< SymbolType > nonlinearVariables, ext::tree< SymbolType > pattern)
 Creates a new instance of the pattern with concrete content, wildcard, and nonlinear variables. The alphabet is deduced from the content. More...
 
 UnrankedNonlinearPattern (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. Nonlinear variables are defaultly constructed to empty set. More...
 
 UnrankedNonlinearPattern (const RankedNonlinearPattern< SymbolType > &other)
 Creates a new instance of the pattern based on RankedNonlinearPattern, the alphabet is created from the content of the RankedNonlinearPattern. 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::set< SymbolType > & getNonlinearVariables () const &
 
ext::set< SymbolType > && getNonlinearVariables () &&
 
const ext::tree< SymbolType > & getContent () const &
 
ext::tree< SymbolType > && getContent () &&
 
void setTree (ext::tree< SymbolType > pattern)
 
auto operator<=> (const UnrankedNonlinearPattern &other) const
 
bool operator== (const UnrankedNonlinearPattern &other) const
 
void nicePrint (ext::ostream &out) const
 
- Public Member Functions inherited from core::Components< UnrankedNonlinearPattern< SymbolType >, ext::set< SymbolType >, component::Set, std::tuple< GeneralAlphabet, NonlinearAlphabet >, SymbolType, component::Value, std::tuple< SubtreeWildcard, SubtreeGap > >
void accessComponent ()
 

Friends

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

Additional Inherited Members

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

Detailed Description

template<class SymbolType>
class tree::UnrankedNonlinearPattern< SymbolType >

Nonlinear 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 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 symbols, C (Content) = pattern in its natural representation W (Wildcard) = special symbol representing any subtree V (Variables) = finite set of special symbols each representing same subtree

Template Parameters
SymbolTypeused for the symbol of the alphabet

Constructor & Destructor Documentation

◆ UnrankedNonlinearPattern() [1/4]

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

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

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

◆ UnrankedNonlinearPattern() [2/4]

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

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

Parameters
subtreeWildcardthe wildcard symbol
subtreeGapeffectively wildcard^*
nonlinearVariablesthe set of nonlinear variables
patternthe initial content in it's natural representation

◆ UnrankedNonlinearPattern() [3/4]

template<class SymbolType >
tree::UnrankedNonlinearPattern< SymbolType >::UnrankedNonlinearPattern ( 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. Nonlinear variables are defaultly constructed to empty set.

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

◆ UnrankedNonlinearPattern() [4/4]

template<class SymbolType >
tree::UnrankedNonlinearPattern< SymbolType >::UnrankedNonlinearPattern ( const RankedNonlinearPattern< SymbolType > &  other)
explicit

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

Parameters
otherthe pattern represented as RankedNonlinearPattern

Member Function Documentation

◆ extendAlphabet()

template<class SymbolType >
void tree::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< SymbolType >::getContent ( ) const &

Getter of the pattern representation.

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

◆ getNonlinearVariables() [1/2]

template<class SymbolType >
ext::set< SymbolType > && tree::UnrankedNonlinearPattern< SymbolType >::getNonlinearVariables ( ) &&
inline

Getter of the nonlinear variables.

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

◆ getNonlinearVariables() [2/2]

template<class SymbolType >
const ext::set< SymbolType > & tree::UnrankedNonlinearPattern< SymbolType >::getNonlinearVariables ( ) const &
inline

Getter of the nonlinear variables.

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

◆ getSubtreeGap() [1/2]

template<class SymbolType >
SymbolType && tree::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< SymbolType >::nicePrint ( ext::ostream out) const

Nice printer of the tree natural representation

Parameters
outthe 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::UnrankedNonlinearPattern< SymbolType >::operator<=> ( const UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< SymbolType >::operator== ( const UnrankedNonlinearPattern< 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::UnrankedNonlinearPattern< 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 UnrankedNonlinearPattern< 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: