more _ND -> _NX and addition of a _F version for TM_SR_NX
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Sat, 25 Jan 2025 15:16:43 +0000 (15:16 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Sat, 25 Jan 2025 15:16:43 +0000 (15:16 +0000)
34 files changed:
developer/documentđź–‰/Step_Right_Machine.txt
developer/example/GraphIndexTree/Graph.java
developer/example/GraphIndexTree/TM_SR_ND_Child.java [deleted file]
developer/example/GraphIndexTree/TM_SR_ND_Diagonal.java [deleted file]
developer/example/GraphIndexTree/TM_SR_ND_Diagonal_CLI.java [deleted file]
developer/example/GraphIndexTree/TM_SR_ND_Diagonal_transcript.txt [deleted file]
developer/example/GraphIndexTree/TM_SR_NX_Child.java [new file with mode: 0644]
developer/example/GraphIndexTree/TM_SR_NX_Diagonal.java [new file with mode: 0644]
developer/example/GraphIndexTree/TM_SR_NX_Diagonal_CLI.java [new file with mode: 0644]
developer/example/GraphIndexTree/TM_SR_NX_Diagonal_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_Array_CLI.java [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_Array_transcript.txt [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_List_CLI.java [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_List_transcript.txt [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_Print_CLI.java [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_Print_transcript.txt [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_Set_CLI.java [deleted file]
developer/example/TM_SR_ND/TM_SR_NX_Array_CLI.java [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_NX_Array_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_NX_List_CLI.java [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_NX_List_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_NX_Print_CLI.java [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_NX_Print_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_NX_Set_CLI.java [new file with mode: 0644]
developer/javacđź–‰/Ariadne_ContextPath_FD.java
developer/javacđź–‰/Ariadne_Graph.java
developer/javacđź–‰/Ariadne_SiblingContext.java [deleted file]
developer/javacđź–‰/Ariadne_SiblingContext_FD.java [deleted file]
developer/javacđź–‰/Ariadne_SiblingContext_NX.java [deleted file]
developer/javacđź–‰/Ariadne_TM_SR_NX.java
developer/javacđź–‰/Ariadne_TM_SR_NX_Array.java
developer/javacđź–‰/Ariadne_TM_SR_NX_F.java [new file with mode: 0644]
developer/javacđź–‰/Ariadne_TM_SR_NX_List.java
documentđź–‰/todo.txt

index a6b64c4..e9e2292 100644 (file)
@@ -1,4 +1,7 @@
-Tape
+
+See TTCA book for more details about the model. There also exists a reference implementation used as a Lisp iteration library.
+
+Tape 
 
   A 'tape' is a one dimensional discrete space.  Being a discrete space, rather than having points, it has 'cells'.
 
@@ -42,45 +45,55 @@ Singly Linked Tape
   
   A machine with a singly linked tape mounted, can not compute some things that a Turing Machine can, yet, it is a common data structure used in computing. It can be used with forward, irreversible, advance of a program. This is the most common kind actually. If local reversibility is needed, a cache or window can be used for recent values.  The depth of this local memory is an interesting metric.  For macro level reversibility, a system can use checkpoints.
 
----
 
-The Step Right Tape Machine
+  Tape Topology
+
+    A tape is a one-dimensional discrete space consisting of "cells." These cells represent the fundamental units of memory that a machine can read from or write to. The set of all cells defines the tape topology, which determines the connectivity and traversal characteristics of the tape.
+
+    Key Characteristics of Tape Topologies
+    1. Stepping Determines Topology:
+       - A machine begins at the leftmost cell when the tape is mounted. Stepping right from this cell reveals the connectivity of the tape. This process is analogous to "shrinking the circle" in topology, where stepping serves as an operation to explore and classify the tape's structure.
+
+    2. Single-ended Constraint:
+       - A tape is always single-ended because there is no cell to the left of the leftmost cell. This rules out two-way infinite tapes, as there is no way to step left.
+
+    3. Unbroken Connectivity:
+       - The tape is either unbounded (infinite), cyclic (all cells connect into a single cycle), or finite (with distinct leftmost and rightmost boundaries). If stepping reaches a cell that is not connected to any other cell, that cell is the rightmost cell of a finite tape segment.
+
+    Defined Topologies
+   
+    State     can_read can_step        Notes
+    Null       false   false   No cells exist; the machine cannot perform any operation.
+    Cyclic     true    true    Stepping visits same sequence of cells repeatedly.
+    Segment    true    true    Sequence leading to, but not including, a rightmost cell
+    Rightmost  true    false   A single cell that can not be stepped right from.
+    Infinite   true    true    Can always step to a cell not yet visited.
+
 
-  This is a conventional iterator for traversing through containers. The items visited
-  during the traversal are as though values in cells on a single linked tape.
+Tape Machine
 
+  The structure of a tape machine is fixed. It consists of a tape transport for holding and stepping the tape, and a read write head. 
 
----------------------------------------
+  A tape is 'mounted' on a tape machine.  The tape consists of a series of cells for holding
+  data. The machine writes or reads one cell at a time, the cell that 'the head is over'.  Thus, the data on the tape is variable, and for some specialized application could even be  non-determinstic. Even in the case non-deterministic data, the machine structure remains
+  fixed.
 
-Tape Topology
+  A tape machine provides five operations:
 
-A tape is a one-dimensional discrete space consisting of "cells." These cells represent the fundamental units of memory that a machine can read from or write to. The set of all cells defines the tape topology, which determines the connectivity and traversal characteristics of the tape.
+    write: Writes a value in the tape cell under the head.
 
-Key Characteristics of Tape Topologies
-1. Stepping Determines Topology:
-   - A machine begins at the leftmost cell when the tape is mounted. Stepping right from this cell reveals the connectivity of the tape. This process is analogous to "shrinking the circle" in topology, where stepping serves as an operation to explore and classify the tape's structure.
+    read: Reads a value in the tape cell under the head.
 
-2. Single-ended Constraint:
-   - A tape is always single-ended because there is no cell to the left of the leftmost cell. This rules out two-way infinite tapes, as there is no way to step left.
+    can_read: True iff a non-empty tape is mounted.
 
-3. Unbroken Connectivity:
-   - The tape is either unbounded (infinite), cyclic (all cells connect into a single cycle), or finite (with distinct leftmost and rightmost boundaries). If stepping reaches a cell that is not connected to any other cell, that cell is the rightmost cell of a finite tape segment.
+    step: Conceptually moves the head right to the neighbor cell on the tape, though in real tape machines it is the tape that moves. In our examples here, we only support stepping to the right.
 
-Defined Topologies
+    can_step: Tells if the tape can be stepped to the right without running off the end of the tape.
 
-State  can_read()      can_step()      Notes
-Null   false   false   No cells exist; the machine cannot perform any operation.
-Cyclic true    true    The machine loops indefinitely, can always read and step.
-Segment        true    true (until rightmost)  Represents a bounded tape; steps until reaching the rightmost cell.
-Infinite Right true    true    Unbounded cells extend infinitely; can always read and step.
-Rightmost      true    false   At the last cell of a finite segment (or singleton tape).
+    step_left: not supported by the Ariadne_TM_SR machines (hence the _SR, which means 'Step Right'.)
 
----
-🥳 Cheers to:
+    can_step_left: not supported, but for machines that doe support it, tells if the tape
+    can be stepped left.
 
-A precise loop that doesn’t compromise readability or efficiency.
-An elegant state pattern that aligns with the real-world model.
-The beauty of RT code format guiding clarity and consistency!
 
 
-Callisto
index d2f4cfb..67c887e 100644 (file)
@@ -1,10 +1,11 @@
 import com.ReasoningTechnology.Ariadne.Ariadne_Label;
 import com.ReasoningTechnology.Ariadne.Ariadne_Node;
-import com.ReasoningTechnology.Ariadne.Ariadne_Graph;
+import com.ReasoningTechnology.Ariadne.Ariadne_Graph_FD;
 
-public class Graph extends Ariadne_Graph<Label ,Node>{
+public class Graph extends Ariadne_Graph_FD<Label ,Node>{
 
-  public static <T extends Ariadne_Label, N extends Ariadne_Node<T>> Graph make(){
+  @SuppressWarnings("unchecked")
+  public static Graph make(){
     return new Graph();
   }
 
diff --git a/developer/example/GraphIndexTree/TM_SR_ND_Child.java b/developer/example/GraphIndexTree/TM_SR_ND_Child.java
deleted file mode 100644 (file)
index 0dc9af9..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-TM_SR_NX_Child represents in the abstract the infinite child list of an
-IndexTree node.  Index tree node labels are paths through the tree, so
-labels can be computed.
-
-TM_SR_NX_Child is made from the leftmost child label. Then step() takes
-the current label and computes from it the right neighbor sibling
-node's label.
-
-*/
-
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
-
-public class TM_SR_NX_Child extends Ariadne_TM_SR_NX<Label>{
-
-  // Static
-  //
-  public static TM_SR_NX_Child make(Label leftmost_child_label){
-    return new TM_SR_NX_Child(leftmost_child_label);
-  }
-
-  // Instance data
-  //
-  private final Label label;
-
-  // Constructor(s)
-  //
-  protected TM_SR_NX_Child(Label leftmost_child_label){
-    this.label = leftmost_child_label != null ? leftmost_child_label.copy() : null;
-
-    if(label == null){
-      set_topology(topo_null);
-      return;
-    }
-    if(label.length() == 0){
-      set_topology(topo_rightmost);
-      return;
-    }
-    set_topology(topo_infinite_right);
-  }
-
-  // Implementation of the instance interface
-  //
-
-  private class InfiniteRightTopo implements TopoIface<Label>{
-    @Override public boolean can_read(){
-      return true;
-    }
-    @Override public Label read(){
-      return label;
-    }
-    @Override public boolean can_step(){
-      return true;
-    }
-    @Override public void step(){
-      label.inc_across();
-    }
-    @Override public Topology topology(){
-      return Topology.INFINITE;
-    }
-  }
-  private final TopoIface<Label> topo_infinite_right = new InfiniteRightTopo();
-
-  private class RightmostTopo implements TopoIface<Label>{
-    @Override public boolean can_read(){
-      return true;
-    }
-    @Override public Label read(){
-      return label;
-    }
-    @Override public boolean can_step(){
-      return false;
-    }
-    @Override public void step(){
-      throw new UnsupportedOperationException("Cannot step from RIGHTMOST topology.");
-    }
-    @Override public Topology topology(){
-      return Topology.RIGHTMOST;
-    }
-  }
-  private final TopoIface<Label> topo_rightmost = new RightmostTopo();
-}
-
diff --git a/developer/example/GraphIndexTree/TM_SR_ND_Diagonal.java b/developer/example/GraphIndexTree/TM_SR_ND_Diagonal.java
deleted file mode 100644 (file)
index 4754db2..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-Diagonal traversal is guaranteed to reach any given node in the IndexTree
-in a finite number of steps. Neither depth first, nor breadth first
-can do this. This guarantee also applies to a pruned IndexTree.
-
-This implementation is nearly ready, to be included in the Ariadne
-library for generalized diagonal traversal. I have abstracted out all
-references to the IndexTree. It still needs to remove child lists that
-have been completely reversed from the child_tm_list.  This was not
-needed for the IndexTree because it is infinite, so they will never be
-completely traversed. Also needed, is to stop when a node does not
-have a child list. Again, this is not needed here because the
-IndexTree has infinite depth.  When the generalized diagonal iterator
-is ready, it could be used in place of this one.
-
-*/
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.ReasoningTechnology.Ariadne.Ariadne_Test;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_List;
-
-public class TM_SR_NX_Diagonal extends Ariadne_TM_SR_NX<List<Label>> {
-
-  // Static
-  //
-
-  public static TM_SR_NX_Diagonal make(Label start_node) {
-    return new TM_SR_NX_Diagonal(start_node);
-  }
-
-  // Instance data
-  //
-
-  private List<Label> diagonal = new ArrayList<>();
-  private final List<TM_SR_NX_Child> child_srtm_list = new ArrayList<>();
-
-  // Constructor(s)
-  //
-
-  protected TM_SR_NX_Diagonal(Label start_node) {
-    if (start_node == null) {
-      set_topology(topo_null);
-      return;
-    }
-    set_topology(topo_infinite_right);
-    diagonal.add(start_node);
-  }
-
-  // Instance interface implementation
-  //
-
-  @Override
-  public List<Label> read() {
-    return diagonal;
-  }
-
-  private class TopoInfiniteRight implements TopoIface<List<Label>> {
-      @Override public boolean can_read(){
-        return true;
-      }
-      @Override public List<Label> read(){
-        return diagonal;
-      }
-      @Override public boolean can_step(){
-        return true;
-      }
-
-    @Override public void step(){
-
-      List<Label> diagonal_1 = new ArrayList<>();
-
-      // inc_down from each node on diagonal_0 -> entry on child_srtm list
-      Ariadne_TM_SR_NX_List<Label> diagonal_srtm = Ariadne_TM_SR_NX_List.make(diagonal);
-      if( diagonal_srtm.can_read() ){
-        do{
-          Node node = Node.make(diagonal_srtm.read());
-          child_srtm_list.add(node.neighbor()); // graph node neighbor == tree node child
-          if( !diagonal_srtm.can_step() ) break;
-          diagonal_srtm.step();
-        }while(true);
-      }
-
-      // add to diagonal_1 from each on entry on the child_srtm list
-      Ariadne_TM_SR_NX_List<TM_SR_NX_Child> child_srtm_srtm = Ariadne_TM_SR_NX_List.make(child_srtm_list);
-      if( child_srtm_srtm.can_read() ){
-        do{
-          TM_SR_NX_Child child_srtm = child_srtm_srtm.read();
-          Label label = child_srtm.read();
-          diagonal_1.add(label.copy());
-          child_srtm.step();
-          if( !child_srtm_srtm.can_step() ) break;
-          child_srtm_srtm.step();
-        }while(true);
-      }
-
-      // Update the state for the next step
-      diagonal = diagonal_1;
-    }
-
-    @Override public Topology topology() {
-      return Topology.INFINITE;
-    }
-  }
-  private final TopoIface<List<Label>> topo_infinite_right = new TopoInfiniteRight();
-
-  // good citizen
-  //
-  
-  @Override public String toString() {
-    StringBuilder formatted = new StringBuilder("TM_SR_NX_Diagonal(");
-    Ariadne_TM_SR_NX_List<Label> diagonal_srtm = Ariadne_TM_SR_NX_List.make(diagonal);
-
-    if (diagonal_srtm.can_read()) {
-      do {
-        formatted.append(diagonal_srtm.read());
-        if (!diagonal_srtm.can_step()) break;
-        diagonal_srtm.step();
-        formatted.append(" ,");
-      } while (true);
-    }
-
-    formatted.append(")");
-    return formatted.toString();
-  }
-
-}
diff --git a/developer/example/GraphIndexTree/TM_SR_ND_Diagonal_CLI.java b/developer/example/GraphIndexTree/TM_SR_ND_Diagonal_CLI.java
deleted file mode 100644 (file)
index a120ff3..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-import java.util.List;
-
-public class TM_SR_NX_Diagonal_CLI{
-
-  public static void main(String[] args){
-    System.out.println("Starting IndexTree TM_SR_NX Example");
-
-    // Instantiate the IndexTree Diagonal TM_SR_NX
-    Graph g = Graph.make();
-    TM_SR_NX_Child start_srtm = g.start();
-    if( !start_srtm.can_read() ){
-      System.out.println("Graph provides no start nodes. Thought you might want to know.");
-      return;
-    }
-
-    do{
-      Label start_label = start_srtm.read();
-      System.out.println("Graph diagonalization starting from: " + start_label);
-      TM_SR_NX_Diagonal srtm = TM_SR_NX_Diagonal.make(start_label);
-      int step_count = 0;
-      if( srtm.can_read() ){
-        do{
-          System.out.println(step_count + ": " + srtm.read());
-          if( !srtm.can_step() ) break;
-          if( step_count == 4 ) break; // Stop after 5 diagonals
-          step_count++;
-          srtm.step();
-        }while(true);
-      }
-      if( !start_srtm.can_step() ) break;
-      System.out.println();
-      start_srtm.step();
-    }while(true);
-      
-  }
-
-}
-
diff --git a/developer/example/GraphIndexTree/TM_SR_ND_Diagonal_transcript.txt b/developer/example/GraphIndexTree/TM_SR_ND_Diagonal_transcript.txt
deleted file mode 100644 (file)
index 2bbd4c4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Starting IndexTree SRTM Example
-Graph diagonalization starting from: Label([])
-0: [Label([])]
-1: [Label([0])]
-2: [Label([1]), Label([0 ,0])]
-3: [Label([2]), Label([0 ,1]), Label([1 ,0]), Label([0 ,0 ,0])]
-4: [Label([3]), Label([0 ,2]), Label([1 ,1]), Label([0 ,0 ,1]), Label([2 ,0]), Label([0 ,1 ,0]), Label([1 ,0 ,0]), Label([0 ,0 ,0 ,0])]
diff --git a/developer/example/GraphIndexTree/TM_SR_NX_Child.java b/developer/example/GraphIndexTree/TM_SR_NX_Child.java
new file mode 100644 (file)
index 0000000..0dc9af9
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+TM_SR_NX_Child represents in the abstract the infinite child list of an
+IndexTree node.  Index tree node labels are paths through the tree, so
+labels can be computed.
+
+TM_SR_NX_Child is made from the leftmost child label. Then step() takes
+the current label and computes from it the right neighbor sibling
+node's label.
+
+*/
+
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
+
+public class TM_SR_NX_Child extends Ariadne_TM_SR_NX<Label>{
+
+  // Static
+  //
+  public static TM_SR_NX_Child make(Label leftmost_child_label){
+    return new TM_SR_NX_Child(leftmost_child_label);
+  }
+
+  // Instance data
+  //
+  private final Label label;
+
+  // Constructor(s)
+  //
+  protected TM_SR_NX_Child(Label leftmost_child_label){
+    this.label = leftmost_child_label != null ? leftmost_child_label.copy() : null;
+
+    if(label == null){
+      set_topology(topo_null);
+      return;
+    }
+    if(label.length() == 0){
+      set_topology(topo_rightmost);
+      return;
+    }
+    set_topology(topo_infinite_right);
+  }
+
+  // Implementation of the instance interface
+  //
+
+  private class InfiniteRightTopo implements TopoIface<Label>{
+    @Override public boolean can_read(){
+      return true;
+    }
+    @Override public Label read(){
+      return label;
+    }
+    @Override public boolean can_step(){
+      return true;
+    }
+    @Override public void step(){
+      label.inc_across();
+    }
+    @Override public Topology topology(){
+      return Topology.INFINITE;
+    }
+  }
+  private final TopoIface<Label> topo_infinite_right = new InfiniteRightTopo();
+
+  private class RightmostTopo implements TopoIface<Label>{
+    @Override public boolean can_read(){
+      return true;
+    }
+    @Override public Label read(){
+      return label;
+    }
+    @Override public boolean can_step(){
+      return false;
+    }
+    @Override public void step(){
+      throw new UnsupportedOperationException("Cannot step from RIGHTMOST topology.");
+    }
+    @Override public Topology topology(){
+      return Topology.RIGHTMOST;
+    }
+  }
+  private final TopoIface<Label> topo_rightmost = new RightmostTopo();
+}
+
diff --git a/developer/example/GraphIndexTree/TM_SR_NX_Diagonal.java b/developer/example/GraphIndexTree/TM_SR_NX_Diagonal.java
new file mode 100644 (file)
index 0000000..4754db2
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+Diagonal traversal is guaranteed to reach any given node in the IndexTree
+in a finite number of steps. Neither depth first, nor breadth first
+can do this. This guarantee also applies to a pruned IndexTree.
+
+This implementation is nearly ready, to be included in the Ariadne
+library for generalized diagonal traversal. I have abstracted out all
+references to the IndexTree. It still needs to remove child lists that
+have been completely reversed from the child_tm_list.  This was not
+needed for the IndexTree because it is infinite, so they will never be
+completely traversed. Also needed, is to stop when a node does not
+have a child list. Again, this is not needed here because the
+IndexTree has infinite depth.  When the generalized diagonal iterator
+is ready, it could be used in place of this one.
+
+*/
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.ReasoningTechnology.Ariadne.Ariadne_Test;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_List;
+
+public class TM_SR_NX_Diagonal extends Ariadne_TM_SR_NX<List<Label>> {
+
+  // Static
+  //
+
+  public static TM_SR_NX_Diagonal make(Label start_node) {
+    return new TM_SR_NX_Diagonal(start_node);
+  }
+
+  // Instance data
+  //
+
+  private List<Label> diagonal = new ArrayList<>();
+  private final List<TM_SR_NX_Child> child_srtm_list = new ArrayList<>();
+
+  // Constructor(s)
+  //
+
+  protected TM_SR_NX_Diagonal(Label start_node) {
+    if (start_node == null) {
+      set_topology(topo_null);
+      return;
+    }
+    set_topology(topo_infinite_right);
+    diagonal.add(start_node);
+  }
+
+  // Instance interface implementation
+  //
+
+  @Override
+  public List<Label> read() {
+    return diagonal;
+  }
+
+  private class TopoInfiniteRight implements TopoIface<List<Label>> {
+      @Override public boolean can_read(){
+        return true;
+      }
+      @Override public List<Label> read(){
+        return diagonal;
+      }
+      @Override public boolean can_step(){
+        return true;
+      }
+
+    @Override public void step(){
+
+      List<Label> diagonal_1 = new ArrayList<>();
+
+      // inc_down from each node on diagonal_0 -> entry on child_srtm list
+      Ariadne_TM_SR_NX_List<Label> diagonal_srtm = Ariadne_TM_SR_NX_List.make(diagonal);
+      if( diagonal_srtm.can_read() ){
+        do{
+          Node node = Node.make(diagonal_srtm.read());
+          child_srtm_list.add(node.neighbor()); // graph node neighbor == tree node child
+          if( !diagonal_srtm.can_step() ) break;
+          diagonal_srtm.step();
+        }while(true);
+      }
+
+      // add to diagonal_1 from each on entry on the child_srtm list
+      Ariadne_TM_SR_NX_List<TM_SR_NX_Child> child_srtm_srtm = Ariadne_TM_SR_NX_List.make(child_srtm_list);
+      if( child_srtm_srtm.can_read() ){
+        do{
+          TM_SR_NX_Child child_srtm = child_srtm_srtm.read();
+          Label label = child_srtm.read();
+          diagonal_1.add(label.copy());
+          child_srtm.step();
+          if( !child_srtm_srtm.can_step() ) break;
+          child_srtm_srtm.step();
+        }while(true);
+      }
+
+      // Update the state for the next step
+      diagonal = diagonal_1;
+    }
+
+    @Override public Topology topology() {
+      return Topology.INFINITE;
+    }
+  }
+  private final TopoIface<List<Label>> topo_infinite_right = new TopoInfiniteRight();
+
+  // good citizen
+  //
+  
+  @Override public String toString() {
+    StringBuilder formatted = new StringBuilder("TM_SR_NX_Diagonal(");
+    Ariadne_TM_SR_NX_List<Label> diagonal_srtm = Ariadne_TM_SR_NX_List.make(diagonal);
+
+    if (diagonal_srtm.can_read()) {
+      do {
+        formatted.append(diagonal_srtm.read());
+        if (!diagonal_srtm.can_step()) break;
+        diagonal_srtm.step();
+        formatted.append(" ,");
+      } while (true);
+    }
+
+    formatted.append(")");
+    return formatted.toString();
+  }
+
+}
diff --git a/developer/example/GraphIndexTree/TM_SR_NX_Diagonal_CLI.java b/developer/example/GraphIndexTree/TM_SR_NX_Diagonal_CLI.java
new file mode 100644 (file)
index 0000000..a120ff3
--- /dev/null
@@ -0,0 +1,38 @@
+import java.util.List;
+
+public class TM_SR_NX_Diagonal_CLI{
+
+  public static void main(String[] args){
+    System.out.println("Starting IndexTree TM_SR_NX Example");
+
+    // Instantiate the IndexTree Diagonal TM_SR_NX
+    Graph g = Graph.make();
+    TM_SR_NX_Child start_srtm = g.start();
+    if( !start_srtm.can_read() ){
+      System.out.println("Graph provides no start nodes. Thought you might want to know.");
+      return;
+    }
+
+    do{
+      Label start_label = start_srtm.read();
+      System.out.println("Graph diagonalization starting from: " + start_label);
+      TM_SR_NX_Diagonal srtm = TM_SR_NX_Diagonal.make(start_label);
+      int step_count = 0;
+      if( srtm.can_read() ){
+        do{
+          System.out.println(step_count + ": " + srtm.read());
+          if( !srtm.can_step() ) break;
+          if( step_count == 4 ) break; // Stop after 5 diagonals
+          step_count++;
+          srtm.step();
+        }while(true);
+      }
+      if( !start_srtm.can_step() ) break;
+      System.out.println();
+      start_srtm.step();
+    }while(true);
+      
+  }
+
+}
+
diff --git a/developer/example/GraphIndexTree/TM_SR_NX_Diagonal_transcript.txt b/developer/example/GraphIndexTree/TM_SR_NX_Diagonal_transcript.txt
new file mode 100644 (file)
index 0000000..2bbd4c4
--- /dev/null
@@ -0,0 +1,7 @@
+Starting IndexTree SRTM Example
+Graph diagonalization starting from: Label([])
+0: [Label([])]
+1: [Label([0])]
+2: [Label([1]), Label([0 ,0])]
+3: [Label([2]), Label([0 ,1]), Label([1 ,0]), Label([0 ,0 ,0])]
+4: [Label([3]), Label([0 ,2]), Label([1 ,1]), Label([0 ,0 ,1]), Label([2 ,0]), Label([0 ,1 ,0]), Label([1 ,0 ,0]), Label([0 ,0 ,0 ,0])]
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Array_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_Array_CLI.java
deleted file mode 100644 (file)
index 63a5d5b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_Array;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class TM_SR_NX_Array_CLI {
-  public static void main( String[] args ){
-    // Create an Array
-    List<String> label_array = Arrays.asList( "A", "B", "C", "D" );
-
-    // Attach TM_SR_NX to the array
-    Ariadne_TM_SR_NX_Array<String> srm = Ariadne_TM_SR_NX_Array.make(label_array);
-    if( srm.can_read() ){
-      do{
-        System.out.println( "Reading: " + srm.read() );  
-        System.out.println( "Topology: " + srm.topology() );
-        if( !srm.can_step() ) break;
-        srm.step();
-      }while(true);
-    }
-  }
-}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Array_transcript.txt b/developer/example/TM_SR_ND/TM_SR_ND_Array_transcript.txt
deleted file mode 100644 (file)
index 4a1e3c1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Reading: A
-Topology: SEGMENT
-Reading: B
-Topology: SEGMENT
-Reading: C
-Topology: SEGMENT
-Reading: D
-Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_List_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_List_CLI.java
deleted file mode 100644 (file)
index 1fcdcda..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-import java.util.LinkedList;
-
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_List;
-
-public class TM_SR_NX_List_CLI {
-  public static void main( String[] args ){
-    // Create a linked list
-    LinkedList<String> label_list = new LinkedList<>();
-    label_list.add( "A" );
-    label_list.add( "B" );
-    label_list.add( "C" );
-
-    // Attach TM_SR_NX to the linked list and traverse
-    Ariadne_TM_SR_NX_List<String> srm = Ariadne_TM_SR_NX_List.make(label_list);
-    if( srm.can_read() ){
-      do{
-        System.out.println( "Reading: " + srm.read() );  
-        System.out.println( "Topology: " + srm.topology() );
-        if( !srm.can_step() ) break;
-        srm.step();
-      }while(true);
-    }
-  }
-}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_List_transcript.txt b/developer/example/TM_SR_ND/TM_SR_ND_List_transcript.txt
deleted file mode 100644 (file)
index 43b78f7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading: A
-Topology: SEGMENT
-Reading: B
-Topology: SEGMENT
-Reading: C
-Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Print_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_Print_CLI.java
deleted file mode 100644 (file)
index d9eda1e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Example of the TM_SR_NX's toString function.
-
-*/
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_List;
-
-public class TM_SR_NX_Print_CLI{
-
-  public static void main(String[] args){
-    List<Object> data = Arrays.asList(42 ,null ,"" ,"World" ,1000);
-    Ariadne_TM_SR_NX tm = Ariadne_TM_SR_NX_List.make(data);
-    System.out.println( tm.toString() );
-    tm.step();
-    System.out.println( tm.to_string_annotated() );
-    tm.step();
-    System.out.println( tm.to_string_annotated() );
-    tm.step();
-    System.out.println( tm.to_string_annotated() );
-    tm.step();
-    System.out.println( tm.to_string_annotated() );
-  }
-}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Print_transcript.txt b/developer/example/TM_SR_ND/TM_SR_ND_Print_transcript.txt
deleted file mode 100644 (file)
index e1c7c4c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-42 ,, ,World ,1000
-
-TM_SR_ND(SEGMENT( 42        World  1000  )
-                 |dd|<->|e||ddddd||dddd|  
-
-TM_SR_ND(SEGMENT( 42        World  1000  )
-                 |dd||-|<e>|ddddd||dddd|  
-
-TM_SR_ND(SEGMENT( 42        World  1000  )
-                 |dd||-||e|<ddddd>|dddd|  
-
-TM_SR_ND(RIGHTMOST( 42        World  1000  )
-                   |dd||-||e||ddddd|<dddd>  
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Set_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_Set_CLI.java
deleted file mode 100644 (file)
index 6726210..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_Set;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class TM_SR_NX_Set_CLI {
-  public static void main( String[] args ){
-    // Create a Set
-    Set<String> label_set = new HashSet<>();
-    label_set.add("A");
-    label_set.add("B");
-    label_set.add("C");
-
-    // Attach TM_SR_NX to the set and traverse
-    Ariadne_TM_SR_NX_Set<String> srm = Ariadne_TM_SR_NX_Set.make(label_set);
-    if( srm.can_read() ){
-      do{
-        System.out.println( "Reading: " + srm.read() );
-        System.out.println( "Topology: " + srm.topology() );
-        if( !srm.can_step() ) break;
-        srm.step();
-      }while(true);
-    }
-  }
-}
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_Array_CLI.java b/developer/example/TM_SR_ND/TM_SR_NX_Array_CLI.java
new file mode 100644 (file)
index 0000000..63a5d5b
--- /dev/null
@@ -0,0 +1,23 @@
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_Array;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class TM_SR_NX_Array_CLI {
+  public static void main( String[] args ){
+    // Create an Array
+    List<String> label_array = Arrays.asList( "A", "B", "C", "D" );
+
+    // Attach TM_SR_NX to the array
+    Ariadne_TM_SR_NX_Array<String> srm = Ariadne_TM_SR_NX_Array.make(label_array);
+    if( srm.can_read() ){
+      do{
+        System.out.println( "Reading: " + srm.read() );  
+        System.out.println( "Topology: " + srm.topology() );
+        if( !srm.can_step() ) break;
+        srm.step();
+      }while(true);
+    }
+  }
+}
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_Array_transcript.txt b/developer/example/TM_SR_ND/TM_SR_NX_Array_transcript.txt
new file mode 100644 (file)
index 0000000..4a1e3c1
--- /dev/null
@@ -0,0 +1,8 @@
+Reading: A
+Topology: SEGMENT
+Reading: B
+Topology: SEGMENT
+Reading: C
+Topology: SEGMENT
+Reading: D
+Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_List_CLI.java b/developer/example/TM_SR_ND/TM_SR_NX_List_CLI.java
new file mode 100644 (file)
index 0000000..1fcdcda
--- /dev/null
@@ -0,0 +1,25 @@
+import java.util.LinkedList;
+
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_List;
+
+public class TM_SR_NX_List_CLI {
+  public static void main( String[] args ){
+    // Create a linked list
+    LinkedList<String> label_list = new LinkedList<>();
+    label_list.add( "A" );
+    label_list.add( "B" );
+    label_list.add( "C" );
+
+    // Attach TM_SR_NX to the linked list and traverse
+    Ariadne_TM_SR_NX_List<String> srm = Ariadne_TM_SR_NX_List.make(label_list);
+    if( srm.can_read() ){
+      do{
+        System.out.println( "Reading: " + srm.read() );  
+        System.out.println( "Topology: " + srm.topology() );
+        if( !srm.can_step() ) break;
+        srm.step();
+      }while(true);
+    }
+  }
+}
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_List_transcript.txt b/developer/example/TM_SR_ND/TM_SR_NX_List_transcript.txt
new file mode 100644 (file)
index 0000000..43b78f7
--- /dev/null
@@ -0,0 +1,6 @@
+Reading: A
+Topology: SEGMENT
+Reading: B
+Topology: SEGMENT
+Reading: C
+Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_Print_CLI.java b/developer/example/TM_SR_ND/TM_SR_NX_Print_CLI.java
new file mode 100644 (file)
index 0000000..282e910
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+Example of the TM_SR_NX's toString function.
+
+*/
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_F;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_List;
+
+public class TM_SR_NX_Print_CLI{
+
+  public static void main(String[] args){
+    List<Object> data = Arrays.asList(42 ,null ,"" ,"World" ,1000);
+    Ariadne_TM_SR_NX_F tm = Ariadne_TM_SR_NX_List.make(data);
+    System.out.println();
+    System.out.print( tm.toString() );
+    System.out.println( tm.to_string_annotated() );
+    tm.step();
+    System.out.println();
+    System.out.print( tm.toString() );
+    System.out.println( tm.to_string_annotated() );
+    tm.step();
+    System.out.println();
+    System.out.print( tm.toString() );
+    System.out.println( tm.to_string_annotated() );
+    tm.step();
+    System.out.println();
+    System.out.print( tm.toString() );
+    System.out.println( tm.to_string_annotated() );
+    tm.step();
+    System.out.println();
+    System.out.print( tm.toString() );
+    System.out.println( tm.to_string_annotated() );
+  }
+}
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_Print_transcript.txt b/developer/example/TM_SR_ND/TM_SR_NX_Print_transcript.txt
new file mode 100644 (file)
index 0000000..32a450e
--- /dev/null
@@ -0,0 +1,20 @@
+
+<42> ,, ,World ,1000
+TM_SR_NX(SEGMENT( 42        World  1000  )
+                 <dd>|-||e||ddddd||dddd|  
+
+42 ,<>, ,World ,1000
+TM_SR_NX(SEGMENT( 42        World  1000  )
+                 |dd|<->|e||ddddd||dddd|  
+
+42 ,,<> ,World ,1000
+TM_SR_NX(SEGMENT( 42        World  1000  )
+                 |dd||-|<e>|ddddd||dddd|  
+
+42 ,, ,<World> ,1000
+TM_SR_NX(SEGMENT( 42        World  1000  )
+                 |dd||-||e|<ddddd>|dddd|  
+
+42 ,, ,World ,<1000>
+TM_SR_NX(RIGHTMOST( 42        World  1000  )
+                   |dd||-||e||ddddd|<dddd>  
diff --git a/developer/example/TM_SR_ND/TM_SR_NX_Set_CLI.java b/developer/example/TM_SR_ND/TM_SR_NX_Set_CLI.java
new file mode 100644 (file)
index 0000000..6726210
--- /dev/null
@@ -0,0 +1,25 @@
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_NX_Set;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class TM_SR_NX_Set_CLI {
+  public static void main( String[] args ){
+    // Create a Set
+    Set<String> label_set = new HashSet<>();
+    label_set.add("A");
+    label_set.add("B");
+    label_set.add("C");
+
+    // Attach TM_SR_NX to the set and traverse
+    Ariadne_TM_SR_NX_Set<String> srm = Ariadne_TM_SR_NX_Set.make(label_set);
+    if( srm.can_read() ){
+      do{
+        System.out.println( "Reading: " + srm.read() );
+        System.out.println( "Topology: " + srm.topology() );
+        if( !srm.can_step() ) break;
+        srm.step();
+      }while(true);
+    }
+  }
+}
index c0fac46..215072e 100644 (file)
@@ -4,31 +4,57 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 
+// SiblingContext a tm of graph node labels, that are siblings to a path node, in a tree search
 // LT == Label Type
-public class Ariadne_ContextPath_FD< Ariadne_TM_SR_NX<LT> >{
+public class Ariadne_ContextPath_FD
+  <
+    SiblingContext extends Ariadne_TM_SR_NX<LT> 
+    ,LT extends Ariadne_Label
+    >
+{
 
   //----------------------------------------
-  // static
+  // Static
+
+  public static
+    <
+     SiblingContext extends Ariadne_TM_SR_NX<LT> 
+     ,LT extends Ariadne_Label
+     >
+    Ariadne_ContextPath_FD<SiblingContext ,LT> 
+    make()
+  {
+    return new Ariadne_ContextPath_FD<>();
+  }
+
+  public static
+    <
+     SiblingContext extends Ariadne_TM_SR_NX<LT> 
+     ,LT extends Ariadne_Label
+     >
+    Ariadne_ContextPath_FD<SiblingContext ,LT> 
+    make(Ariadne_ContextPath_FD<SiblingContext ,LT> other)
+ {
+    return new Ariadne_ContextPath_FD<>();
+  }
 
-  ... make ...
 
   //----------------------------------------
   // Instance data
 
-  private final List< Ariadne_TM_SR_NX<LT> > context_path_list;
+  private final List<SiblingContext> context_path_list;
   private final HashSet<LT> path_member_set;
-  private Ariand_Label cycle_node_label;;
+  private LT cycle_node_label;
 
   //----------------------------------------
   // Constructors
-  //
 
-  public Ariadne_ContextPath(){
+  public Ariadne_ContextPath_FD(){
     this.context_path_list = new ArrayList<>();
-    this.path_member_set = new HashSet<>(); 
+    this.path_member_set = new HashSet<>();
   }
 
-  public Ariadne_ContextPath(Ariadne_ContextPath<LT> other){
+  public Ariadne_ContextPath_FD(Ariadne_ContextPath_FD<SiblingContext ,LT> other){
     this.context_path_list = new ArrayList<>( other.context_path_list );
     this.path_member_set = new HashSet<>( other.path_member_set );
   }
@@ -39,21 +65,21 @@ public class Ariadne_ContextPath_FD< Ariadne_TM_SR_NX<LT> >{
   /**
    * Adds a traversal state to the context path.
    *
-   * @param tm The traversal state to add.
+   * @param sibling_context The traversal state to add.
    * @return true if successfully added, false if it introduces a cycle.
    */
-  public boolean push(Ariadne_TM_SR_NX<LT> tm){
-    if( tm == null || !tm.can_read() ){
+  public boolean push(SiblingContext sibling_context){
+    if( sibling_context == null || !sibling_context.can_read() ){
       return false;
     }
 
-    LT label = tm.read();
+    LT label = sibling_context.read();
     if( path_member_set.contains(label) ){
       cycle_node_label = label;
       return false; // Cycle detected
     }
 
-    context_path_list.add(tm);
+    context_path_list.add( sibling_context );
     path_member_set.add(label);
     return true;
   }
@@ -63,12 +89,12 @@ public class Ariadne_ContextPath_FD< Ariadne_TM_SR_NX<LT> >{
    *
    * @return The removed traversal state, or null if the path is empty.
    */
-  public Ariadne_TM_SR_NX<LT> pop(){
+  public SiblingContext pop(){
     if( context_path_list.isEmpty() ){
       return null;
     }
 
-    Ariadne_TM_SR_NX<LT> last = context_path_list.remove( context_path_list.size() - 1 );
+    SiblingContext last = context_path_list.remove( context_path_list.size() - 1 );
     path_member_set.remove( last.read() );
     return last;
   }
@@ -83,15 +109,6 @@ public class Ariadne_ContextPath_FD< Ariadne_TM_SR_NX<LT> >{
     return path_member_set.contains(label);
   }
 
-  /**
-   * Creates a copy of the current context path.
-   *
-   * @return A new ContextPath instance with the same state.
-   */
-  public Ariadne_ContextPath<LT> copy(){
-    return new Ariadne_ContextPath<>(this);
-  }
-
   /**
    * Returns the size of the context path.
    *
@@ -108,32 +125,21 @@ public class Ariadne_ContextPath_FD< Ariadne_TM_SR_NX<LT> >{
    */
   @Override
   public String toString(){
-    StringBuilder output = new StringBuilder("Ariadne_ContextPath(");
-    @SuppressWarnings("unchecked")
-      Ariadne_TM_SR_NX<Ariadne_TM_SR_NX<LT>> tm = Ariadne_TM_SR_NX_Array.make(context_path_list);
+    StringBuilder output = new StringBuilder("Ariadne_ContextPath_FD(");
+    Ariadne_TM_SR_NX_F< SiblingContext > tm = Ariadne_TM_SR_NX_Array.make(context_path_list);
     if( tm.can_read() ){
       do{
-
-        if( tm.head_on_same_cell(this) ){
-          output.append("[Sibling(");
-        } else {
-          output.append("Sibling(");
-        }
+        output.append("Sibling( ");
         output.append( tm.toString() );
-        if( tm.head_on_same_cell(this) )
-          output.append(")]");
-        else
-          output.append(")");
-
+        output.append(" )");
         if( !tm.can_step() ) break;
         tm.step();
         output.append(" ,");
-
       }while(true);
     }
-
     output.append(")");
     return output.toString();
   }
 
 }
+
index a4bcee7..3fe2e00 100644 (file)
@@ -32,7 +32,7 @@ public class Ariadne_Graph<LT extends Ariadne_Label, NT extends Ariadne_Node<LT>
     ,UNKNOWN
   }
 
-  public static <T extends Ariadne_Label, N extends Ariadne_Node<T>> Ariadne_Graph<T, N> make() {
+  public static < T extends Ariadne_Label, N extends Ariadne_Node<T> > Ariadne_Graph<T, N> make() {
     return new Ariadne_Graph<>();
   }
 
diff --git a/developer/javacđź–‰/Ariadne_SiblingContext.java b/developer/javacđź–‰/Ariadne_SiblingContext.java
deleted file mode 100644 (file)
index 122b5a5..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Currently SiblingContext is an alias for Ariadne_TM_SR_NX<LT>.
-
-*/
-package com.ReasoningTechnology.Ariadne;
-
-import java.math.BigInteger;
-
-// LT == Label Type
-public abstract class 
-  Ariadne_SiblingContext<LT extends Ariadne_Label>
-  extends Ariadne_TM_SR_NX<LT>
-{
-
-  // static
-  //
-
-  public static <T extends Ariadne_Label> Ariadne_SiblingContext<T> make(){
-    throw new UnsupportedOperationException("Ariadne_SiblingContext::make not implemented.");
-  }
-
-  // instance data
-  //
-
-  // constructor(s)
-  //
-
-  protected Ariadne_SiblingContext(){
-    super();
-  }
-
-}
diff --git a/developer/javacđź–‰/Ariadne_SiblingContext_FD.java b/developer/javacđź–‰/Ariadne_SiblingContext_FD.java
deleted file mode 100644 (file)
index 8b4dafd..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.ReasoningTechnology.Ariadne;
-
-import java.util.ArrayList;
-import java.util.List;
-
-// LT == Label Type
-public class Ariadne_SiblingContext_FD<LT extends Ariadne_Label>
-  extends Ariadne_SiblingContext<LT>
-{
-
-  // Instance data
-  //
-
-  private final List<LT> sibling_list;
-  private int head_index;
-
-  // Constructors
-  //
-
-  public Ariadne_SiblingContext_FD(List<LT> siblings){
-    this.sibling_list = new ArrayList<>(siblings);
-    this.head_index = 0;
-  }
-
-  // Instance methods
-  //
-
-  @Override public boolean can_read(){
-    return head_index < sibling_list.size();
-  }
-
-  @Override public LT read(){
-    if( !can_read() ){
-      throw new IllegalStateException("Cannot read: No siblings at current position.");
-    }
-    return sibling_list.get(head_index);
-  }
-
-  @Override public boolean can_step(){
-    return head_index < sibling_list.size() - 1;
-  }
-
-  @Override public void step(){
-    if( !can_step() ){
-      throw new IllegalStateException("Cannot step: No more siblings.");
-    }
-    head_index++;
-  }
-
-  @Override public boolean can_rewind(){
-    return head_index > 0;
-  }
-
-  @Override public void rewind(){
-    if( !can_rewind() ){
-      throw new IllegalStateException("Cannot rewind: Already at the first sibling.");
-    }
-    head_index--;
-  }
-}
diff --git a/developer/javacđź–‰/Ariadne_SiblingContext_NX.java b/developer/javacđź–‰/Ariadne_SiblingContext_NX.java
deleted file mode 100644 (file)
index c7c73b0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Currently SiblingContext is an alias for Ariadne_TM_SR_NX<LT>.
-
-*/
-package com.ReasoningTechnology.Ariadne;
-
-import java.math.BigInteger;
-
-// LT == Label Type
-public abstract class 
-  Ariadne_SiblingContext<LT extends Ariadne_Label>
-  extends Ariadne_TM_SR_NX_Array<LT>
-{
-
-  // static
-  //
-
-  public static <T extends Ariadne_Label> Ariadne_SiblingContext<T> make(){
-    throw new UnsupportedOperationException("Ariadne_SiblingContext::make not implemented.");
-  }
-
-  // instance data
-  //
-
-  // constructor(s)
-  //
-
-  protected Ariadne_SiblingContext(){
-    super();
-  }
-
-}
index 6d61bfa..e7c3fc6 100644 (file)
@@ -5,6 +5,13 @@ machine has explicit tracking of the head address.
 BigInteger is used so that it will be possible to bind TM_SR_NX machine extensions
 to file system objects.
 
+It is an interesting question as to whether a TM_SR should support rewind, which
+is similar to stepping left. However, a new machine can always be made from
+the same initial data, and would have its head on the leftmost cell. Hence, the
+effect of adding rewind is to require that the machine keep enough information
+to perform the same function that 'make' originally performed.
+
+
 */
 
 package com.ReasoningTechnology.Ariadne;
@@ -34,14 +41,14 @@ public class Ariadne_TM_SR_NX<RT>{
   //
 
   private int id;
-  Ariadne_Test test = null;
+  protected Ariadne_Test test = null;
   protected TopoIface<RT> current_topology;
   protected BigInteger index;
 
   // constructor(s)
   //
 
-  public Ariadne_TM_SR_NX(){
+  protected Ariadne_TM_SR_NX(){
     id = id_well++;
     test = Ariadne_Test.make("Ariadne_TM_SR_NX::" + id + "::");
     test.switch_test(false);
@@ -99,18 +106,6 @@ public class Ariadne_TM_SR_NX<RT>{
     index = BigInteger.ZERO;
   }
 
-  // Append to rightmost is not considered 'destructive' because the system, including
-  // any entangled machines, remains sound after the operation. I.e. no
-  // machine is broken or has its current read value changed.
-  // However, an entangled machine can detect the end of tape, so a machine
-  // can detect that an append happened. Hence append can affect an algorithm
-  // that is running on an entangled machine, but this can also happen when
-  // any of the entangled machine writes the tape. Hence, append has a similar
-  // affect as other writes.
-  public void append_rightmost(RT x){
-    throw new UnsupportedOperationException("Ariadne_TM_SR_NX::entangle not implemented.");
-  }
-
   // stateful interface
   //
 
@@ -209,105 +204,5 @@ public class Ariadne_TM_SR_NX<RT>{
   }
   protected final TopoIface<RT> topo_null = new NullTopo();
 
-  // good citizen
-  //
-
-  public String to_string_annotated(){
-
-    test.print("::to_string_annotated");
-
-    if(!is_mounted()) return "TM_SR_NX(NotMounted)";
-    if(!can_read()) return "TM_SR_NX(Null)";
-
-    // output takes two lines, starting from the left column on each
-    StringBuilder data_channel = new StringBuilder("\n");
-    StringBuilder control_channel = new StringBuilder("");
-    
-    data_channel.append( "TM_SR_NX(" ).append( topology().name()).append("(" );
-    control_channel.append( " ".repeat(data_channel.length()-1) );
-
-    String element = null;
-    Ariadne_TM_SR_NX<RT> copy = this.entangle();
-    if( copy.can_rewind() ) copy.rewind();
-
-    Object o = null;
-    do{
-
-      o = copy.read();
-
-      if(o == null){
-        data_channel.append( " ".repeat(3) );
-        if( head_on_same_cell(copy) ){
-          control_channel.append("<->");
-        }else{
-          control_channel.append("|-|");
-        }
-      }else if(o.toString().isEmpty()){
-        data_channel.append( " ".repeat(3) );
-        if( head_on_same_cell(copy) ){
-          control_channel.append("<e>");
-        }else{
-          control_channel.append("|e|");
-        }
-      }else{
-        element = o.toString();
-        data_channel.append(" ").append(element).append(" ");
-        if(head_on_same_cell(copy)){
-          control_channel
-            .append("<")
-            .append("d".repeat(element.length()))
-            .append(">");
-        }else{
-          control_channel
-            .append("|")
-            .append("d".repeat(element.length()))
-            .append("|");
-        }
-      }
-
-      if( !copy.can_step() ) break;
-      copy.step();
-
-    }while(true);
-
-    data_channel.append(" )");
-    control_channel.append("  ");
-
-    return 
-      data_channel
-      .append("\n")
-      .append(control_channel)
-      .toString();
-  }
-
-  // RT code format style comma separated list
-  @Override public String toString(){
-
-    Ariadne_TM_SR_NX<RT> tm = this.entangle();
-    if( tm.can_rewind() ) tm.rewind();
-
-    if( !tm.can_read() ) return "";
-
-    StringBuilder output = new StringBuilder();
-    do{
-
-      if( tm.head_on_same_cell(this) ) output.append("[");
-      RT x = tm.read();
-      if( x != null ) output.append(x);
-      if( tm.head_on_same_cell(this) ) output.append("]");
-
-      if( !tm.can_step() ) break;
-
-      tm.step();
-      if( x == null )
-        output.append(",");
-      else
-        output.append(" ,");
-
-    }while(true);
-
-    return output.toString();
-  }
-
 
 }
index 465e581..9900a90 100644 (file)
@@ -4,7 +4,7 @@ import java.math.BigInteger;
 import java.util.List;
 
 // RT == read type
-public class Ariadne_TM_SR_NX_Array<RT> extends Ariadne_TM_SR_NX<RT>{
+public class Ariadne_TM_SR_NX_Array<RT> extends Ariadne_TM_SR_NX_F<RT>{
 
   // Static methods
   //
diff --git a/developer/javacđź–‰/Ariadne_TM_SR_NX_F.java b/developer/javacđź–‰/Ariadne_TM_SR_NX_F.java
new file mode 100644 (file)
index 0000000..e8a50ac
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+Tape is finite, `_F`.
+
+Append
+
+  Append to rightmost is not considered 'destructive' because the system, including any entangled machines, remains sound after the operation. This stand in contrast to
+  the destructive operation of `delete` where one machine could delete a cell that another
+  machine has its head on, then suddenly the other machine can no longer function.
+
+  Still communication between entangled machines becomes possible with the addition of an append operation due to `can_step` changing value though no operation on a given machine causes that.
+
+  Communication between entangled machines is already possible due to one machine writing data that is then read by another machine, so `append` becomes another means for implementing communications. If append is to be used, the programmer needs to be sure that all
+  algorithms run on all entangled machines will continue to function as intended.
+
+toString
+
+   Having a finite tape machine makes it possible to implement a `toString` operation.
+   In contrast to the infinite tape machine which can not iterate over the tape.
+  
+*/
+
+package com.ReasoningTechnology.Ariadne;
+import java.math.BigInteger;
+
+// RT == read type
+public class Ariadne_TM_SR_NX_F<RT> extends Ariadne_TM_SR_NX<RT> {
+
+  // static
+  //
+  public static Ariadne_TM_SR_NX_F make(){
+    return new Ariadne_TM_SR_NX_F();
+  }
+
+  // instance data
+  //
+
+  // constructor(s)
+  //
+
+  protected Ariadne_TM_SR_NX_F(){
+  }
+
+  // Implementation of instance interface.
+  //
+
+  public void append(RT x){
+    throw new UnsupportedOperationException("Ariadne_TM_SR_NX_F::entangle not implemented.");
+  }
+
+  @Override public Ariadne_TM_SR_NX_F<RT> entangle(){
+    throw new UnsupportedOperationException("Ariadne_TM_SR_NX::entangle not implemented.");
+  }
+
+  // good citizen
+  //
+
+  public String to_string_annotated(){
+
+    test.print("::to_string_annotated");
+
+    if(!is_mounted()) return "TM_SR_NX(NotMounted)";
+    if(!can_read()) return "TM_SR_NX(Null)";
+
+    // output takes two lines, starting from the left column on each
+    StringBuilder data_channel = new StringBuilder("\n");
+    StringBuilder control_channel = new StringBuilder("");
+    
+    data_channel.append( "TM_SR_NX(" ).append( topology().name()).append("(" );
+    control_channel.append( " ".repeat(data_channel.length()-1) );
+
+    String element = null;
+    Ariadne_TM_SR_NX_F<RT> copy = this.entangle();
+    if( copy.can_rewind() ) copy.rewind();
+
+    Object o = null;
+    do{
+
+      o = copy.read();
+
+      if(o == null){
+        data_channel.append( " ".repeat(3) );
+        if( head_on_same_cell(copy) ){
+          control_channel.append("<->");
+        }else{
+          control_channel.append("|-|");
+        }
+      }else if(o.toString().isEmpty()){
+        data_channel.append( " ".repeat(3) );
+        if( head_on_same_cell(copy) ){
+          control_channel.append("<e>");
+        }else{
+          control_channel.append("|e|");
+        }
+      }else{
+        element = o.toString();
+        data_channel.append(" ").append(element).append(" ");
+        if(head_on_same_cell(copy)){
+          control_channel
+            .append("<")
+            .append("d".repeat(element.length()))
+            .append(">");
+        }else{
+          control_channel
+            .append("|")
+            .append("d".repeat(element.length()))
+            .append("|");
+        }
+      }
+
+      if( !copy.can_step() ) break;
+      copy.step();
+
+    }while(true);
+
+    data_channel.append(" )");
+    control_channel.append("  ");
+
+    return 
+      data_channel
+      .append("\n")
+      .append(control_channel)
+      .toString();
+  }
+
+  // RT code format style comma separated list
+  @Override public String toString(){
+
+    Ariadne_TM_SR_NX_F<RT> tm = this.entangle();
+    if( tm.can_rewind() ) tm.rewind();
+
+    if( !tm.can_read() ) return "";
+
+    StringBuilder output = new StringBuilder();
+    do{
+
+      if( tm.head_on_same_cell(this) ) output.append("<");
+      RT x = tm.read();
+      if( x != null ) output.append(x);
+      if( tm.head_on_same_cell(this) ) output.append(">");
+
+      if( !tm.can_step() ) break;
+
+      tm.step();
+      if( x == null )
+        output.append(",");
+      else
+        output.append(" ,");
+
+    }while(true);
+
+    return output.toString();
+  }
+
+
+}
index 44f1e07..cca4554 100644 (file)
@@ -11,7 +11,7 @@ package com.ReasoningTechnology.Ariadne;
 import java.util.List;
 import java.util.ListIterator;
 
-public class Ariadne_TM_SR_NX_List<RT> extends Ariadne_TM_SR_NX<RT>{
+public class Ariadne_TM_SR_NX_List<RT> extends Ariadne_TM_SR_NX_F<RT>{
 
   // Static methods
   //
index 521ee5d..eb7c850 100644 (file)
@@ -35,4 +35,14 @@ part of the TestBench.
 
 4 add hash map to graph, lookup on node label pairs to find edge properties.
 
-5. append() method for TM_SR_ND.
+xx 5. append() method for TM_SR_NX. done
+
+
+2025-01-25T14:23:55Z[]
+
+Better to require copy constructor then use make instead of `entangle` `can_rewind` `rewind`.
+I wonder about the wisdom of having `can_rewind` or even `rewind`.  With a cpoy constructor
+the structure bound to must be passed as an argument if the tm is passed as an argument and
+then the function wants to rewind via copy construct ... dunno.
+
+TM_SR_NX