Giter VIP home page Giter VIP logo

alan's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.