Alan
A programming language for designing Turing machines.
Walkthrough | Installation | Wiki | Citation
Installation
pip install alan
Walkthrough
This section describes a workflow.
For an in-depth guide navigate to the Wiki. Here are some useful links:
Consider the following example, the definition for a Turing machine that accepts all binary strings that are palindromic:
# This is a definition of a Turing Machine that accepts binary strings that are palindromes
' '
A*
'X' 'X' < A
'Y' 'Y' < A
'0' 'X' > B
'1' 'Y' > F
' ' ' ' > G
B # Starting with 0
'0' '0' > B
'1' '1' > B
' ' ' ' < C
'X' 'X' < C
'Y' 'Y' < C
F # Starting with 1
'0' '0' > F
'1' '1' > F
' ' ' ' < E
'X' 'X' < E
'Y' 'Y' < E
C
'0' 'X' < D
'X' 'X' < D
E
'1' 'Y' < D
'Y' 'Y' < D
D
'0' '0' < D
'1' '1' < D
' ' ' ' > A
'X' 'X' > A
'Y' 'Y' > A
G.
'X' '0' > G
'Y' '1' > G
Graph the machine:
alan graph examples/binary-palindrome.aln -f assets/readme/binary-palindrome.png
Run the machine on some inputs:
-
alan run examples/binary-palindrome.aln 101
Accepted Initial Tape : 101 Final Tape : 10 -
alan run examples/binary-palindrome.aln 1010
Rejected Initial Tape : 1010 Final Tape : Y010
Animate the computation on some inputs:
-
alan run examples/binary-palindrome.aln 101 -a -f assets/readme/binary-palindrome-accepted.gif
-
alan run examples/binary-palindrome.aln 1010 -a -f assets/readme/binary-palindrome-rejected.gif
Citation
If you use this implementation in your work, please cite the following:
@misc{decosta2019alan,
author = {Kelvin DeCosta},
title = {Alan},
year = {2019},
howpublished = {\url{https://github.com/kelvindecosta/alan}},
}
Metadata
Release files for alan 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| alan-0.4.2.linux-x86_64.tar.gz | 10.1 kB | Without provenance | Details |
Release files / alan-0.4.2.linux-x86_64.tar.gz
| Download URL | alan-0.4.2.linux-x86_64.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f75547d5c8d2c9562c3dcf2c0975528d237b5884069cb0e9e547f43a26a2957
|
|
BLAKE2b-256 checksum How to use checksums |
e7bfc4e34a0fdadf40cd807762c2a08cfe43be7c216873a26c3a3d0a09edfa62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Security for alan 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.