Skip to main content

Alan


A programming language for designing Turing machines.
pypi package

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
    

    Animation of accepted input

  • alan run examples/binary-palindrome.aln 1010 -a -f assets/readme/binary-palindrome-rejected.gif
    

    Animation of rejected input

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}},
}

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)

Source distribution for alan 0.4.2
File Size Uploaded
alan-0.4.2.linux-x86_64.tar.gz 10.1 kB 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

Release history Release notifications | RSS feed

This release

0.4.2 This release

1 release file

0.4.1

2 release files

0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page