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

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

#include <symbol/turingMachineSymbolPattern.h>

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

Public Member Functions

constexpr TuringStyleDynamicSymbolPattern (bool neg)
 Produce a trivial pattern. More...
 
constexpr TuringStyleDynamicSymbolPattern (const SymbolType &key)
 Make a dynamic pattern that accepts a single key. More...
 
constexpr TuringStyleDynamicSymbolPattern (const std::set< SymbolType > &keys)
 Make a dynamic pattern that accepts a set of keys. More...
 
constexpr TuringStyleDynamicSymbolPattern (const std::set< SymbolType > &keys, bool neg)
 Make a dynamic pattern that accepts or rejects a set of keys. More...
 
virtual bool match (const SymbolType &symbol, const std::map< SymbolType, State::MConfiguration::MConfiguration< SymbolType >> &context) const override
 Check is a symbol is accepted. More...
 
constexpr bool operator== (const TuringStyleDynamicSymbolPattern< SymbolType > &other) const
 Equality operator. More...
 
constexpr bool operator!= (const TuringStyleDynamicSymbolPattern< SymbolType > &other) const
 Non-equality operator. More...
 
constexpr bool operator< (const TuringStyleDynamicSymbolPattern< SymbolType > &other) const
 Less than operator. Total order. More...
 
- Public Member Functions inherited from TuringSim::Symbol::DynamicSymbolPattern< SymbolType, State::MConfiguration::MConfiguration< SymbolType >, SymbolType >
constexpr DynamicSymbolPattern (bool neg)
 Produce a trivial pattern. More...
 
constexpr DynamicSymbolPattern (const SymbolType &key)
 Make a dynamic pattern that accepts a single key. More...
 
constexpr DynamicSymbolPattern (const std::set< SymbolType > &keys)
 Make a dynamic pattern that accepts a set of keys. More...
 
constexpr DynamicSymbolPattern (const std::set< SymbolType > &keys, bool neg)
 Make a dynamic pattern that accepts or rejects a set of keys. More...
 
constexpr bool matchAccordingToPredicate (const std::map< SymbolType, State::MConfiguration::MConfiguration< SymbolType > > &context, const std::function< bool(const State::MConfiguration::MConfiguration< SymbolType > &)> &predicate) const
 Test if a key match a given predicate in a given context. More...
 
constexpr bool operator== (const DynamicSymbolPattern< SymbolType, State::MConfiguration::MConfiguration< SymbolType >, SymbolType > &other) const
 Equality operator. More...
 
constexpr bool operator!= (const DynamicSymbolPattern< SymbolType, State::MConfiguration::MConfiguration< SymbolType >, SymbolType > &other) const
 Non-equality operator. More...
 
constexpr bool operator< (const DynamicSymbolPattern< SymbolType, State::MConfiguration::MConfiguration< SymbolType >, SymbolType > &other) const
 Less than operator. More...
 
constexpr bool isAlphaEquivalent (const DynamicSymbolPattern< SymbolType, 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, 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, State::MConfiguration::MConfiguration< SymbolType > > >
typedef SymbolType SymbolType
 The type of symbols.
 
typedef std::map< SymbolType, State::MConfiguration::MConfiguration< SymbolType > > Context
 The type of context.
 

Detailed Description

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

A DynamicSymbolPattern with a predicate adapted to m-configuration.

Template Parameters
SymbolTypeThe type of symbols.

Definition at line 247 of file turingMachineSymbolPattern.h.

Constructor & Destructor Documentation

◆ TuringStyleDynamicSymbolPattern() [1/4]

template<typename SymbolType >
constexpr TuringSim::Symbol::TuringStyleDynamicSymbolPattern< SymbolType >::TuringStyleDynamicSymbolPattern ( bool  neg)
inlineexplicitconstexpr

Produce a trivial pattern.

Parameters
[in]negif true, accepts everything. If false, rejects everything.

Definition at line 253 of file turingMachineSymbolPattern.h.

◆ TuringStyleDynamicSymbolPattern() [2/4]

template<typename SymbolType >
constexpr TuringSim::Symbol::TuringStyleDynamicSymbolPattern< SymbolType >::TuringStyleDynamicSymbolPattern ( const SymbolType key)
inlineconstexpr

Make a dynamic pattern that accepts a single key.

Parameters
[in]keythe key to accept.

Definition at line 258 of file turingMachineSymbolPattern.h.

◆ TuringStyleDynamicSymbolPattern() [3/4]

template<typename SymbolType >
constexpr TuringSim::Symbol::TuringStyleDynamicSymbolPattern< SymbolType >::TuringStyleDynamicSymbolPattern ( const std::set< SymbolType > &  keys)
inlineconstexpr

Make a dynamic pattern that accepts a set of keys.

Parameters
[in]keyskeys to accept.

Definition at line 263 of file turingMachineSymbolPattern.h.

◆ TuringStyleDynamicSymbolPattern() [4/4]

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

Make a dynamic pattern that accepts or rejects a set of keys.

Parameters
[in]keyskeys to accept/reject.
[in]negif true, keys are rejected rather than accepted.

Definition at line 269 of file turingMachineSymbolPattern.h.

Member Function Documentation

◆ match()

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

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.

Definition at line 276 of file turingMachineSymbolPattern.h.

Here is the call graph for this function:

◆ operator!=()

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

Non-equality operator.

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

Definition at line 294 of file turingMachineSymbolPattern.h.

Here is the call graph for this function:

◆ operator<()

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

Less than operator. Total order.

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

Definition at line 300 of file turingMachineSymbolPattern.h.

Here is the call graph for this function:

◆ operator==()

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

Equality operator.

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

Definition at line 288 of file turingMachineSymbolPattern.h.

Here is the call graph for this function:

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