Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Member Functions | Friends
rte::FormalRTE< SymbolType > Class Template Referencefinal

Formal regular tree expression represents regular tree expression. It describes regular tree languages. The expression consists of the following nodes: More...

#include <FormalRTE.h>

Inheritance diagram for rte::FormalRTE< SymbolType >:
[legend]
Collaboration diagram for rte::FormalRTE< SymbolType >:
[legend]

Public Member Functions

 FormalRTE ()
 Creates a new instance of the expression. The default constructor creates expression describing empty language. More...
 
 FormalRTE (ext::set< common::ranked_symbol< SymbolType > > alphabetF, ext::set< common::ranked_symbol< SymbolType > > alphabetK, FormalRTEStructure< SymbolType > rte)
 Creates a new instance of the expression with a concrete terminal alphabet, substitution alphabet, and initial content. More...
 
 FormalRTE (std::pair< ext::set< common::ranked_symbol< SymbolType > >, ext::set< common::ranked_symbol< SymbolType > > > alphabets, FormalRTEStructure< SymbolType > rte)
 Creates a new instance of the expression with a concrete terminal alphabet, substitution alphabet, and initial content. More...
 
 FormalRTE (FormalRTEStructure< SymbolType > rte)
 Creates a new instance of the expression based on the initial content. Alphabets are deduced from the content. More...
 
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet () const &
 
ext::set< common::ranked_symbol< SymbolType > > && getAlphabet () &&
 
void addAlphabetSymbols (common::ranked_symbol< SymbolType > symbol)
 
void addAlphabetSymbols (ext::set< common::ranked_symbol< SymbolType > > symbols)
 
void setAlphabetSymbols (ext::set< common::ranked_symbol< SymbolType > > symbols)
 
void removeAlphabetSymbol (const common::ranked_symbol< SymbolType > &symbol)
 
const ext::set< common::ranked_symbol< SymbolType > > & getSubstitutionAlphabet () const &
 
ext::set< common::ranked_symbol< SymbolType > > && getSubstitutionAlphabet () &&
 
void addConstantSymbol (common::ranked_symbol< SymbolType > symbol)
 
void addConstantSymbols (ext::set< common::ranked_symbol< SymbolType > > symbols)
 
void setConstantSymbols (ext::set< common::ranked_symbol< SymbolType > > symbols)
 
void removeConstantSymbol (const common::ranked_symbol< SymbolType > &symbol)
 
const FormalRTEStructure< SymbolType > & getRTE () const &
 
FormalRTEStructure< SymbolType > && getRTE () &&
 
void setRTE (FormalRTEStructure< SymbolType > param)
 
auto operator<=> (const FormalRTE &other) const
 
bool operator== (const FormalRTE &other) const
 
- Public Member Functions inherited from core::Components< FormalRTE< DefaultSymbolType >, ext::set< common::ranked_symbol< DefaultSymbolType > >, component::Set, std::tuple< GeneralAlphabet, ConstantAlphabet > >
void accessComponent ()
 

Friends

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

Additional Inherited Members

- Static Public Member Functions inherited from core::Components< FormalRTE< DefaultSymbolType >, ext::set< common::ranked_symbol< DefaultSymbolType > >, component::Set, std::tuple< GeneralAlphabet, ConstantAlphabet > >
static void registerComponent ()
 
static void unregisterComponent ()
 

Detailed Description

template<class SymbolType = DefaultSymbolType>
class rte::FormalRTE< SymbolType >

Formal regular tree expression represents regular tree expression. It describes regular tree languages. The expression consists of the following nodes:

The formal representation allows nodes of alternation to have exactly two children.

The structure of the regular tree expression is wrapped in a structure class to allow separate the alphabets from the structure

Definition is unbounded definition of regular expressions. E = (T, S, C), T (TerminalAlphabet) = finite set of terminal symbols S (SubstitutionAlphabet) = finite set of substitution symbols C (Content) = representation of the regular expression

Template Parameters
SymbolTypeused for the symbol part of the ranked symbol

Constructor & Destructor Documentation

◆ FormalRTE() [1/4]

template<class SymbolType >
rte::FormalRTE< SymbolType >::FormalRTE
explicit

Creates a new instance of the expression. The default constructor creates expression describing empty language.

◆ FormalRTE() [2/4]

template<class SymbolType >
rte::FormalRTE< SymbolType >::FormalRTE ( ext::set< common::ranked_symbol< SymbolType > >  alphabetF,
ext::set< common::ranked_symbol< SymbolType > >  alphabetK,
FormalRTEStructure< SymbolType >  rte 
)
explicit

Creates a new instance of the expression with a concrete terminal alphabet, substitution alphabet, and initial content.

Parameters
alphabetFthe initial terminal alphabet
alphabetKthe initial substitution alphabet
rtethe initial rte content

◆ FormalRTE() [3/4]

template<class SymbolType >
rte::FormalRTE< SymbolType >::FormalRTE ( std::pair< ext::set< common::ranked_symbol< SymbolType > >, ext::set< common::ranked_symbol< SymbolType > > >  alphabets,
FormalRTEStructure< SymbolType >  rte 
)
explicit

Creates a new instance of the expression with a concrete terminal alphabet, substitution alphabet, and initial content.

Parameters
alphabetsthe pair of terminal alphabet and substitution alphabet
rtethe initial rte content

◆ FormalRTE() [4/4]

template<class SymbolType >
rte::FormalRTE< SymbolType >::FormalRTE ( FormalRTEStructure< SymbolType >  rte)
explicit

Creates a new instance of the expression based on the initial content. Alphabets are deduced from the content.

Parameters
rtethe initial rte content

Member Function Documentation

◆ addAlphabetSymbols() [1/2]

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::addAlphabetSymbols ( common::ranked_symbol< SymbolType >  symbol)
inline

Adder of a terminal symbol.

Parameters
symbolthe new symbol to be added to a terminal alphabet
Returns
true if the symbol was indeed added

◆ addAlphabetSymbols() [2/2]

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::addAlphabetSymbols ( ext::set< common::ranked_symbol< SymbolType > >  symbols)
inline

Adder of terminal symbols.

Parameters
symbolsnew symbols to be added to a terminal alphabet

◆ addConstantSymbol()

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::addConstantSymbol ( common::ranked_symbol< SymbolType >  symbol)
inline

Adder of a substitution symbol.

Parameters
symbolthe new symbol to be added to a substitution alphabet
Returns
true if the symbol was indeed added

◆ addConstantSymbols()

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::addConstantSymbols ( ext::set< common::ranked_symbol< SymbolType > >  symbols)
inline

Adder of substitution symbols.

Parameters
symbolsnew symbols to be added to a substitution alphabet

◆ getAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< common::ranked_symbol< SymbolType > > && rte::FormalRTE< SymbolType >::getAlphabet ( ) &&
inline

Getter of the terminal alphabet.

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

◆ getAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::set< common::ranked_symbol< SymbolType > > & rte::FormalRTE< SymbolType >::getAlphabet ( ) const &
inline

Getter of the terminal alphabet.

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

◆ getRTE() [1/2]

template<class SymbolType = DefaultSymbolType>
FormalRTEStructure< SymbolType > && rte::FormalRTE< SymbolType >::getRTE ( ) &&

Get the structure of the expression.

Returns
the structure of the expression.

◆ getRTE() [2/2]

template<class SymbolType = DefaultSymbolType>
const FormalRTEStructure< SymbolType > & rte::FormalRTE< SymbolType >::getRTE ( ) const &

Get the structure of the expression.

Returns
the structure of the expression.
Here is the caller graph for this function:

◆ getSubstitutionAlphabet() [1/2]

template<class SymbolType = DefaultSymbolType>
ext::set< common::ranked_symbol< SymbolType > > && rte::FormalRTE< SymbolType >::getSubstitutionAlphabet ( ) &&
inline

Getter of the substitution alphabet.

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

◆ getSubstitutionAlphabet() [2/2]

template<class SymbolType = DefaultSymbolType>
const ext::set< common::ranked_symbol< SymbolType > > & rte::FormalRTE< SymbolType >::getSubstitutionAlphabet ( ) const &
inline

Getter of the substitution alphabet.

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

◆ operator<=>()

template<class SymbolType = DefaultSymbolType>
auto rte::FormalRTE< SymbolType >::operator<=> ( const FormalRTE< 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 = DefaultSymbolType>
bool rte::FormalRTE< SymbolType >::operator== ( const FormalRTE< 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:

◆ removeAlphabetSymbol()

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::removeAlphabetSymbol ( const common::ranked_symbol< SymbolType > &  symbol)
inline

Remover of a terminal symbol.

Parameters
symbola symbol to be removed from a terminal alphabet
Returns
true if the symbol was indeed removed

◆ removeConstantSymbol()

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::removeConstantSymbol ( const common::ranked_symbol< SymbolType > &  symbol)
inline

Remover of a substitution symbol.

Parameters
symbola symbol to be removed from a substitution alphabet
Returns
true if the symbol was indeed removed

◆ setAlphabetSymbols()

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::setAlphabetSymbols ( ext::set< common::ranked_symbol< SymbolType > >  symbols)
inline

Setter of terminal alphabet.

Parameters
symbolscompletely new terminal alphabet

◆ setConstantSymbols()

template<class SymbolType = DefaultSymbolType>
void rte::FormalRTE< SymbolType >::setConstantSymbols ( ext::set< common::ranked_symbol< SymbolType > >  symbols)
inline

Setter of substitution alphabet.

Parameters
symbolscompletely new substitution alphabet

◆ setRTE()

template<class SymbolType >
void rte::FormalRTE< SymbolType >::setRTE ( FormalRTEStructure< SymbolType >  param)

Set the structure of the expression.

Parameters
regExpthe new structure of the expression.

Friends And Related Function Documentation

◆ operator<<

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