Turing Machine

  Download (tm.zip)

     Description of examples look in turing.htm.

     File dtd  tm.dtd and xsl tm.xsl are common for all examples.

     The stylesheet does use the xt:node-set instruction, thus, you should use James Clark's XT to execute the stylesheet. Task on start-up of all examples look in readme.bat.

      We do not use built - in XSLT function of arithmetics, and also function of job with lines of symbols.

      Sequence of symbols of a tape we represent as a tree. At each level of a tree one symbol and reference to other part of a tape contains.

     The instructions for the Turing machine are similarly represented also.

     In examples we indicate a file xml and file with result.

     Example 1. Replacement of each unit by two (tm12.xml , rtm12.xml).

     Example 2. Doubling of quantity of units on a tape (tmmul2.xml , rtmmul2.xml). If, for example, on a tape in the beginning there are 10 units, in the end will be 20 units. 

     Example 3. Check of structure of brackets  (tmbrackets.xml , rtmbrackets.xml). At the end of job in a free square there will be a T, if structure correct, and F - if wrong.

      Example 4. Delete of points between units (tmdelete.xml , rtmdelete.xml). For example, if in the beginning on a tape there were symbols ".11..11...", then in the end we shall have "1111". 

      Example 5.Check of divisibility on 3 (tmdiv3.xml , rtmdiv3.xml). The program consists of 30 instructions. Similarly, it is possible to make the program of check of divisibility on 9. Then the program will consist of 100 instructions.