Math 160AB - Mathematical Logic
Winter 2002, Univ. of California, San Diego, Professor S. Buss

James Noble's Java Program Simulating A Turing Machine

Jame Noble has written a Java program that simulates a Turing machine's operation for our class.   You can download the program, and some test data from this page.    James suggests you might find this useful for homework problems.

Files: 

  1. TM.java  -  the source file.  Also contains documentation in the comments.
  2. TMspec  -  a sample of how to specify a Turing machine.  This is a plain text file.
  3. TapeData - a sample of how to specify the initial tape contents.  This is a plain text file.

To compile use the command:   javac TM.java

To run with the sample data use the command:  java TM TapeData TMspec

Caveats:  I have not tested the program myself, beyond trying out the sample files.  Do not include blank lines in the files specifying the Turing machine, not even a final blank line.