30template <
class SymbolType = DefaultSymbolType >
31class PrefixRankedPattern;
36#include <ext/algorithm>
54#include <string/LinearString.h>
76template <
class SymbolType >
77class PrefixRankedPattern final :
public core::Components < PrefixRankedPattern < SymbolType >, ext::set < common::ranked_symbol < SymbolType > >, component::Set, GeneralAlphabet, common::ranked_symbol < SymbolType >, component::Value, SubtreeWildcard > {
128 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
137 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
146 this->
template accessComponent < GeneralAlphabet > ( ).add ( symbols );
155 return this->
template accessComponent < SubtreeWildcard > ( ).get ( );
164 return std::move ( this->
template accessComponent < SubtreeWildcard > ( ).
get ( ) );
226 out <<
"(PrefixRankedPattern";
228 out <<
" content = " << instance.
getContent ( );
244template <
class SymbolType >
246 setContent ( std::move ( data ) );
249template <
class SymbolType >
253template <
class SymbolType >
257template <
class SymbolType >
261template <
class SymbolType >
266template <
class SymbolType >
268 return std::move ( this->m_Data );
271template <
class SymbolType >
273 arityChecksum ( data );
277 throw TreeException (
"Input symbols not in the alphabet." );
280 this->m_Data = std::move ( data );
283template <
class SymbolType >
286 return current + symbol.getRank ( ) - 1;
291template <
class SymbolType >
293 return this->m_Data.empty ( );
305template <
class SymbolType >
319 return std::find ( content.
begin ( ), content.
end ( ), symbol ) != content.
end ( ) || pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol;
349template <
class SymbolType >
361 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
383template <
class SymbolType >
static ext::vector< common::ranked_symbol< DefaultSymbolType > > normalizeRankedSymbols(ext::vector< common::ranked_symbol< SymbolType > > &&symbols)
Definition: SymbolNormalize.h:113
static common::ranked_symbol< DefaultSymbolType > normalizeRankedSymbol(common::ranked_symbol< SymbolType > &&symbol)
Definition: SymbolNormalize.h:81
static ext::set< common::ranked_symbol< DefaultSymbolType > > normalizeRankedAlphabet(ext::set< common::ranked_symbol< SymbolType > > &&symbols)
Definition: SymbolNormalize.h:59
static Base instance()
Factory for the symbol construction of the symbol based on given type.
Definition: WildcardSymbol.h:83
Definition: ranked_symbol.hpp:20
const size_t & getRank() const &
Definition: ranked_symbol.hpp:83
Definition: components.hpp:181
static bool available(const tree::PrefixRankedPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedPattern.h:360
static void valid(const tree::PrefixRankedPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedPattern.h:372
Definition: components.hpp:25
static bool available(const tree::PrefixRankedPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedPattern.h:330
static void valid(const tree::PrefixRankedPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedPattern.h:340
static bool used(const tree::PrefixRankedPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedPattern.h:316
Definition: setComponents.hpp:26
Output iterator calling a callback function on assignment.
Definition: iterator.hpp:923
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: set.hpp:99
auto end() &
Inherited behavior of end for non-const instance.
Definition: set.hpp:129
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: vector.hpp:125
auto end() &
Inherited behavior of end for non-const instance.
Definition: vector.hpp:155
Linear string.
Definition: LinearString.h:57
Tree pattern represented as linear sequece as result of preorder traversal. The representation is so ...
Definition: PrefixRankedPattern.h:77
ext::set< common::ranked_symbol< SymbolType > > && getAlphabet() &&
Definition: PrefixRankedPattern.h:136
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedPattern.h:262
PrefixRankedPattern(common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::vector< common::ranked_symbol< SymbolType > > data)
Creates a new instance of the pattern with concrete alphabet, content, and wildcard.
Definition: PrefixRankedPattern.h:245
void setContent(ext::vector< common::ranked_symbol< SymbolType > > data)
Definition: PrefixRankedPattern.h:272
common::ranked_symbol< SymbolType > && getSubtreeWildcard() &&
Definition: PrefixRankedPattern.h:163
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: PrefixRankedPattern.h:127
friend ext::ostream & operator<<(ext::ostream &out, const PrefixRankedPattern &instance)
Definition: PrefixRankedPattern.h:225
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: PrefixRankedPattern.h:154
bool isEmpty() const
Definition: PrefixRankedPattern.h:292
void extendAlphabet(const ext::set< common::ranked_symbol< SymbolType > > &symbols)
Definition: PrefixRankedPattern.h:145
bool operator==(const PrefixRankedPattern &other) const
Definition: PrefixRankedPattern.h:213
Tree structure represented as linear sequece as result of preorder traversal. The representation is s...
Definition: PrefixRankedTree.h:71
Tree pattern represented in its natural representation. The representation is so called ranked,...
Definition: RankedPattern.h:72
static ext::vector< common::ranked_symbol< SymbolType > > treeToPrefix(const ext::tree< common::ranked_symbol< SymbolType > > &tree)
Definition: TreeAuxiliary.h:185
Definition: TreeException.h:15
Definition: BarSymbol.cpp:12
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: Permutation.hpp:18
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::PrefixRankedPattern< > eval(tree::PrefixRankedPattern< SymbolType > &&value)
Definition: PrefixRankedPattern.h:385
Definition: normalize.hpp:13