|
TuringSim
C++ framework to simulate abstract computing models
|
The class to represent a Turing machine. More...
#include <machine/turingMachine.h>


Public Types | |
| typedef StorageType::SymbolType | SymbolType |
| The type of the symbols on the tape. | |
| typedef TransitionType::HasHalfTape | HasHalfTape |
| Whether the tape is a Tape or a HalfTape. More... | |
Public Member Functions | |
| TuringMachine ()=default | |
| The default constructor. | |
| TuringMachine (const TuringMachine &)=default | |
| The default copy constructor. | |
| TuringMachine (TuringMachine &&)=default | |
| The default move constructor. | |
| TuringMachine & | operator= (const TuringMachine &)=default |
| The default copy assignment operator. More... | |
| TuringMachine & | operator= (TuringMachine &&)=default |
| The default move assignment operator. More... | |
| virtual | ~TuringMachine () override=default |
| The default virtual destructor. | |
| virtual bool | isHaltingState (const StateType &state) const noexcept=0 |
| Test if a given state is a halting one. More... | |
| virtual bool | isHaltingConfiguration (const StateType &state, const StorageType &storage) const noexcept override final |
| Test if a given configuration is a halting one. More... | |
The class to represent a Turing machine.
A Turing machine is a machine whose storage is a tape-like: it can be a tape or a half-tape. Moreover, terminal configuration of Turing machines depends only on their current state, not the content of the tape.
This class does not hold any data member. All typedef types in Machine::Machine are still accessible.
| TransitionType_ | the type of the transitions of the machine. It must be a derived class of Transition::TuringMachineTransition. |
| deterministic | a boolean, whether the machine is expected to be deterministic. |
| acceptingStyle | whether the machine is alternating, regularly accepting, or not. |
| TransitionContainer_ | the container used to return matching transitions. By default, it is std::vector. |
| InitialStateContainer_ | the container used to return initial states. By default, it is std::vector. |
These template parameters have the same usage as in Machine::Machine.
Definition at line 33 of file turingMachine.h.
| TuringSim::Machine::Turing::TuringMachine< TransitionType_, deterministic, acceptingStyle, TransitionContainer_, InitialStateContainer_ >::HasHalfTape |
Whether the tape is a Tape or a HalfTape.
It is std::integral_constant<bool, halfTape> where halfTape is a boolean, which is true if and only if the tape is a half-tape.
Definition at line 59 of file turingMachine.h.
|
inlinefinaloverridevirtualnoexcept |
Test if a given configuration is a halting one.
| [in] | state | a const reference to a StateType. It represents the current state of the machine. |
| [in] | storage | a const reference to a StorageType. It represents the current memory of the machine. |
Parameter state must come from getInitialStates() const, or a sequence of valid transition applications from an initial state.
Termination of Turing machines does not depend on the current storage.
See Machine::isHaltingConfiguration(const StateType& state, const StorageType& storage) const for more details on termination.
Definition at line 123 of file turingMachine.h.
|
pure virtualnoexcept |
Test if a given state is a halting one.
| [in] | state | a const reference to a StateType. It represents the current state of the machine. |
Parameter state must come from getInitialStates() const, or a sequence of valid transition applications from an initial state.
Termination of Turing machines does not depend on the current storage.
See Machine::isHaltingConfiguration(const StateType& state, const StorageType& storage) const for more details on termination.

|
default |
The default copy assignment operator.
*this.
|
default |
The default move assignment operator.
*this.