Skip to content
Kelvin DeCosta edited this page Dec 23, 2019 · 2 revisions

run

This subcommand loads a Turing Machine from a file and performs computation on an input string.

usage: alan run [-h] [-s MAX_STEPS] [-a] [-f FILENAME] [-r FPS]
                definition tape

positional arguments:
  definition            path to definition file
  tape                  string of tape symbols

optional arguments:
  -h, --help            show this help message and exit
  -s MAX_STEPS, --max-steps MAX_STEPS
                        maximum steps before forcing halt
  -a, --animate
  -f FILENAME, --filename FILENAME
                        path to save animation
  -r FPS, --fps FPS     animation fps

Example

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

Clone this wiki locally