TuringSim
C++ framework to simulate abstract computing models
Public Types | Public Member Functions | List of all members
TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape > Class Template Reference

Base class for Turing machine transitions. More...

#include <transition/turingMachineTransition.h>

Inheritance diagram for TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape >:
Inheritance graph
[legend]
Collaboration diagram for TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape >:
Collaboration graph
[legend]

Public Types

typedef SymbolType_ SymbolType
 The type of symbols on the tape.
 
typedef StorageType_::Movement Movement
 The type of movement on the tape.
 
typedef std::integral_constant< bool, hasHalfTape > HasHalfTape
 Whether the tape is a half-tape or a full tape. More...
 
typedef StateType_ StateType
 The type of states.
 
typedef StorageType_ StorageType
 The type of storage.
 
typedef ApplyHelperType_ ApplyHelperType
 The type of apply helpers.
 
- Public Types inherited from TuringSim::Transition::Transition< StateType_, Memory::TapeLike< false, SymbolType_ >, ApplyHelperType_ >
typedef StateType_ StateType
 The type of states.
 
typedef Memory::TapeLike< false, SymbolType_ > StorageType
 The type of storage.
 
typedef ApplyHelperType_ ApplyHelperType
 The type of apply helpers.
 

Public Member Functions

 TuringMachineTransition ()=default
 The default constructor.
 
 TuringMachineTransition (const TuringMachineTransition &)=default
 The default copy constructor.
 
 TuringMachineTransition (TuringMachineTransition &&)=default
 The default move constructor.
 
TuringMachineTransitionoperator= (const TuringMachineTransition &)=default
 The default copy assignment operator. More...
 
TuringMachineTransitionoperator= (TuringMachineTransition &&)=default
 The default move assignment operator. More...
 
virtual ~TuringMachineTransition () override=default
 The default virtual destructor.
 
- Public Member Functions inherited from TuringSim::Transition::Transition< StateType_, Memory::TapeLike< false, SymbolType_ >, ApplyHelperType_ >
 Transition ()=default
 The default constructor.
 
 Transition (const Transition &)=default
 The default copy constructor.
 
 Transition (Transition &&)=default
 The default move constructor.
 
Transitionoperator= (const Transition &)=default
 The default copy assignment operator. More...
 
Transitionoperator= (Transition &&)=default
 The default move assignment operator. More...
 
virtual ~Transition ()=default
 The default virtual destructor.
 
virtual std::optional< ApplyHelperTypematch (const StateType &state, const StorageType &storage) const=0
 Test whether the transition matches a configuration. Returned optional is empty iff the transition does not match. More...
 
virtual StateType apply (const StateType &state, StorageType &storage, ApplyHelperType &&helper, bool &running) const=0
 Apply a previously matching transition and return the new state. More...
 

Detailed Description

template<typename StateType_, typename SymbolType_, typename ApplyHelperType_, bool hasHalfTape = false>
class TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape >

Base class for Turing machine transitions.

Template Parameters
StateType_Type of states.
SymbolType_Type of cells in the tape.
ApplyHelperType_Type used to forward information from match to apply.
hasHalfTapewhether we use a half-tape instead of a full-tape.

Definition at line 25 of file turingMachineTransition.h.

Member Typedef Documentation

◆ HasHalfTape

template<typename StateType_ , typename SymbolType_ , typename ApplyHelperType_ , bool hasHalfTape = false>
TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape >::HasHalfTape

Whether the tape is a half-tape or a full tape.

Same as std::true_type if isHalfTape is true. same as std::false_type otherwise.

Definition at line 49 of file turingMachineTransition.h.

Member Function Documentation

◆ operator=() [1/2]

template<typename StateType_ , typename SymbolType_ , typename ApplyHelperType_ , bool hasHalfTape = false>
TuringMachineTransition& TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape >::operator= ( const TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape > &  )
default

The default copy assignment operator.

Returns
a reference to *this.

◆ operator=() [2/2]

template<typename StateType_ , typename SymbolType_ , typename ApplyHelperType_ , bool hasHalfTape = false>
TuringMachineTransition& TuringSim::Transition::Turing::TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape >::operator= ( TuringMachineTransition< StateType_, SymbolType_, ApplyHelperType_, hasHalfTape > &&  )
default

The default move assignment operator.

Returns
a reference to *this.

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