The Lyons Family Website  
Universal Turing Machine in XSLTThis page is organized as follows:
Introduction Obtaining the
Universal Turing Machine Stylesheet
Running the
Universal Turing Machine Stylesheet saxon add_one_tm.xml utm.xsl tape=199 The output of this command includes information about each step performed by the Turing machine and the final tape, which will contain the number "200".
Description
of the Universal Turing Machine Stylesheet The tape for the Turing machine is specified via the global parameter named "tape". Each character in the string represents a symbol on the tape. The tape must contain at least one symbol. Each of the symbols on the tape must be either the blank symbol or one of the symbols defined in the symbols element of the TMML source document. In theory, the tape for the Turing machine is infinite in both directions (i.e., both to the left and to the right). The stylesheet represents the tape as a string. The stylesheet will append the blank symbol to the right end of the tape when the tape head of the Turing machine moves to the right of the last symbol on the tape. Likewise, the stylesheet will insert a blank symbol at the beginning of the tape when the tape head of the Turing machine moves to the left of the leftmost symbol on the tape. By default, the tape head of the Turing machine is initially positioned over the first symbol on the tape (i.e., the first character of the value of the 'tape' parameter). You can specify a different initial position for the tape head via the optional global parameter named 'start_position'. The value of the 'start_position' parameter should be the character position of the symbol over which you want the tape head to be positioned initially. If you want the tape head to be initially positioned over the 2nd symbol on the tape, then set the 'start_position' parameter to 2. The default value for the 'start_position' parameter is 1. The Turing machine will crash if the transition function is not defined for the current state and the current symbol. The Turing machine will stop when it transitions to one of the halt states. The Turing machine's procedure for processing the input tape is as follows:
The stylesheet will display information about each iteration of the Turing machine's operation. This information includes a snapshot of the tape and a pointer (i.e., "^") under the current symbol. The pointer represents the tape head. Powered by Turing Machines :) 

Last modified: January 12, 2022. Copyright © 2022. Robert C. Lyons. All rights reserved. 