A dynamic symbol pattern where accepted/rejected letters are identified by keys, and interpreted in a context.
More...
|
| constexpr | DynamicSymbolPattern (bool neg) |
| | Produce a trivial pattern. More...
|
| |
| constexpr | DynamicSymbolPattern (const KeyType &key) |
| | Make a dynamic pattern that accepts a single key. More...
|
| |
| constexpr | DynamicSymbolPattern (const std::set< KeyType > &keys) |
| | Make a dynamic pattern that accepts a set of keys. More...
|
| |
| constexpr | DynamicSymbolPattern (const std::set< KeyType > &keys, bool neg) |
| | Make a dynamic pattern that accepts or rejects a set of keys. More...
|
| |
| constexpr bool | matchAccordingToPredicate (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 DynamicSymbolPattern< KeyType, ValueType, SymbolType > &other) const |
| | Equality operator. More...
|
| |
| constexpr bool | operator!= (const DynamicSymbolPattern< KeyType, ValueType, SymbolType > &other) const |
| | Non-equality operator. More...
|
| |
| constexpr bool | operator< (const DynamicSymbolPattern< KeyType, ValueType, SymbolType > &other) const |
| | Less than operator. More...
|
| |
| constexpr bool | isAlphaEquivalent (const DynamicSymbolPattern< 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::DynamicSymbolPattern< KeyType, ValueType, SymbolType >
A dynamic symbol pattern where 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 124 of file turingMachineSymbolPattern.h.
template<typename KeyType , typename ValueType , typename SymbolType >
Test if a key match a given predicate in a given context.
- Parameters
-
| [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. 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 157 of file turingMachineSymbolPattern.h.
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 DynamicSymbolPattern< KeyType, ValueType, SymbolType > & |
pattern |
|
) |
| |
|
friend |