|
TuringSim
C++ framework to simulate abstract computing models
|
A symbol pattern as used by Turing. Such a pattern accept or reject a finite explicit set of symbols. More...
#include <symbol/turingMachineSymbolPattern.h>


Public Member Functions | |
| constexpr | TuringStyleConstantSymbolPattern (bool neg) |
| Constructs a trivial pattern: a pattern that accepts everything or nothing. More... | |
| constexpr | TuringStyleConstantSymbolPattern (const T &e) |
| Construct a pattern which accept only one symbol. More... | |
| constexpr | TuringStyleConstantSymbolPattern (const std::set< T > &v) |
| Construct a pattern which accept a sequence of symbols. More... | |
| constexpr | TuringStyleConstantSymbolPattern (const std::set< T > &v, bool b) |
| Construct a pattern which accept or reject a sequence of symbols. More... | |
| virtual bool | match (const T &e) const override |
| Test if a letter matches the pattern. More... | |
| constexpr bool | operator== (const TuringStyleConstantSymbolPattern< T > &other) const |
| Equality operator. More... | |
| constexpr bool | operator!= (const TuringStyleConstantSymbolPattern< T > &other) const |
| Non-equality operator. More... | |
| constexpr bool | operator< (const TuringStyleConstantSymbolPattern< T > &other) const |
| Less than operator. Total order. More... | |
Public Member Functions inherited from TuringSim::Symbol::SymbolPattern< T, void > | |
| 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... | |
Friends | |
| template<typename CharT = char, typename Traits = std::char_traits<CharT>> | |
| std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &os, const TuringStyleConstantSymbolPattern &pattern) |
| Debug printer. More... | |
Additional Inherited Members | |
Public Types inherited from TuringSim::Symbol::SymbolPattern< T, void > | |
| typedef T | SymbolType |
| The type of symbols. | |
| typedef void | Context |
| The type of context. | |
A symbol pattern as used by Turing. Such a pattern accept or reject a finite explicit set of symbols.
| T | The alphabet. |
This kind of pattern has the form \(\{x_1, x_2,\ldots,x_n\}\) or \(\text{not}(\{x_1, x_2,\ldots,x_n\})\) where the \(x_i\) are explicit letters.
Definition at line 17 of file turingMachineSymbolPattern.h.
|
inlineexplicitconstexpr |
Constructs a trivial pattern: a pattern that accepts everything or nothing.
| [in] | neg | true if the pattern must accept everything, false if it must reject everything. |
Complexity \(\mathcal{O}(1)\)
Definition at line 25 of file turingMachineSymbolPattern.h.
|
inlineconstexpr |
Construct a pattern which accept only one symbol.
| [in] | e | The symbol to accept. |
The content of the reference is copied.
Complexity \(\mathcal{O}(1)\)
Definition at line 33 of file turingMachineSymbolPattern.h.
|
inlineconstexpr |
Construct a pattern which accept a sequence of symbols.
| [in] | v | The symbols to accept. |
The content of the reference is copied.
Complexity \(\mathcal{O}(|\texttt{v}|)\)
Definition at line 41 of file turingMachineSymbolPattern.h.
|
inlineconstexpr |
Construct a pattern which accept or reject a sequence of symbols.
| [in] | v | The symbols to accept. |
| [in] | b | Whether the pattern must reject these symbols. |
The content of the reference is copied.
Complexity \(\mathcal{O}(|\texttt{v}|)\)
Definition at line 50 of file turingMachineSymbolPattern.h.
|
inlineoverridevirtual |
Test if a letter matches the pattern.
| [in] | e | The letter to test. |
Complexity \(\mathcal{O}(\log|\texttt{v}|)\)
Definition at line 57 of file turingMachineSymbolPattern.h.
|
inlineconstexpr |
Non-equality operator.
| [in] | other | the value to compare. |
Definition at line 69 of file turingMachineSymbolPattern.h.
|
inlineconstexpr |
Less than operator. Total order.
| [in] | other | the value to compare. |
Definition at line 75 of file turingMachineSymbolPattern.h.
|
inlineconstexpr |
Equality operator.
| [in] | other | the value to compare. |
Definition at line 63 of file turingMachineSymbolPattern.h.
|
friend |
Debug printer.
| CharT | char type. |
| Traits | std::basic_ostream trait. |
| [in,out] | os | the output stream. |
| [in] | pattern | The pattern to print. |
os. Definition at line 93 of file turingMachineSymbolPattern.h.