30template <
class SymbolType = DefaultSymbolType >
31class PrefixRankedNonlinearPattern;
36#include <ext/algorithm>
53#include <string/LinearString.h>
66class NonlinearAlphabet;
81template <
class SymbolType >
82class PrefixRankedNonlinearPattern final :
public core::Components < PrefixRankedNonlinearPattern < SymbolType >, ext::set < common::ranked_symbol < SymbolType > >, component::Set, std::tuple < GeneralAlphabet, NonlinearAlphabet >, common::ranked_symbol < SymbolType >, component::Value, SubtreeWildcard > {
164 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
173 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
182 this->
template accessComponent < GeneralAlphabet > ( ).add ( symbols );
191 return this->
template accessComponent < SubtreeWildcard > ( ).get ( );
200 return std::move ( this->
template accessComponent < SubtreeWildcard > ( ).
get ( ) );
209 return this->
template accessComponent < NonlinearAlphabet > ( ).get ( );
218 return std::move ( this->
template accessComponent < NonlinearAlphabet > ( ).
get ( ) );
280 out <<
"(PrefixRankedNonlinearPattern";
282 out <<
" content = " << instance.
getContent ( );
299template <
class SymbolType >
300PrefixRankedNonlinearPattern < SymbolType >::PrefixRankedNonlinearPattern (
common::ranked_symbol < SymbolType > subtreeWildcard,
ext::set < common::ranked_symbol < SymbolType > > nonlinearVariables,
ext::set < common::ranked_symbol < SymbolType > >
alphabet,
ext::vector < common::ranked_symbol < SymbolType > > data ) :
core::Components <
PrefixRankedNonlinearPattern,
ext::set <
common::ranked_symbol < SymbolType > >, component::Set, std::tuple < GeneralAlphabet, NonlinearAlphabet >,
common::ranked_symbol < SymbolType >, component::Value, SubtreeWildcard > ( std::move (
alphabet ), std::move ( nonlinearVariables ), std::move ( subtreeWildcard ) ) {
301 setContent ( std::move ( data ) );
304template <
class SymbolType >
308template <
class SymbolType >
312template <
class SymbolType >
316template <
class SymbolType >
320template <
class SymbolType >
324template <
class SymbolType >
328template <
class SymbolType >
332template <
class SymbolType >
337template <
class SymbolType >
339 return std::move ( this->m_Data );
342template <
class SymbolType >
344 arityChecksum ( data );
348 throw TreeException (
"Input symbols not in the alphabet." );
351 this->m_Data = std::move ( data );
354template <
class SymbolType >
357 return current + symbol.getRank ( ) - 1;
362template <
class SymbolType >
364 return this->m_Data.empty ( );
376template <
class SymbolType >
390 return std::find ( m_content.
begin ( ), m_content.
end ( ), symbol ) != m_content.
end ( ) || pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol;
420template <
class SymbolType >
444 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
459 if ( pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol )
469template <
class SymbolType >
481 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
496 if ( pattern.template accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) )
506template <
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 void valid(const tree::PrefixRankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedNonlinearPattern.h:492
static bool available(const tree::PrefixRankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedNonlinearPattern.h:480
Definition: components.hpp:25
static void valid(const tree::PrefixRankedNonlinearPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedNonlinearPattern.h:411
static bool available(const tree::PrefixRankedNonlinearPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedNonlinearPattern.h:401
static bool used(const tree::PrefixRankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedNonlinearPattern.h:387
static bool available(const tree::PrefixRankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedNonlinearPattern.h:443
static bool used(const tree::PrefixRankedNonlinearPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: PrefixRankedNonlinearPattern.h:431
static void valid(const tree::PrefixRankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: PrefixRankedNonlinearPattern.h:455
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
Nonlinear tree pattern represented as linear sequece as result of preorder traversal....
Definition: PrefixRankedNonlinearPattern.h:82
PrefixRankedNonlinearPattern(common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > nonlinearVariables, 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, wildcard, and nonlinear variab...
Definition: PrefixRankedNonlinearPattern.h:300
ext::set< common::ranked_symbol< SymbolType > > && getNonlinearVariables() &&
Definition: PrefixRankedNonlinearPattern.h:217
const ext::set< common::ranked_symbol< SymbolType > > & getNonlinearVariables() const &
Definition: PrefixRankedNonlinearPattern.h:208
void setContent(ext::vector< common::ranked_symbol< SymbolType > > data)
Definition: PrefixRankedNonlinearPattern.h:343
bool operator==(const PrefixRankedNonlinearPattern &other) const
Definition: PrefixRankedNonlinearPattern.h:267
bool isEmpty() const
Definition: PrefixRankedNonlinearPattern.h:363
common::ranked_symbol< SymbolType > && getSubtreeWildcard() &&
Definition: PrefixRankedNonlinearPattern.h:199
ext::set< common::ranked_symbol< SymbolType > > && getAlphabet() &&
Definition: PrefixRankedNonlinearPattern.h:172
friend ext::ostream & operator<<(ext::ostream &out, const PrefixRankedNonlinearPattern &instance)
Definition: PrefixRankedNonlinearPattern.h:279
const ext::vector< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: PrefixRankedNonlinearPattern.h:333
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: PrefixRankedNonlinearPattern.h:163
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: PrefixRankedNonlinearPattern.h:190
void extendAlphabet(const ext::set< common::ranked_symbol< SymbolType > > &symbols)
Definition: PrefixRankedNonlinearPattern.h:181
Tree pattern represented as linear sequece as result of preorder traversal. The representation is so ...
Definition: PrefixRankedPattern.h:77
Tree structure represented as linear sequece as result of preorder traversal. The representation is s...
Definition: PrefixRankedTree.h:71
Nonlinear tree pattern represented in its natural representation. The representation is so called ran...
Definition: RankedNonlinearPattern.h:74
Tree pattern represented in its natural representation. The representation is so called ranked,...
Definition: RankedPattern.h:72
Tree structure represented in its natural representation. The representation is so called ranked,...
Definition: RankedTree.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
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
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::PrefixRankedNonlinearPattern< > eval(tree::PrefixRankedNonlinearPattern< SymbolType > &&value)
Definition: PrefixRankedNonlinearPattern.h:508
Definition: normalize.hpp:13