A simple command-line Turing machine simulator written in Rust.
It reads a transition table from a text file, asks for an input string, and simulates the machine until it halts.
Build and run with cargo
cargo run -- <input file>- The first line lists the final (accepting) states, comma-separated.
- Each subsequent line defines a transition in the format:
(current_state, read_symbol) -> (next_state, write_symbol, direction)
- direction can be either
<(move left) or>(move right) _represents a blank cell
- Parses Turing machine transition definitions from a plain text file
- Uses a hash map for the transition table for fast lookups
- Interactive simulation with live tape updates
- Accept/reject halts based on final states
- Tape length = 256 cells with wraparound
- All uninitialized tape cells are
_ - Simulator starts in state
q0and halts when no valid transition exists - If the current state is in the list of final states, the machine accepts; otherwise, it halts with an error
- Parse input files and run the machine
- Instantaneous description
- Turing machine variants