A Generator for Turing Machine Simulating Programs - User's Manual -
P.R.J. Asveld, Eerke Boiten · 1986
By means of some sample dialogues we show the use of a program to generate Berkeley Pascal programs from Turing machine descriptions such that these Pascal programs simulate the behavior of the corresponding Turing machines. 1. Generating a Program to Simulate a Turing Machine Starting from a description of a Turing machine − according to the grammar given in the file ‘‘turgra’ ’ (See also Appendix 1) − in a file named ‘‘filenm.inp’ ’ (i.e., six letters followed by a ‘‘.’ ’ and ‘‘inp’’) the C-shell script ‘‘gensim’ ’ generates a simulating program for this Turing machine. An example of such an input file has been included in Appendix 2. First ‘‘gensim’ ’ generates a Pascal program ‘‘filenm.p’’ which is compiled immediately by invoking the Berkeley Pascal compiler. The resulting executable code can be found in the file ‘‘filenm’’. Thus typing ‘‘filenm’’ results in starting the simulation of the Turing machine described in ‘‘filenm.inp’’ provided that this description contains no errors. The grammar in ‘‘turgra.txt’ ’ is based on the conventions introduced in [2] and used in [1]. An example with ‘‘filenm.inp’ ’ equal to ‘‘palind.inp’ ’ gives rise to the following dialogue. The Turing machine described in the file ‘‘palind.inp’ ’ decides the set of all palindromes over {a,b} of odd length greater than or equal to three having an a as central letter. This example as well as a few other ones is in the directory