A dynamic symbol pattern where some accepted/rejected symbols are explicit and constant, and other accepted/rejected letters are identified by keys, and interpreted in a context.
More...
#include <symbol/turingMachineSymbolPattern.h>
|
| constexpr | MixedSymbolPattern (const std::set< KeyType > &symbols, const std::set< KeyType > &keys, bool neg) |
| | Builds a new MixedSymbolPattern. More...
|
| |
| constexpr bool | matchAccordingToPredicate (const SymbolType &symbol, const std::map< KeyType, ValueType > &context, const std::function< bool(const ValueType &)> &predicate) const |
| | Test if a key match a given predicate in a given context. More...
|
| |
| constexpr bool | operator== (const MixedSymbolPattern< KeyType, ValueType, SymbolType > &other) const |
| | Equality operator. More...
|
| |
| constexpr bool | operator!= (const MixedSymbolPattern< KeyType, ValueType, SymbolType > &other) const |
| | Non-equality operator. More...
|
| |
| constexpr bool | operator< (const MixedSymbolPattern< KeyType, ValueType, SymbolType > &other) const |
| | Less than operator, total order. More...
|
| |
| constexpr bool | isAlphaEquivalent (const MixedSymbolPattern< KeyType, ValueType, SymbolType > &other, const std::map< KeyType, KeyType > &rewriting) const |
| | Test if, given a renaming of keys, *this is alpha-equivalent to another DynamicSymbolPattern. More...
|
| |
|
| SymbolPattern ()=default |
| | The default constructor.
|
| |
|
| SymbolPattern (const SymbolPattern &)=default |
| | The default copy constructor.
|
| |
|
| SymbolPattern (SymbolPattern &&)=default |
| | The default move constructor.
|
| |
| SymbolPattern & | operator= (const SymbolPattern &)=default |
| | The default copy assignment operator. More...
|
| |
| SymbolPattern & | operator= (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...
|
| |
template<typename KeyType, typename ValueType, typename SymbolType>
class TuringSim::Symbol::MixedSymbolPattern< KeyType, ValueType, SymbolType >
A dynamic symbol pattern where some accepted/rejected symbols are explicit and constant, and other accepted/rejected letters are identified by keys, and interpreted in a context.
- Template Parameters
-
| KeyType | The type of keys. |
| ValueType | The type to which keys map. |
| SymbolType | The type of symbols. |
Definition at line 311 of file turingMachineSymbolPattern.h.
◆ MixedSymbolPattern()
template<typename KeyType , typename ValueType , typename SymbolType >
Builds a new MixedSymbolPattern.
- Parameters
-
| [in] | symbols | explicit set of symbols to recognize. |
| [in] | keys | keys of symbols to recognize in a context. |
| [in] | neg | whether to accept or reject the symbol when the pattern matches. |
Definition at line 318 of file turingMachineSymbolPattern.h.
◆ isAlphaEquivalent()
template<typename KeyType , typename ValueType , typename SymbolType >
Test if, given a renaming of keys, *this is alpha-equivalent to another DynamicSymbolPattern.
- Parameters
-
| [in] | other | the other pattern to compare. |
| [in] | rewriting | the renaming of keys, must be injective. |
- Returns
- whether the two pattern are equivalent.
Definition at line 386 of file turingMachineSymbolPattern.h.
◆ matchAccordingToPredicate()
template<typename KeyType , typename ValueType , typename SymbolType >
Test if a key match a given predicate in a given context.
- Parameters
-
| [in] | symbol | the symbol we want to match. |
| [in] | context | a map from KeyType to ValueType, that gives a meaning to each key. |
| [in] | predicate | a predicate that recognizes values of type ValueType. |
- Returns
- Whether the pattern is accepted.
The pattern matches if a key of *this maps to a value (according to context) that is recognized by predicate, or if the symbol is equal to one of the explicit symbols.
If the pattern matches, and the pattern is positive, the pattern is accepted. If the pattern matches and is negative, it is rejected. Conversely if the pattern does not match, it is accepted if and only if the pattern is negative.
Definition at line 333 of file turingMachineSymbolPattern.h.
◆ operator!=()
template<typename KeyType , typename ValueType , typename SymbolType >
Non-equality operator.
- Parameters
-
| [in] | other | the value to compare. |
- Returns
- Whether the comparison is true.
Definition at line 360 of file turingMachineSymbolPattern.h.
◆ operator<()
template<typename KeyType , typename ValueType , typename SymbolType >
Less than operator, total order.
- Parameters
-
| [in] | other | the value to compare. |
- Returns
- Whether the comparison is true.
Definition at line 365 of file turingMachineSymbolPattern.h.
◆ operator==()
template<typename KeyType , typename ValueType , typename SymbolType >
Equality operator.
- Parameters
-
| [in] | other | the value to compare. |
- Returns
- Whether the comparison is true.
Definition at line 355 of file turingMachineSymbolPattern.h.
◆ operator<<
template<typename KeyType , typename ValueType , typename SymbolType >
template<typename CharT = char, typename Traits = std::char_traits<CharT>>
| std::basic_ostream<CharT, Traits>& operator<< |
( |
std::basic_ostream< CharT, Traits > & |
os, |
|
|
const MixedSymbolPattern< KeyType, ValueType, SymbolType > & |
pattern |
|
) |
| |
|
friend |
Debug printer for MixedSymbolPattern.
- Template Parameters
-
| CharT | char type. |
| Traits | std::basic_ostream traits. |
- Parameters
-
| os | output stream. |
| pattern | pattern to print. |
- Returns
- a reference to
os.
Definition at line 416 of file turingMachineSymbolPattern.h.
The documentation for this class was generated from the following file: