From a1913e7e542de0d84b6aa2fa899396a4ec85a453 Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Thu, 5 Feb 2026 16:31:58 +0000 Subject: [PATCH] good doc --- document/TM.html | 66 +++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/document/TM.html b/document/TM.html index cae883c..e31b67f 100644 --- a/document/TM.html +++ b/document/TM.html @@ -86,14 +86,15 @@ The following commands are available for the Nondestructive First Order Machine. In this version the notation uses strictly ASCII characters.

-

Grammar

- - statement :: [machine] (command arg_type* )+ - command :: e | q | r | s | w - arg_type :: A | n | R - machine :: L - + +

Grammar

+ +statement :: ( [machine] command arg* )+ +machine :: L +command :: e | q | r | s | w +arg :: R | A '(' int ')' | n '(' int ')' +

Definitions

@@ -102,26 +103,26 @@
  • L Left machine
  • -

    - Each tape machine can be thought of as the composition of two machines, one starts at the head and extends to the right. The other starts at the head and extends left. - This prefix determines which of the two of these machines the command is to be applied to. If it is set to L then the command applies to the left going machine. -

    -

    - The left going machine is not a separate machine from the right going machine, rather it is a mirrored view. Hence, leftmost cell for the right going machine, is the rightmost cell for the left going machine. Etc. -

    - -

    - Address space, as defined in the TTCA book, is a natural number sequence machine that walks in lock step with the right going machine. Thus, by definition, it is a separate machine. So independent of the view we chose, that of the right going machine, or its mirror image, each cell continues to correspond to the same address as it did for the right going machine. However, as the sequence of cells is reversed on the left going machine, the sequence of addresses will also be reversed. Thus, rightmost will have address 0 on the left going machine. -

    +

    + The L prefix selects the mirror view of the tape. + In the mirror view, stepping right moves to the original tape’s left neighbor. + The mirror view shares the same head and the same tape cells; only the interpretation of direction and “rightmost” is flipped. +

    +

    + Address space, as defined in TTCA, is provided by a natural number sequence machine that walks in lock step with the right going machine. + That address to cell correspondence is fixed for the tape. + The L prefix flips only the view. + Under the mirror view, the same addresses appear in reverse order across the page, so the mirror view rightmost cell is the cell with address zero. +

    command

    @@ -129,11 +130,6 @@ The result of the entangle command is a new TM that is entangled with the interfaced machine. By definition, the new entangled machine shares the tape with the original interface machine. Both machines initially have the head on the same cell.

    -

    Machine

    - -

    arg_type

    - Note that here R refers to the rightmost cell as an - argument. It does not mean right going machine, as one might surmise given - that L means left going machine. + R always refers to the rightmost cell of the selected machine.

    +

    Examples

    Relative head movement

    @@ -166,9 +161,11 @@ sA(0) ; step to the leftmost cell by address sA(3) ; step to tape[3] -

    If an LsA(3) command existed, it would return the same value as - LsA(3), because mirroring does not change the correspondence between addresses and cells. For the same reason, LsA(0) would still be the leftmost cell of the right going machine. -

    +

    + LsA(k) and sA(k) cue the head to the same addressed cell. + The L prefix changes direction and the meaning of R, not the address to cell correspondence. + Thus LsA(0) cues the cell with address zero, which is rightmost in the mirror view and leftmost in the right going view. +

    Absolute head movement

    @@ -177,7 +174,7 @@ sR ; step to rightmost LsR ; step to leftmost (rightmost on the mirror machine) -

    Without code optimization sR will +

    Without code optimization LsR will be faster than its counterpart sA(0) because the latter form requires passing and processing an argument.

    @@ -188,8 +185,15 @@ qR ; head is on rightmost LqR ; head is on leftmost qA ; returns address of the head qAR ; returns address of rightmost +LqAR ; returns address of leftmost, zero +

    + qAR returns the address of the selected view rightmost cell. + Under L, that rightmost cell is the original leftmost cell, so LqAR returns zero. +

    + +

    Copying to and from the tape machine cells and python variables.

    -- 2.20.1