.
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Sun, 19 Jul 2026 16:30:59 +0000 (16:30 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Sun, 19 Jul 2026 16:30:59 +0000 (16:30 +0000)
document/book/TM-2026.html
document/book/TTCA_style_TM_reverse.png [new file with mode: 0644]
document/book/temp.c [new file with mode: 0644]

index 0229d69..c10d51e 100644 (file)
 
       <p>Here is the programmed controller for the TTCA string reverse. Because actions (<RT·math>λ</RT·math>) are bound to states rather than transitions, reading and stepping are distinct states, resulting in a strictly serialized execution.</p>
 
-<RT·code>
+      <RT·code>
       # TTCA String Reverse
       # input:  (σ ∈ Σ)* EOM (starting on the leftmost cell)
       # output: SP* EOM (σ ∈ Σ in reverse)* EOR
             Q·Done
       </RT·code>
 
+      <img src="TTCA_style_TM_reverse.png" class="rt-diagram" alt="HU reverse machine">
+
+      <RT·code>
+      void TTCA·reverse_string() {
+        // Phase 1: Scan right to EOM and initialize the EOR marker
+        read_g();
+        while(g != EOM){right(); read_g();}
+        right();
+        write_σ(EOR);
+
+        // Phases 2 through 5: The main shuttle cycle
+        while(true){
+
+          // Phase 2: Fetch next unprocessed character and check boundaries
+          left();
+          read_g();
+          while(g == EOM || g == SP){
+            status();
+            if(g == on_leftmost) return;
+            left();
+            read_g();
+          }
+
+          read_d();
+          status();
+
+          // Phase 6: Final character carry and clean halt
+          if(g == on_leftmost){
+            write_σ(SP);
+            right();
+            read_g();
+            while(g != EOR){right(); read_g();}
+            write_d();
+            right();
+            write_σ(EOR);
+            return;
+          }
+
+          // Phase 3 & 4: Mark location, carry opaque data, advance EOR
+          write_σ(SP);
+          right();
+          read_g();
+          while(g != EOR){right(); read_g();}
+          write_d();
+          right();
+          write_σ(EOR);
+
+          // Phase 5: Return left to EOM to begin the next fetch cycle
+          left();
+          read_g();
+          while(g != EOM){left(); read_g();}
+        }
+      }
+      </RT·code>
+
       <RT·chapter>The Turing Machine architecture/organization</RT·chapter>
 
 <p>
diff --git a/document/book/TTCA_style_TM_reverse.png b/document/book/TTCA_style_TM_reverse.png
new file mode 100644 (file)
index 0000000..825c2d3
Binary files /dev/null and b/document/book/TTCA_style_TM_reverse.png differ
diff --git a/document/book/temp.c b/document/book/temp.c
new file mode 100644 (file)
index 0000000..b3ef2a6
--- /dev/null
@@ -0,0 +1,50 @@
+void TTCA·reverse_string() {
+  // Phase 1: Scan right to EOM and initialize the EOR marker
+  read_g();
+  while(g != EOM){right(); read_g();}
+  right();
+  write_σ(EOR);
+
+  // Phases 2 through 5: The main shuttle cycle
+  while(true){
+
+    // Phase 2: Fetch next unprocessed character and check boundaries
+    left();
+    read_g();
+    while(g == EOM || g == SP){
+      status();
+      if(g == on_leftmost) return;
+      left();
+      read_g();
+    }
+        
+    read_d();
+    status();
+        
+    // Phase 6: Final character carry and clean halt
+    if(g == on_leftmost){
+      write_σ(SP);
+      right();
+      read_g();
+      while(g != EOR){right(); read_g();}
+      write_d();
+      right();
+      write_σ(EOR);
+      return;
+    }
+
+    // Phase 3 & 4: Mark location, carry opaque data, advance EOR
+    write_σ(SP);
+    right();
+    read_g();
+    while(g != EOR){right(); read_g();}
+    write_d();
+    right();
+    write_σ(EOR);
+
+    // Phase 5: Return left to EOM to begin the next fetch cycle
+    left();
+    read_g();
+    while(g != EOM){left(); read_g();}
+  }
+}