TuringSim
C++ framework to simulate abstract computing models
pushdownMachineTransition.h
1 #pragma once
2 
3 #include <memory/word.h>
4 #include <memory/stack.h>
5 #include <transition/transition.h>
6 
14  template<typename WordAlphabet, typename StackAlphabet>
15  using PushdownMachineStorage = std::tuple<Memory::Word::Word<WordAlphabet>, Memory::Stack::Stack<StackAlphabet>>;
16 
24  template <
25  typename StateType_,
26  typename LetterType_,
27  typename StackSymbolType_
28  >
30  public Transition<StateType_, PushdownMachineStorage<LetterType_, StackSymbolType_>, std::monostate> {
31  public:
40  private:
41  typedef std::tuple<WordType, StackType> StorageType_;
43  public:
44  using typename Transition_::StateType;
45  using typename Transition_::StorageType;
46  using typename Transition_::ApplyHelperType;
47 
51  typedef LetterType_ LetterType;
52 
56  typedef StackSymbolType_ StackSymbolType;
57 
58  static_assert(std::is_same_v<StateType, StateType_>);
59  static_assert(std::is_same_v<StorageType, StorageType_>);
60  static_assert(std::is_same_v<ApplyHelperType, std::monostate>);
61 
64 
67 
70 
75 
80 
82  virtual ~PushdownMachineTransition() = default;
83  };
84 }
TuringSim::Transition::Transition::ApplyHelperType
ApplyHelperType_ ApplyHelperType
The type of apply helpers.
Definition: transition.h:82
TuringSim::Memory::Word::Word
Class to represent a word memory, as used by a FSA.
Definition: word.h:21
TuringSim::Transition::PDM::PushdownMachineTransition::PushdownMachineTransition
PushdownMachineTransition(PushdownMachineTransition &&)=default
The default move constructor.
TuringSim::Transition::PDM::PushdownMachineStorage
std::tuple< Memory::Word::Word< WordAlphabet >, Memory::Stack::Stack< StackAlphabet > > PushdownMachineStorage
The type of the memory of a pushdown machine from the types of letters and symbols on the stack.
Definition: pushdownMachineTransition.h:15
TuringSim::Transition::Transition::StateType
StateType_ StateType
The type of states.
Definition: transition.h:72
TuringSim::Transition::Transition
Base class for transitions.
Definition: transition.h:67
TuringSim::Transition::PDM::PushdownMachineTransition::PushdownMachineTransition
PushdownMachineTransition()=default
The default constructor.
TuringSim::Transition::PDM::PushdownMachineTransition::PushdownMachineTransition
PushdownMachineTransition(const PushdownMachineTransition &)=default
The default copy constructor.
TuringSim::Memory::Stack::Stack
Class to represent a stack memory.
Definition: stack.h:77
TuringSim::Transition::PDM::PushdownMachineTransition::LetterType
LetterType_ LetterType
The type of letter of the word.
Definition: pushdownMachineTransition.h:51
TuringSim::Transition::PDM::PushdownMachineTransition::operator=
PushdownMachineTransition & operator=(PushdownMachineTransition &&)=default
The default move assignment operator.
TuringSim::Transition::PDM::PushdownMachineTransition::StackSymbolType
StackSymbolType_ StackSymbolType
The type of symbols in the stack.
Definition: pushdownMachineTransition.h:56
TuringSim::Transition::PDM::PushdownMachineTransition::~PushdownMachineTransition
virtual ~PushdownMachineTransition()=default
The default virtual destructor.
TuringSim::Transition::PDM::PushdownMachineTransition::StackType
Memory::Stack::Stack< StackSymbolType_ > StackType
The type of the stack of a machine with such transition.
Definition: pushdownMachineTransition.h:39
TuringSim::Transition::PDM::PushdownMachineTransition::operator=
PushdownMachineTransition & operator=(const PushdownMachineTransition &)=default
The default copy assignment operator.
TuringSim::Transition::PDM::PushdownMachineTransition
Transition of pushdown machines, i.e. transition on a word and a stack.
Definition: pushdownMachineTransition.h:30
TuringSim::Transition::Transition::StorageType
StorageType_ StorageType
The type of storage.
Definition: transition.h:77
TuringSim::Transition::PDM::PushdownMachineTransition::WordType
Memory::Word::Word< LetterType_ > WordType
The type of words read by a machine with such transition.
Definition: pushdownMachineTransition.h:35
TuringSim::Transition::PDM
Transitions for pushdown machines.
Definition: generalPushdownMachineTransition.h:7