Alan
:computer: A programming language for designing Turing Machines.
Install / Use
/learn @kelvindecosta/AlanREADME
Alan
<p align=center> <img src="https://raw.githubusercontent.com/kelvindecosta/alan/master/assets/readme/logo.png" height="200px"/> <br> <span>A programming language for <em>designing</em> Turing machines.</span> <br> <a target="_blank" href="https://www.python.org/downloads/" title="Python version"><img src="https://img.shields.io/badge/python-%3E=_3.6-green.svg"></a> <a target="_blank" href="LICENSE" title="License: MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a> <a target="_blank" href="https://pypi.python.org/pypi/alan/"><img alt="pypi package" src="https://badge.fury.io/py/alan.svg"></a> </p> <p align="center"> <a href="#walkthrough">Walkthrough</a> | <a href="#installation">Installation</a> | <a href="https://github.com/kelvindecosta/alan/wiki">Wiki</a> | <a href="#citation">Citation</a> </p>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
<p align="center"><img src="https://raw.githubusercontent.com/kelvindecosta/alan/master/assets/readme/binary-palindrome.png"></p>
Run the machine on some inputs:
-
alan run examples/binary-palindrome.aln 101Accepted Initial Tape : 101 Final Tape : 10 -
alan run examples/binary-palindrome.aln 1010Rejected 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}},
}
Related Skills
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
ui-ux-pro-max-skill
57.9kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
ui-ux-pro-max-skill
57.9kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
onlook
25.0kThe Cursor for Designers • An Open-Source AI-First Design tool • Visually build, style, and edit your React App with AI
