JasTeX → Turing Machine → Simulation
Under my guidance, B.J. Dweck created a nifty little
program that lets you do all the following in a unified Java application:
- Draw a TM state diagram using
JasTeX:
a Java based graph/automata drawing and
GasTeX
LaTeX source code generator.
- Generate
GasTeX
LaTeX source code so you can print out your Turing Machine inside a
LaTeX document.
- Get the 7-tuple description for the Turing Machine (except for some
ambiguity involving the input versus tape alphabet)
- Automatically translate the TM into usable instructions for
a Suzanne Skinner Turing Machine applet, and have
the applet simulate the Turing Machine inside the program.
Here are some screenshots of the four functionalities for a Turing Machine
Simulator for the language
{ anbncn | n > 0 }:
- Draw the Turing Machine (press the "Drawing" tab):
- Generate GasTeX source for use with LaTeX documents (press the "Latex Code" tab):
- Get the 7-tuple (press the "Turing Machine Description" tab):
- Translate into a Suzanne Skinner Turing Machine
(press the "Turing Machine Applet" tab).
- Now you should slide the "initial tape" slider all the way to the
left so input is read at the beginning, press "Install Program" to
have the generated instructions registered, and enter a test string
into the "Initial characters on" text-field (in our example I used the
string aaaaabbbbbcccccc = a5b5c6 ).
- Choose your simulation speed (I recommend "Fast"), press "Start"
and see how the computation proceeds on the tape. In our case, the computation
"REJECTED" as the message "No applicable transition found" indicates that the
TM either crashed or halted in a non-accept state.
- Repeating instead with the string
a5b5c5
we "ACCEPT" as indicated by the message "Machine halted: Halt state reached".
I use the program in my Computer Science Theory course
to help illustrate Turing Machines, and also to help
me draw Turing Machines and other automata for printing up in LaTeX documents
such as handouts and exams.
If you would like to try out the program
you will need to have Java on your system. Then:
- download the Turing
Machine Application jar file
into the directory that you'll want to run it from
(right click and save directly to your hard drive)
- follow the usage instructions
- try out the following example Turing Machine instances.
You load them into the application by downloading
and then chooosing File→Open→filename
from the application.
- { anbncn | n > 0 }. This is the example pictured above.
-
{ 0n1m | m is a positive multiple of n }
-
{ bitstrings x with n0(x) = 5n1(x) }
(i.e. five times as many 0's as 1's) - by Zeyar Htet
- converts binary numbers to unary
Last modified: Sun Nov 14 16:43:14 2004