|
MTMS main
Modern Turing Machine Simulator
|
Represents a multi-tape transition rule (δ: Q × Γ^k → Q × Γ^k × {L, R}^k). More...
#include <transition.hpp>
Public Member Functions | |
| const State & | get_current_state () const noexcept |
| Retrieves the source state required to trigger this transition. | |
| const std::vector< Direction > & | get_directions () const noexcept |
| Retrieves the directions in which each parallel tape head must shift. | |
| std::size_t | get_id () const noexcept |
| Retrieves the unique identifier of this transition rule. | |
| const State & | get_next_state () const noexcept |
| Retrieves the target state the machine will enter after executing this rule. | |
| const std::vector< Symbol > & | get_read_symbols () const noexcept |
| Retrieves the collection of symbols that must be present under the tape heads. | |
| const std::vector< Symbol > & | get_write_symbols () const noexcept |
| Retrieves the new symbols that will overwrite the current parallel tape cells. | |
| auto | operator<=> (const Transition &other) const noexcept |
| Lexicographical ordering of transitions for container storage. | |
| bool | operator== (const Transition &other) const noexcept |
| Checks equality of transitions based on their semantic identity. | |
| void | set_direction_at (std::size_t tape_idx, const Direction &dir) noexcept(false) |
| Allows granular modification of a specific tape cell. | |
| void | set_directions (std::vector< Direction > dir) noexcept |
| Modifies the heads' movement direction. | |
| void | set_next_state (State next) noexcept |
| Modifies the transition's destination state. | |
| void | set_read_symbol_at (std::size_t tape_idx, const Symbol &sym) noexcept(false) |
| Allows granular modification of a specific tape cell. | |
| void | set_read_symbols (std::vector< Symbol > read) noexcept |
| Modifies the whole reading symbols block (k-tapes). | |
| void | set_write_symbol_at (std::size_t tape_idx, const Symbol &sym) noexcept(false) |
| Allows granular modification of a specific tape cell. | |
| void | set_write_symbols (std::vector< Symbol > write) noexcept |
| Modifies the whole writing symbols block (k-tapes). | |
| Transition ()=default | |
| Default constructor. | |
| Transition (std::size_t id, State current, State next, std::vector< Symbol > read, std::vector< Symbol > write, std::vector< Direction > dir) noexcept | |
| Explicit constructor to define a complete multi-tape transition rule. | |
Private Attributes | |
| State | current_state_ |
| Source state for the transition rule. | |
| std::vector< Direction > | dir_vectors_ |
| Structural head shift directions vector. | |
| std::size_t | id_ {0} |
| Unique runtime identifier for UI and graph edge tracking. | |
| State | next_state_ |
| Destination state after execution. | |
| std::vector< Symbol > | read_symbols_ |
| Expected vector array of symbols on the tracks. | |
| std::vector< Symbol > | write_symbols_ |
| New vector array of symbols to write. | |
Represents a multi-tape transition rule (δ: Q × Γ^k → Q × Γ^k × {L, R}^k).
Defines the synchronized actions to take across all k parallel tapes when the Turing Machine is in a specific state.
Definition at line 28 of file transition.hpp.
|
default |
Default constructor.
Initializes an empty transition shifting LEFT.
|
inlineexplicitnoexcept |
Explicit constructor to define a complete multi-tape transition rule.
| id | Unique runtime identifier for UI and graph edge tracking. |
| current | The required state to trigger this transition. |
| next | The target state the machine will transition into. |
| read | The collection of symbols expected under each parallel tape head. |
| write | The collection of new symbols to overwrite onto each tape track. |
| dir | The collection of displacement directions for each tape head. |
Definition at line 45 of file transition.hpp.
|
inlinenoexcept |
Retrieves the source state required to trigger this transition.
Definition at line 68 of file transition.hpp.
References current_state_.
|
inlinenoexcept |
Retrieves the directions in which each parallel tape head must shift.
Definition at line 98 of file transition.hpp.
References dir_vectors_.
Referenced by TuringMachine::step().
|
inlinenoexcept |
Retrieves the unique identifier of this transition rule.
Useful for persistent mapping in GUI elements, undo/redo stacks, and graph edge binding.
Definition at line 62 of file transition.hpp.
References id_.
|
inlinenoexcept |
Retrieves the target state the machine will enter after executing this rule.
Definition at line 74 of file transition.hpp.
References next_state_.
Referenced by TuringMachine::step().
|
inlinenoexcept |
Retrieves the collection of symbols that must be present under the tape heads.
Definition at line 80 of file transition.hpp.
References read_symbols_.
|
inlinenoexcept |
Retrieves the new symbols that will overwrite the current parallel tape cells.
Definition at line 89 of file transition.hpp.
References write_symbols_.
Referenced by TuringMachine::step().
|
inlinenoexcept |
Lexicographical ordering of transitions for container storage.
Definition at line 124 of file transition.hpp.
|
inlinenoexcept |
Checks equality of transitions based on their semantic identity.
This definition allows detecting non-determinism in the Turing Machine by treating transitions with identical (state, read_symbols) as conflicts.
| other | The transition to compare against. |
Definition at line 112 of file transition.hpp.
References current_state_, and read_symbols_.
|
inline |
Allows granular modification of a specific tape cell.
| std::out_of_range | If the tape index is invalid. |
Definition at line 192 of file transition.hpp.
References dir_vectors_.
|
inlinenoexcept |
Modifies the heads' movement direction.
Definition at line 157 of file transition.hpp.
References dir_vectors_.
|
inlinenoexcept |
Modifies the transition's destination state.
Definition at line 136 of file transition.hpp.
References next_state_.
|
inline |
Allows granular modification of a specific tape cell.
| std::out_of_range | If the tape index is invalid. |
Definition at line 166 of file transition.hpp.
References read_symbols_.
|
inlinenoexcept |
Modifies the whole reading symbols block (k-tapes).
Definition at line 141 of file transition.hpp.
References read_symbols_.
|
inline |
Allows granular modification of a specific tape cell.
| std::out_of_range | If the tape index is invalid. |
Definition at line 179 of file transition.hpp.
References write_symbols_.
|
inlinenoexcept |
Modifies the whole writing symbols block (k-tapes).
Definition at line 149 of file transition.hpp.
References write_symbols_.
|
private |
Source state for the transition rule.
Definition at line 203 of file transition.hpp.
Referenced by get_current_state(), and operator==().
|
private |
Structural head shift directions vector.
Definition at line 207 of file transition.hpp.
Referenced by get_directions(), set_direction_at(), and set_directions().
|
private |
Unique runtime identifier for UI and graph edge tracking.
Definition at line 202 of file transition.hpp.
Referenced by get_id().
|
private |
Destination state after execution.
Definition at line 204 of file transition.hpp.
Referenced by get_next_state(), and set_next_state().
|
private |
Expected vector array of symbols on the tracks.
Definition at line 205 of file transition.hpp.
Referenced by get_read_symbols(), operator==(), set_read_symbol_at(), and set_read_symbols().
|
private |
New vector array of symbols to write.
Definition at line 206 of file transition.hpp.
Referenced by get_write_symbols(), set_write_symbol_at(), and set_write_symbols().