TuringSim
C++ framework to simulate abstract computing models
Public Member Functions | List of all members
TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType > Class Template Reference

A MixedSymbolPattern with a predicate adapted to m-configuration. More...

#include <symbol/turingMachineSymbolPattern.h>

Inheritance diagram for TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >:
Inheritance graph
[legend]
Collaboration diagram for TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >:
Collaboration graph
[legend]

Public Member Functions

constexpr TuringStyleMixedSymbolPattern (const std::set< SymbolType > &symbols, const std::set< SymbolType > &keys, bool neg)
 Build a TuringStyleMixedSymbolPattern from components. More...
 
virtual bool match (const SymbolType &symbol, const std::map< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType >>> &context) const noexcept override
 Check is a symbol is accepted. More...
 
constexpr bool operator== (const TuringStyleMixedSymbolPattern< SymbolType > &other) const
 Equality operator. More...
 
constexpr bool operator!= (const TuringStyleMixedSymbolPattern< SymbolType > &other) const
 Non-equality operator. More...
 
constexpr bool operator< (const TuringStyleMixedSymbolPattern< SymbolType > &other) const
 Less than. More...
 
- Public Member Functions inherited from TuringSim::Symbol::MixedSymbolPattern< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > >, SymbolType >
constexpr MixedSymbolPattern (const std::set< SymbolType > &symbols, const std::set< SymbolType > &keys, bool neg)
 Builds a new MixedSymbolPattern. More...
 
constexpr bool matchAccordingToPredicate (const SymbolType &symbol, const std::map< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > > > &context, const std::function< bool(const std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > > &)> &predicate) const
 Test if a key match a given predicate in a given context. More...
 
constexpr bool operator== (const MixedSymbolPattern< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > >, SymbolType > &other) const
 Equality operator. More...
 
constexpr bool operator!= (const MixedSymbolPattern< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > >, SymbolType > &other) const
 Non-equality operator. More...
 
constexpr bool operator< (const MixedSymbolPattern< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > >, SymbolType > &other) const
 Less than operator, total order. More...
 
constexpr bool isAlphaEquivalent (const MixedSymbolPattern< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > >, SymbolType > &other, const std::map< SymbolType, SymbolType > &rewriting) const
 Test if, given a renaming of keys, *this is alpha-equivalent to another DynamicSymbolPattern. More...
 
- Public Member Functions inherited from TuringSim::Symbol::SymbolPattern< SymbolType, std::map< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > > > >
 SymbolPattern ()=default
 The default constructor.
 
 SymbolPattern (const SymbolPattern &)=default
 The default copy constructor.
 
 SymbolPattern (SymbolPattern &&)=default
 The default move constructor.
 
SymbolPatternoperator= (const SymbolPattern &)=default
 The default copy assignment operator. More...
 
SymbolPatternoperator= (SymbolPattern &&)=default
 The default move assignment operator. More...
 
virtual ~SymbolPattern ()=default
 The default virtual destructor.
 
virtual bool match (const SymbolType &symbol, const Context &context) const noexcept=0
 Test whether a symbol match the pattern, given a context. More...
 

Additional Inherited Members

- Public Types inherited from TuringSim::Symbol::SymbolPattern< SymbolType, std::map< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > > > >
typedef SymbolType SymbolType
 The type of symbols.
 
typedef std::map< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType > > > Context
 The type of context.
 

Detailed Description

template<typename SymbolType>
class TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >

A MixedSymbolPattern with a predicate adapted to m-configuration.

Template Parameters
SymbolTypeThe type of symbols.

Definition at line 437 of file turingMachineSymbolPattern.h.

Constructor & Destructor Documentation

◆ TuringStyleMixedSymbolPattern()

template<typename SymbolType >
constexpr TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >::TuringStyleMixedSymbolPattern ( const std::set< SymbolType > &  symbols,
const std::set< SymbolType > &  keys,
bool  neg 
)
inlineconstexpr

Build a TuringStyleMixedSymbolPattern from components.

Parameters
symbolssymbols to recognize.
keyskeys to recognize.
negwhether recognition is reject, instead of accept.

Definition at line 445 of file turingMachineSymbolPattern.h.

Member Function Documentation

◆ match()

template<typename SymbolType >
virtual bool TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >::match ( const SymbolType symbol,
const std::map< SymbolType, std::shared_ptr< const State::MConfiguration::MConfiguration< SymbolType >>> &  context 
) const
inlineoverridevirtualnoexcept

Check is a symbol is accepted.

Parameters
[in]symbolthe symbol to check.
[in]contexta map from symbols to m-configurations.
Returns
The pattern matches if a key maps to a m-configuration that is a simple leaf equal to the symbol, or equal to one of explicitly accepted symbols.

Definition at line 454 of file turingMachineSymbolPattern.h.

◆ operator!=()

template<typename SymbolType >
constexpr bool TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >::operator!= ( const TuringStyleMixedSymbolPattern< SymbolType > &  other) const
inlineconstexpr

Non-equality operator.

Parameters
[in]otherthe value to compare.
Returns
Whether the comparison is true.

Definition at line 472 of file turingMachineSymbolPattern.h.

◆ operator<()

template<typename SymbolType >
constexpr bool TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >::operator< ( const TuringStyleMixedSymbolPattern< SymbolType > &  other) const
inlineconstexpr

Less than.

Parameters
[in]otherthe value to compare.
Returns
Whether the comparison is true.

Definition at line 478 of file turingMachineSymbolPattern.h.

◆ operator==()

template<typename SymbolType >
constexpr bool TuringSim::Symbol::TuringStyleMixedSymbolPattern< SymbolType >::operator== ( const TuringStyleMixedSymbolPattern< SymbolType > &  other) const
inlineconstexpr

Equality operator.

Parameters
[in]otherthe value to compare.
Returns
Whether the comparison is true.

Definition at line 466 of file turingMachineSymbolPattern.h.


The documentation for this class was generated from the following file: