A Python toolkit for simulating two foundational models of computation: Cellular Automata and Turing Machines.
A mathematical model where cells on a grid evolve step-by-step according to transition rules. This implementation supports:
- Custom states and transition functions
- Multiple simulation modes:
nsteps, until stabilization, or until a target configuration - Configuration save/load (JSON)
- Detection of accepting/rejecting states
A universal model of computation. This simulator reads a machine definition from a .tm file and executes it step by step.
Definition file format:
alphabet: 1 _
states: q0 q1 q_accept
initial: q0
accepting: q_accept
transitions:
q0 1 -> q0 1 R
q0 _ -> q1 1 L
q1 1 -> q_accept 1 R
Features:
- Dynamic tape expansion
- Step-by-step execution with state trace
- Configurable max steps (halting problem safeguard)
# Cellular automaton
make run-ca
# Turing machine
python src/turing.py data/example.tm
# See all commands
make| Tool | Purpose |
|---|---|
| Python 3 | Core language |
| JSON | Configuration persistence |
| Makefile | Task automation |
Ahmad Hatoum
L3 Computer Science project — Université de Versailles Saint-Quentin-en-Yvelines