30template <
class SymbolType = DefaultSymbolType >
36#include <ext/iostream>
37#include <ext/algorithm>
51#include "../ranked/RankedPattern.h"
72template <
class SymbolType >
73class UnrankedPattern final :
public core::Components < UnrankedPattern < SymbolType >, ext::set < SymbolType >, component::Set, GeneralAlphabet, SymbolType, component::Value, std::tuple < SubtreeWildcard, SubtreeGap > > {
121 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
130 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
139 this->
template accessComponent < GeneralAlphabet > ( ).add ( symbols );
148 return this->
template accessComponent < SubtreeWildcard > ( ).get ( );
157 return std::move ( this->
template accessComponent < SubtreeWildcard > ( ).
get ( ) );
166 return this->
template accessComponent < SubtreeGap > ( ).get ( );
175 return std::move ( this->
template accessComponent < SubtreeGap > ( ).
get ( ) );
232 out <<
"(UnrankedPattern ";
234 out <<
" content = " << instance.
getContent ( );
249template <
class SymbolType >
250UnrankedPattern < SymbolType >::UnrankedPattern (
SymbolType subtreeWildcard,
SymbolType subtreeGap,
ext::set < SymbolType > alphabet,
ext::tree < SymbolType > pattern ) :
core::Components <
UnrankedPattern,
ext::set < SymbolType >, component::Set, GeneralAlphabet,
SymbolType, component::Value, std::tuple < SubtreeWildcard, SubtreeGap > > ( std::move (
alphabet ), std::move ( subtreeWildcard ), std::move ( subtreeGap ) ), m_content ( std::move ( pattern ) ) {
251 checkAlphabet ( m_content );
254template <
class SymbolType >
258template <
class SymbolType >
262template <
class SymbolType >
267template <
class SymbolType >
269 return std::move ( m_content );
272template <
class SymbolType >
276 throw TreeException (
"Input symbols not in the alphabet." );
280template <
class SymbolType >
282 checkAlphabet ( pattern );
284 this->m_content = std::move ( pattern );
287template <
class SymbolType >
301template <
class SymbolType >
314 return std::find(m_content.
prefix_begin(), m_content.
prefix_end(), symbol) != m_content.
prefix_end() || pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol;
344template <
class SymbolType >
356 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
376template <
class SymbolType >
388 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
408template <
class SymbolType >
static ext::set< DefaultSymbolType > normalizeAlphabet(ext::set< SymbolType > &&symbols)
Definition: SymbolNormalize.h:50
static DefaultSymbolType normalizeSymbol(SymbolType &&symbol)
Definition: SymbolNormalize.h:68
Definition: components.hpp:181
static bool available(const tree::UnrankedPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedPattern.h:387
static void valid(const tree::UnrankedPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedPattern.h:399
static void valid(const tree::UnrankedPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedPattern.h:367
static bool available(const tree::UnrankedPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedPattern.h:355
Definition: components.hpp:25
static void valid(const tree::UnrankedPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedPattern.h:335
static bool available(const tree::UnrankedPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedPattern.h:325
static bool used(const tree::UnrankedPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedPattern.h:312
Definition: setComponents.hpp:26
Output iterator calling a callback function on assignment.
Definition: iterator.hpp:923
Class introducing a tree with interface trying to be close to the interface of standard library conta...
Definition: tree.hpp:52
const_prefix_iterator prefix_begin() const
Getter of the prefix iterator to the root node.
Definition: tree.hpp:904
const_prefix_iterator prefix_end() const
Getter of the prefix iterator one after the last node in the prefix traversal.
Definition: tree.hpp:914
Tree pattern represented in its natural representation. The representation is so called ranked,...
Definition: RankedPattern.h:72
static ext::set< SymbolType > unrankSymbols(const ext::set< common::ranked_symbol< SymbolType > > &alphabet)
Definition: TreeAuxiliary.h:82
static ext::tree< SymbolType > rankedToUnranked(const ext::tree< common::ranked_symbol< SymbolType > > &tree)
Definition: TreeAuxiliary.h:151
Definition: TreeException.h:15
static ext::tree< DefaultSymbolType > normalizeTree(ext::tree< SymbolType > &&tree)
Definition: TreeNormalize.h:29
Tree pattern represented in its natural representation. The representation is so called unranked,...
Definition: UnrankedPattern.h:73
const ext::set< SymbolType > & getAlphabet() const &
Definition: UnrankedPattern.h:120
ext::set< SymbolType > && getAlphabet() &&
Definition: UnrankedPattern.h:129
const ext::tree< SymbolType > & getContent() const &
Definition: UnrankedPattern.h:263
friend ext::ostream & operator<<(ext::ostream &out, const UnrankedPattern &instance)
Definition: UnrankedPattern.h:231
const SymbolType & getSubtreeGap() const &
Definition: UnrankedPattern.h:165
SymbolType && getSubtreeGap() &&
Definition: UnrankedPattern.h:174
const SymbolType & getSubtreeWildcard() const &
Definition: UnrankedPattern.h:147
void nicePrint(ext::ostream &os) const
Definition: UnrankedPattern.h:288
SymbolType && getSubtreeWildcard() &&
Definition: UnrankedPattern.h:156
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.
Definition: UnrankedPattern.h:250
void setTree(ext::tree< SymbolType > pattern)
Definition: UnrankedPattern.h:281
bool operator==(const UnrankedPattern &other) const
Definition: UnrankedPattern.h:219
void extendAlphabet(const ext::set< SymbolType > &symbols)
Definition: UnrankedPattern.h:138
Definition: BarSymbol.cpp:12
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: normalize.hpp:10
Definition: sigHandler.cpp:20
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
auto begin(Container &&cont) -> decltype(std::forward(cont).begin())
Definition: iterator.hpp:900
void end()
Definition: measurements.cpp:19
auto & get(ext::ptr_array< Type, N > &tpl)
Specialisation of get function for pointer arrays.
Definition: ptr_array.hpp:693
Definition: BackwardOccurrenceTest.h:17
static tree::UnrankedPattern< > eval(tree::UnrankedPattern< SymbolType > &&value)
Definition: UnrankedPattern.h:410
Definition: normalize.hpp:13