30template <
class SymbolType = DefaultSymbolType >
31class UnrankedNonlinearPattern;
36#include <ext/iostream>
37#include <ext/algorithm>
59class NonlinearAlphabet;
74template <
class SymbolType >
75class UnrankedNonlinearPattern final :
public core::Components < UnrankedNonlinearPattern < SymbolType >, ext::set < SymbolType >, component::Set, std::tuple < GeneralAlphabet, NonlinearAlphabet >, SymbolType, component::Value, std::tuple < SubtreeWildcard, SubtreeGap > > {
134 return this->
template accessComponent < GeneralAlphabet > ( ).get ( );
143 return std::move ( this->
template accessComponent < GeneralAlphabet > ( ).
get ( ) );
152 this->
template accessComponent < GeneralAlphabet > ( ).add ( symbols );
161 return this->
template accessComponent < SubtreeWildcard > ( ).get ( );
170 return std::move ( this->
template accessComponent < SubtreeWildcard > ( ).
get ( ) );
179 return this->
template accessComponent < SubtreeGap > ( ).get ( );
188 return std::move ( this->
template accessComponent < SubtreeGap > ( ).
get ( ) );
197 return this->
template accessComponent < NonlinearAlphabet > ( ).get ( );
206 return std::move ( this->
template accessComponent < NonlinearAlphabet > ( ).
get ( ) );
263 out <<
"(UnrankedNonlinearPattern ";
265 out <<
" content = " << instance.
getContent ( );
281template <
class SymbolType >
282UnrankedNonlinearPattern < SymbolType >::UnrankedNonlinearPattern (
SymbolType subtreeWildcard,
SymbolType subtreeGap,
ext::set < SymbolType > nonlinearVariables,
ext::set < SymbolType > alphabet,
ext::tree < SymbolType > pattern ) :
core::Components <
UnrankedNonlinearPattern,
ext::set < SymbolType >, component::Set, std::tuple < GeneralAlphabet, NonlinearAlphabet >,
SymbolType, component::Value, std::tuple < SubtreeWildcard, SubtreeGap > > ( std::move (
alphabet ), std::move ( nonlinearVariables ), std::move ( subtreeWildcard ), std::move ( subtreeGap ) ), m_content ( std::move ( pattern ) ) {
283 checkAlphabet ( m_content );
286template <
class SymbolType >
290template <
class SymbolType >
294template <
class SymbolType >
298template <
class SymbolType >
303template <
class SymbolType >
305 return std::move ( m_content );
308template <
class SymbolType >
312 throw TreeException (
"Input symbols not in the alphabet." );
316template <
class SymbolType >
318 checkAlphabet ( pattern );
320 this->m_content = std::move ( pattern );
323template <
class SymbolType >
337template <
class SymbolType >
350 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 );
380template <
class SymbolType >
404 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 );
450 if ( pattern.template accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) )
460template <
class SymbolType >
472 return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
484 if ( pattern.template accessComponent < tree::NonlinearAlphabet > ( ).get ( ).count ( symbol ) )
494template <
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::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:437
static void valid(const tree::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:449
static bool available(const tree::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:471
static void valid(const tree::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:483
Definition: components.hpp:25
static void valid(const tree::UnrankedNonlinearPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedNonlinearPattern.h:371
static bool available(const tree::UnrankedNonlinearPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedNonlinearPattern.h:361
static bool used(const tree::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:348
static void valid(const tree::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:415
static bool used(const tree::UnrankedNonlinearPattern< SymbolType > &, const SymbolType &)
Definition: UnrankedNonlinearPattern.h:391
static bool available(const tree::UnrankedNonlinearPattern< SymbolType > &pattern, const SymbolType &symbol)
Definition: UnrankedNonlinearPattern.h:403
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
Nonlinear tree pattern represented in its natural representation. The representation is so called ran...
Definition: RankedNonlinearPattern.h:74
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
Nonlinear tree pattern represented in its natural representation. The representation is so called unr...
Definition: UnrankedNonlinearPattern.h:75
void nicePrint(ext::ostream &out) const
Definition: UnrankedNonlinearPattern.h:324
ext::set< SymbolType > && getNonlinearVariables() &&
Definition: UnrankedNonlinearPattern.h:205
ext::set< SymbolType > && getAlphabet() &&
Definition: UnrankedNonlinearPattern.h:142
SymbolType && getSubtreeWildcard() &&
Definition: UnrankedNonlinearPattern.h:169
const ext::set< SymbolType > & getNonlinearVariables() const &
Definition: UnrankedNonlinearPattern.h:196
const SymbolType & getSubtreeGap() const &
Definition: UnrankedNonlinearPattern.h:178
const ext::set< SymbolType > & getAlphabet() const &
Definition: UnrankedNonlinearPattern.h:133
void setTree(ext::tree< SymbolType > pattern)
Definition: UnrankedNonlinearPattern.h:317
UnrankedNonlinearPattern(SymbolType subtreeWildcard, SymbolType subtreeGap, ext::set< SymbolType > nonlinearVariables, ext::set< SymbolType > alphabet, ext::tree< SymbolType > pattern)
Creates a new instance of the pattern with concrete alphabet, content, wildcard, and nonlinear variab...
Definition: UnrankedNonlinearPattern.h:282
friend ext::ostream & operator<<(ext::ostream &out, const UnrankedNonlinearPattern &instance)
Definition: UnrankedNonlinearPattern.h:262
void extendAlphabet(const ext::set< SymbolType > &symbols)
Definition: UnrankedNonlinearPattern.h:151
bool operator==(const UnrankedNonlinearPattern &other) const
Definition: UnrankedNonlinearPattern.h:250
SymbolType && getSubtreeGap() &&
Definition: UnrankedNonlinearPattern.h:187
const SymbolType & getSubtreeWildcard() const &
Definition: UnrankedNonlinearPattern.h:160
const ext::tree< SymbolType > & getContent() const &
Definition: UnrankedNonlinearPattern.h:299
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
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::UnrankedNonlinearPattern< > eval(tree::UnrankedNonlinearPattern< SymbolType > &&value)
Definition: UnrankedNonlinearPattern.h:496
Definition: normalize.hpp:13