Interactive visualizer for deterministic and nondeterministic k-tape Turing machines.
The production website is hosted on turingviz.org.
TuringViz lets you define and run k-tape Turing machines in YAML and inspect them from multiple angles:
- State Graph: machine-level transition graph.
- Configuration Graph: reachable configurations including tape contents and head positions.
- Computation Tree: unfolded nondeterministic branching over time, with optional compression.
- Execution controls: step-by-step execution, auto-run, and manual choice of nondeterministic branches.
- YAML editor: Monaco-based editor with schema-backed validation.
- Machine definitions are written in YAML.
- Transition styles supported:
- movement-string shorthand (
L,R,S) - object form (optional
write+ movement -> next state) - list form for nondeterministic choices
- movement-string shorthand (
- Schema/reference files in this repo:
public/turingMachineSchema.jsonYamlSchema.md
- Share links: generated links encode the current machine in the URL hash (
#tm=...). - Gist import: machine YAML can be loaded from GitHub Gists via
?gist=.... - Examples menu: built-in machine examples for quick exploration.
- Recent machines: recently loaded machines are available in the UI.
This project was started in the Softwarepraktikum course at the University of Regensburg and developed by Christoph Greger and Gregor Porsch.
Beyond the core functionality and the first prototypes, a significant part of the development process also used LLM agents.
- Node.js (LTS recommended)
- npm
npm installnpm run devnpm run buildnpm run previewnpm test
npm run test:coverage- React + TypeScript + Vite
- Material UI
- Monaco Editor +
monaco-yaml - Cytoscape + React Flow + ELK layout
- Zustand state management
- Vitest + Testing Library
Feedback is always welcome.
- Open an issue: GitHub Issues
- Contact by mail:
public@christoph-greger.de
We would also love to hear where you use TuringViz (course, lecture, project, etc.). We are also very happy to hear from people who want to contribute and further develop the project.
We are always happy to receive new, high-quality example machines.
If you share one (via issue or email), we are glad to add it to the website and give proper credits.
The following examples are currently available in the "Load Examples" menu:
BinaryAdd: Adds two binary numbers (input on tapes 1 and 2) and writes the result on tape 3.NonDetSubstring: Nondeterministically guesses a start position and checks whether tape 2 is a substring of tape 1.vvWord: Checks whether an input word has the formvv(the same substring repeated twice).NonDetSubSetSum: Nondeterministic subset-sum machine using binary-encoded numbers.CheckEven: Accepts iff the number of1symbols in a binary input is even.GCD: Computes the greatest common divisor of two unary numbers.AllStrings: Nondeterministically generates all binary strings of a fixed input length.DAG: Example whose configuration graph is acyclic (a directed acyclic graph).Circle: Produces a cyclic configuration graph (a simple loop/circle structure).NonDetSAT: Nondeterministic SAT solver for CNF formulas (accepts iff satisfiable).