Education Turing Machine simulator in Python
Project description
py-turing
A simple and extensible Turing Machine simulator written in Python, designed for learning, experimentation, and educational purposes.
This project allows users to define states, transitions, and tapes to simulate the behavior of a deterministic Turing Machine, one of the fundamental models in the theory of computation.
๐ About
A Turing Machine is an abstract computational model introduced by Alan Turing in 1936. It is widely used in computer science to study the limits of computation and algorithm design.
py-turing provides a Python implementation that enables:
- Simulation of Turing Machines
- Creation of custom transition rules
- Step-by-step computation
- Experimentation with theoretical algorithms
This project is intended for:
- Computer Science students
- Theory of Computation courses
- Developers interested in computational models
- Educational demonstrations
โจ Features
- Deterministic Turing Machine simulation
- Customizable tape input
- Configurable states and transitions
- Step-by-step execution
- Simple and modular Python architecture
- Easy to extend and modify
- CLI-ready structure
๐ Project Structure
py-turing/
โ
โโโ pyproject.toml
โโโ README.md
โโโ LICENSE
โโโ .gitignore
โ
โโโ src/
โโโ pyturing/
โโโ __init__.py
โ
โโโ machine/
โ โโโ __init__.py
โ โโโ turing_machine.py
โ โโโ tape.py
โ โโโ states.py
โ
โโโ alphabet/
โ โโโ __init__.py
โ โโโ symbol.py
โ โโโ alphabet.py
โ โโโ tape_alphabet.py
โ
โโ transition/
โโโ __init__.py
โโโ transition.py
โโโ transition_function.py
โโโ direction.py
๐งช Example Turing Machines
Examples you can implement using py-turing:
- Binary increment machine
- Palindrome checker
- Unary addition
- Even/Odd binary checker
- String copying machine
๐งฉ How It Works
A Turing Machine consists of:
- Tape โ infinite memory divided into cells
- Head โ reads and writes symbols on the tape
- States โ machine configuration states
- Transition Function โ rules that determine the next action
Each step follows this rule:
(Current State, Read Symbol) โ (Next State, Write Symbol, Move Direction)
Where direction can be:
Lโ Move leftRโ Move right
๐ค Contributing
Contributions are welcome!
To contribute:
- Fork the repository
- Create a new branch
git checkout -b feature/my-feature
- Make your changes
- Commit your work
git commit -m "Add new feature"
- Push to your fork
git push origin feature/my-feature
- Open a Pull Request
๐ License
This project is licensed under the MIT License.
๐จโ๐ป Author
Developed by Eric Santos.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file turing_py-0.1.1.tar.gz.
File metadata
- Download URL: turing_py-0.1.1.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a295b4de5f0a50e9e31172d5e64ccae66f02672d0acf5a954616a3c86c32323
|
|
| MD5 |
3095dfd6a04dc87a363c858411f42a60
|
|
| BLAKE2b-256 |
ba64fb2f8179b7ae11300d30c9b6b632f7781275fa20333ea8766bda6979a7b1
|
File details
Details for the file turing_py-0.1.1-py3-none-any.whl.
File metadata
- Download URL: turing_py-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81ba46dad3e4a9277e8e7f5cb2e2f9e1afc84410bb334331698349f9550fb718
|
|
| MD5 |
e241de9230c4d6793546d849c491f703
|
|
| BLAKE2b-256 |
a7c14b687ad3da44b51d2b0b598a42445627758de72d9f445e0fefa50c009065
|