30template <
class SymbolType = DefaultSymbolType >
31class RankedNonlinearPattern;
36#include <ext/iostream>
37#include <ext/algorithm>
52#include "../unranked/UnrankedNonlinearPattern.h"
58class NonlinearAlphabet;
73template <
class SymbolType >
74class RankedNonlinearPattern final :
public core::Components < RankedNonlinearPattern < SymbolType >, ext::set < common::ranked_symbol < SymbolType > >, component::Set, std::tuple < GeneralAlphabet, NonlinearAlphabet >, common::ranked_symbol < SymbolType >, component::Value, SubtreeWildcard > {
139 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
148 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
157 this->
template accessComponent < GeneralAlphabet > ( ).add ( symbols );
166 return this->
template accessComponent < SubtreeWildcard > ( ).get ( );
175 return std::move ( this->
template accessComponent < SubtreeWildcard > ( ).
get ( ) );
184 return this->
template accessComponent < NonlinearAlphabet > ( ).get ( );
193 return std::move ( this->
template accessComponent < NonlinearAlphabet > ( ).
get ( ) );
250 out <<
"(RankedNonlinearPattern";
252 out <<
" content = " << instance.
getContent ( );
267template <
class SymbolType >
268RankedNonlinearPattern < SymbolType >::RankedNonlinearPattern (
common::ranked_symbol < SymbolType > subtreeWildcard,
ext::set < common::ranked_symbol < SymbolType > > nonlinearVariables,
ext::set < common::ranked_symbol < SymbolType > >
alphabet,
ext::tree < common::ranked_symbol < SymbolType > > pattern ) :
core::Components <
RankedNonlinearPattern,
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 ) ), m_content ( std::move ( pattern ) ) {
269 checkAlphabet ( m_content );
270 checkArities ( m_content );
273template <
class SymbolType >
277template <
class SymbolType >
281template <
class SymbolType >
285template <
class SymbolType >
290template <
class SymbolType >
292 return std::move ( m_content );
295template <
class SymbolType >
299 throw TreeException (
"Input symbols not in the alphabet." );
303template <
class SymbolType >
305 if ( data.getData ( ).getRank ( ) != data.getChildren ( ).size ( ) )
309 checkArities ( child );
312template <
class SymbolType >
314 checkAlphabet ( pattern );
315 checkArities ( pattern );
317 this->m_content = std::move ( pattern );
320template <
class SymbolType >
334template <
class SymbolType >
347 return std::find(m_content.
prefix_begin(), m_content.
prefix_end(), symbol) != m_content.
prefix_end() || pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol || pattern.template accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol );
377template <
class SymbolType >
401 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
416 if ( pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol )
426template <
class SymbolType >
438 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
453 if ( pattern.template accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) )
463template <
class SymbolType >
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
Definition: ranked_symbol.hpp:20
const size_t & getRank() const &
Definition: ranked_symbol.hpp:83
Definition: components.hpp:181
static bool available(const tree::RankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: RankedNonlinearPattern.h:437
static void valid(const tree::RankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: RankedNonlinearPattern.h:449
Definition: components.hpp:25
static bool available(const tree::RankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: RankedNonlinearPattern.h:400
static void valid(const tree::RankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: RankedNonlinearPattern.h:412
static bool used(const tree::RankedNonlinearPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: RankedNonlinearPattern.h:388
static void valid(const tree::RankedNonlinearPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: RankedNonlinearPattern.h:368
static bool used(const tree::RankedNonlinearPattern< SymbolType > &pattern, const common::ranked_symbol< SymbolType > &symbol)
Definition: RankedNonlinearPattern.h:345
static bool available(const tree::RankedNonlinearPattern< SymbolType > &, const common::ranked_symbol< SymbolType > &)
Definition: RankedNonlinearPattern.h:358
Definition: setComponents.hpp:26
Basic exception from which all other exceptions are derived.
Definition: CommonException.h:21
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
Nonlinear tree pattern represented in its natural representation. The representation is so called ran...
Definition: RankedNonlinearPattern.h:74
ext::set< common::ranked_symbol< SymbolType > > && getAlphabet() &&
Definition: RankedNonlinearPattern.h:147
const ext::set< common::ranked_symbol< SymbolType > > & getNonlinearVariables() const &
Definition: RankedNonlinearPattern.h:183
friend ext::ostream & operator<<(ext::ostream &out, const RankedNonlinearPattern &instance)
Definition: RankedNonlinearPattern.h:249
void setTree(ext::tree< common::ranked_symbol< SymbolType > > pattern)
Definition: RankedNonlinearPattern.h:313
common::ranked_symbol< SymbolType > && getSubtreeWildcard() &&
Definition: RankedNonlinearPattern.h:174
void nicePrint(ext::ostream &os) const
Definition: RankedNonlinearPattern.h:321
const common::ranked_symbol< SymbolType > & getSubtreeWildcard() const &
Definition: RankedNonlinearPattern.h:165
RankedNonlinearPattern(common::ranked_symbol< SymbolType > subtreeWildcard, ext::set< common::ranked_symbol< SymbolType > > nonlinearVariables, ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::tree< common::ranked_symbol< SymbolType > > pattern)
Creates a new instance of the pattern with concrete alphabet, content, wildcard, and nonlinear variab...
Definition: RankedNonlinearPattern.h:268
void extendAlphabet(const ext::set< common::ranked_symbol< SymbolType > > &symbols)
Definition: RankedNonlinearPattern.h:156
bool operator==(const RankedNonlinearPattern &other) const
Definition: RankedNonlinearPattern.h:237
const ext::set< common::ranked_symbol< SymbolType > > & getAlphabet() const &
Definition: RankedNonlinearPattern.h:138
const ext::tree< common::ranked_symbol< SymbolType > > & getContent() const &
Definition: RankedNonlinearPattern.h:286
ext::set< common::ranked_symbol< SymbolType > > && getNonlinearVariables() &&
Definition: RankedNonlinearPattern.h:192
Definition: TreeException.h:15
static ext::tree< common::ranked_symbol< DefaultSymbolType > > normalizeRankedTree(ext::tree< common::ranked_symbol< SymbolType > > &&tree)
Definition: TreeNormalize.h:40
Nonlinear tree pattern represented in its natural representation. The representation is so called unr...
Definition: UnrankedNonlinearPattern.h:75
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::RankedNonlinearPattern< > eval(tree::RankedNonlinearPattern< SymbolType > &&value)
Definition: RankedNonlinearPattern.h:465
Definition: normalize.hpp:13