From 97de38f764a897e926294e88f105f231e0407ada Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Wed, 15 Jan 2025 05:35:17 +0000 Subject: [PATCH] identifier / filename updates --- developer/deprecated/Ariadne_SRTM.java | 16 +-- developer/deprecated/temp.java | 18 +-- .../CountingNumber/CountingNumber.java | 4 +- .../CountingNumber/CountingNumber_0_CLI.java | 6 +- .../example/GraphCycleCFinder/#temp.java# | 118 ------------------ .../{SRTM_Depth.java => TM_SR_ND_Depth.java} | 34 ++--- developer/example/GraphIndexTree/Graph.java | 4 +- developer/example/GraphIndexTree/Label.java | 6 +- developer/example/GraphIndexTree/Node.java | 4 +- .../{SRTM_Child.java => TM_SR_ND_Child.java} | 14 +-- ...M_Diagonal.java => TM_SR_ND_Diagonal.java} | 26 ++-- ...al_CLI.java => TM_SR_ND_Diagonal_CLI.java} | 10 +- ...t.txt => TM_SR_ND_Diagonal_transcript.txt} | 0 .../four_down_four_across_CLI.java | 8 +- .../ND_SR_TM_Array_CLI.java} | 10 +- .../ND_SR_TM_Array_transcript.txt} | 0 .../ND_SR_TM_List_CLI.java} | 10 +- .../ND_SR_TM_List_transcript.txt} | 0 .../ND_SR_TM_Set_CLI.java} | 8 +- .../javac\360\237\226\211/Ariadne_Graph.java" | 2 +- .../javac\360\237\226\211/Ariadne_Node.java" | 4 +- .../Ariadne_TM_SR_ND.java" | 30 ++--- .../Ariadne_TM_SR_ND_Array.java" | 8 +- .../Ariadne_TM_SR_ND_Label.java" | 6 +- .../Ariadne_TM_SR_ND_List.java" | 14 +-- .../Ariadne_TM_SR_ND_Set.java" | 8 +- 26 files changed, 125 insertions(+), 243 deletions(-) delete mode 100644 developer/example/GraphCycleCFinder/#temp.java# rename developer/example/GraphCycleCFinder/{SRTM_Depth.java => TM_SR_ND_Depth.java} (81%) rename developer/example/GraphIndexTree/{SRTM_Child.java => TM_SR_ND_Child.java} (84%) rename developer/example/GraphIndexTree/{SRTM_Diagonal.java => TM_SR_ND_Diagonal.java} (81%) rename developer/example/GraphIndexTree/{SRTM_Diagonal_CLI.java => TM_SR_ND_Diagonal_CLI.java} (76%) rename developer/example/GraphIndexTree/{SRTM_Diagonal_transcript.txt => TM_SR_ND_Diagonal_transcript.txt} (100%) rename developer/example/{SRTM/SRTMI_Array_CLI.java => TM_SR_ND/ND_SR_TM_Array_CLI.java} (63%) rename developer/example/{SRTM/SRTMI_Array_transcript.txt => TM_SR_ND/ND_SR_TM_Array_transcript.txt} (100%) rename developer/example/{SRTM/SRTM_List_CLI.java => TM_SR_ND/ND_SR_TM_List_CLI.java} (64%) rename developer/example/{SRTM/SRTM_List_transcript.txt => TM_SR_ND/ND_SR_TM_List_transcript.txt} (100%) rename developer/example/{SRTM/SRTM_Set_CLI.java => TM_SR_ND/ND_SR_TM_Set_CLI.java} (70%) rename "developer/javac\360\237\226\211/Ariadne_ND_SR_TM.java" => "developer/javac\360\237\226\211/Ariadne_TM_SR_ND.java" (80%) rename "developer/javac\360\237\226\211/Ariadne_ND_SR_TM_Array.java" => "developer/javac\360\237\226\211/Ariadne_TM_SR_ND_Array.java" (90%) rename "developer/javac\360\237\226\211/Ariadne_ND_SR_TM_Label.java" => "developer/javac\360\237\226\211/Ariadne_TM_SR_ND_Label.java" (55%) rename "developer/javac\360\237\226\211/Ariadne_ND_SR_TM_List.java" => "developer/javac\360\237\226\211/Ariadne_TM_SR_ND_List.java" (86%) rename "developer/javac\360\237\226\211/Ariadne_ND_SR_TM_Set.java" => "developer/javac\360\237\226\211/Ariadne_TM_SR_ND_Set.java" (91%) diff --git a/developer/deprecated/Ariadne_SRTM.java b/developer/deprecated/Ariadne_SRTM.java index c940cf5..5d1771a 100644 --- a/developer/deprecated/Ariadne_SRTM.java +++ b/developer/deprecated/Ariadne_SRTM.java @@ -1,7 +1,7 @@ /* Step Right Tape Machine - Depending how the undefined methods here are defined, the ND_SR_TM can + Depending how the undefined methods here are defined, the TM_SR_ND can equally be a finite iterator, a generator, or an infinite stream. This is for single-threaded execution. The multi-threaded model @@ -9,7 +9,7 @@ */ package com.ReasoningTechnology.Ariadne; -public class Ariadne_ND_SR_TM{ +public class Ariadne_TM_SR_ND{ // static // @@ -22,8 +22,8 @@ public class Ariadne_ND_SR_TM{ ,INFINITE } - public static Ariadne_ND_SR_TM make(){ - return new Ariadne_ND_SR_TM(); + public static Ariadne_TM_SR_ND make(){ + return new Ariadne_TM_SR_ND(); } // instance data @@ -35,7 +35,7 @@ public class Ariadne_ND_SR_TM{ // constructor(s) // - protected Ariadne_ND_SR_TM(){ + protected Ariadne_TM_SR_ND(){ set_topology( not_mounted ); } @@ -87,16 +87,16 @@ public class Ariadne_ND_SR_TM{ return false; } @Override public Object read(){ - throw new UnsupportedOperationException("Ariadne_ND_SR_TM::NotMounted::read."); + throw new UnsupportedOperationException("Ariadne_TM_SR_ND::NotMounted::read."); } @Override public boolean can_step(){ return false; } @Override public void step(){ - throw new UnsupportedOperationException("Ariadne_ND_SR_TM::NotMounted::step."); + throw new UnsupportedOperationException("Ariadne_TM_SR_ND::NotMounted::step."); } @Override public Topology topology(){ - throw new UnsupportedOperationException("Ariadne_ND_SR_TM::NotMounted::topology."); + throw new UnsupportedOperationException("Ariadne_TM_SR_ND::NotMounted::topology."); } } diff --git a/developer/deprecated/temp.java b/developer/deprecated/temp.java index ddf97cf..635708a 100644 --- a/developer/deprecated/temp.java +++ b/developer/deprecated/temp.java @@ -1,6 +1,6 @@ Aeloria /* - IndexTree_ND_SR_TM_Diagonal + IndexTree_TM_SR_ND_Diagonal An index tree is infinite. @@ -14,15 +14,15 @@ Aeloria import java.math.BigInteger; import java.util.ArrayList; import java.util.List; -import com.ReasoningTechnology.Ariadne.Ariadne_ND_SR_TM; +import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND; import com.ReasoningTechnology.Ariadne.IndexTree_Node; -public class IndexTree_ND_SR_TM_Diagonal extends Ariadne_ND_SR_TM_Label { +public class IndexTree_TM_SR_ND_Diagonal extends Ariadne_TM_SR_ND_Label { // Static - public static IndexTree_ND_SR_TM_Diagonal make(){ - return new IndexTree_ND_SR_TM_Diagonal(); + public static IndexTree_TM_SR_ND_Diagonal make(){ + return new IndexTree_TM_SR_ND_Diagonal(); } // Instance Data @@ -30,15 +30,15 @@ public class IndexTree_ND_SR_TM_Diagonal extends Ariadne_ND_SR_TM_Label { private final List list_of__unopened_node; private final List> list_of__opened_incomplete_child_list; private final List read_list; - private final Ariadne_ND_SR_TM_Label breadth_srm; + private final Ariadne_TM_SR_ND_Label breadth_srm; // Constructor - protected IndexTree_ND_SR_TM_Diagonal(){ + protected IndexTree_TM_SR_ND_Diagonal(){ list_of__unopened_node = new ArrayList<>(); list_of__opened_incomplete_child_list = new ArrayList<>(); read_list = new ArrayList<>(); - breadth_srm = Ariadne_ND_SR_TM_Label.make(); + breadth_srm = Ariadne_TM_SR_ND_Label.make(); enqueue_root(); }Aeloria @@ -76,7 +76,7 @@ public class IndexTree_ND_SR_TM_Diagonal extends Ariadne_ND_SR_TM_Label { // Retrieve the node using lookup IndexTree_Node node = lookup( label ); - // Mount a new breadth-first ND_SR_TM for children + // Mount a new breadth-first TM_SR_ND for children breadth_srm.mount( node.neighbor() ); if( breadth_srm.can_read() ){ diff --git a/developer/example/CountingNumber/CountingNumber.java b/developer/example/CountingNumber/CountingNumber.java index 50aa96f..f8c751c 100644 --- a/developer/example/CountingNumber/CountingNumber.java +++ b/developer/example/CountingNumber/CountingNumber.java @@ -1,7 +1,7 @@ -import com.ReasoningTechnology.Ariadne.Ariadne_ND_SR_TM; +import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND; import java.math.BigInteger; -public class CountingNumber extends Ariadne_ND_SR_TM{ +public class CountingNumber extends Ariadne_TM_SR_ND{ // Static // diff --git a/developer/example/CountingNumber/CountingNumber_0_CLI.java b/developer/example/CountingNumber/CountingNumber_0_CLI.java index b8daaf7..9611026 100644 --- a/developer/example/CountingNumber/CountingNumber_0_CLI.java +++ b/developer/example/CountingNumber/CountingNumber_0_CLI.java @@ -1,4 +1,4 @@ -import com.ReasoningTechnology.Ariadne.Ariadne_ND_SR_TM; +import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND; import java.math.BigInteger; public class CountingNumber_0_CLI{ @@ -8,14 +8,14 @@ public class CountingNumber_0_CLI{ if( !n.can_read() ) return; - if( n.topology() == Ariadne_ND_SR_TM.Topology.SEGMENT ){ + if( n.topology() == Ariadne_TM_SR_ND.Topology.SEGMENT ){ do{ System.out.println("Current Number: " + n.read()); if( !n.can_step() ) break; n.step(); }while( true ); - }else if( n.topology() == Ariadne_ND_SR_TM.Topology.INFINITE ){ + }else if( n.topology() == Ariadne_TM_SR_ND.Topology.INFINITE ){ int count = 0; do{ System.out.println("Current Number: " + n.read()); diff --git a/developer/example/GraphCycleCFinder/#temp.java# b/developer/example/GraphCycleCFinder/#temp.java# deleted file mode 100644 index 74e0a62..0000000 --- a/developer/example/GraphCycleCFinder/#temp.java# +++ /dev/null @@ -1,118 +0,0 @@ -package com.ReasoningTechnology.Ariadne; - -import java.util.ArrayList; -import java.util.List; - -public class SRTM_Depth extends Ariadne_SRTM { - - // Static method to create a depth traversal SRTM - public static SRTM_Depth make(Ariadne_Graph graph){ - SRTM_Depth depth = new SRTM_Depth(); - depth.path.add(graph.start()); - depth.descent(); - return depth; - } - - // Instance data - private final List path; - - private final TopoIface topo_null = new TopoNull(); - private final TopoIface topo_segment = new TopoSegment(); - - // Constructor - protected SRTM_Depth(){ - this.path = new ArrayList<>(); - set_topology(topo_null); - } - - // Descends to the leftmost unvisited node - protected void descent(){ - while( true ){ - Ariadne_SRTM current = path.get(path.size() - 1); - if( !current.can_read() ){ - backtrack(); - if( path.isEmpty() ) return; // No more nodes to traverse - continue; - } - - Ariadne_SRTM neighbors = current.read(); // Get neighbor SRTM - if( neighbors == null || !neighbors.can_read() ){ - backtrack(); - if( path.isEmpty() ) return; - continue; - } - - path.add(neighbors); - set_topology(topo_segment); - } - } - - // Backtracks to the previous node - protected void backtrack(){ - while( !path.isEmpty() ){ - Ariadne_SRTM last = path.get(path.size() - 1); - last.step(); - if( last.can_step() ){ - return; - } - path.remove(path.size() - 1); - } - set_topology(topo_null); - } - - // Steps to the next node in the traversal - @Override - public void step(){ - descent(); - } - - // Reads the current node - @Override - public Ariadne_SRTM read(){ - return path.isEmpty() ? null : path.get(path.size() - 1); - } - - // Checks if traversal can continue - @Override - public boolean can_read(){ - return current_topology.can_read(); - } - - // Topology: Null - private class TopoNull implements TopoIface{ - @Override public boolean can_read(){ - return false; - } - @Override public Object read(){ - throw new UnsupportedOperationException("Cannot read from NULL topology."); - } - @Override public boolean can_step(){ - return false; - } - @Override public void step(){ - throw new UnsupportedOperationException("Cannot step from NULL topology."); - } - @Override public Topology topology(){ - return Topology.NULL; - } - } - - // Topology: Segment - private class TopoSegment implements TopoIface{ - @Override public boolean can_read(){ - return true; - } - @Override public Object read(){ - return path.get(path.size() - 1); - } - @Override public boolean can_step(){ - return !path.isEmpty(); - } - @Override public void step(){ - descent(); - } - @Override public Topology topology(){ - return Topology.SEGMENT; - } - } -} diff --git a/developer/example/GraphCycleCFinder/SRTM_Depth.java b/developer/example/GraphCycleCFinder/TM_SR_ND_Depth.java similarity index 81% rename from developer/example/GraphCycleCFinder/SRTM_Depth.java rename to developer/example/GraphCycleCFinder/TM_SR_ND_Depth.java index efbff43..e8332bf 100644 --- a/developer/example/GraphCycleCFinder/SRTM_Depth.java +++ b/developer/example/GraphCycleCFinder/TM_SR_ND_Depth.java @@ -1,5 +1,5 @@ /* -ND_SR_TM_Depth is a list of neighbor ND_SR_TMs going down the leftmost side of +TM_SR_ND_Depth is a list of neighbor TM_SR_NDs going down the leftmost side of a graph traversal. A leftmost traversal is one characterized by following leftmost not yet visited node on the most recently visited node's neighbor list. @@ -7,20 +7,20 @@ node's neighbor list. Depth traversal from a start node, ends when reaching a node that has no neighbors, or when reaching encountering a cycle. -The `Node::neighbor()` function returns an ND_SR_TM for iterating over the -node's neighbors. An ND_SR_TM is returned rather than a list, because in +The `Node::neighbor()` function returns an TM_SR_ND for iterating over the +node's neighbors. An TM_SR_ND is returned rather than a list, because in general a neighbor list is allowed to be unbounded. Though with a finite graph, that can not happen. (See IndexTree for an example of an infinite depth and infinite breadth graph traveral.) It is possible to construct and infinite graph such that the -`ND_SR_TM_Depth::make()` function would never return. +`TM_SR_ND_Depth::make()` function would never return. For a finite graph, this depth traversal will provably terminate, due to running out unique (non cycle) nodes to visit. More generally, if graph traversal from a start node is guaranteed to reach a leaf node (has no neighbors), or a a cycle, within a finite number of node -traversal steps, then `ND_SR_TM_Depth::make()` will always return. +traversal steps, then `TM_SR_ND_Depth::make()` will always return. Each call to step causes the TM read head to move to the next lowest depth, leftmost unvisited node. This might require backtracking and @@ -41,15 +41,15 @@ the child node that is no the path. import java.util.HashMap; -import com.ReasoningTechnology.Ariadne.Ariadne_ND_SR_TM; +import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND; import com.ReasoningTechnology.Ariadne.Ariadne_Graph; -class ND_SR_TM_Depth{ +class TM_SR_ND_Depth{ // static // - ND_SR_TM_Depth make(Graph graph){ - ND_SR_TM_Depth depth = new ND_SR_TM_Depth(); + TM_SR_ND_Depth make(Graph graph){ + TM_SR_ND_Depth depth = new TM_SR_ND_Depth(); if(graph == null) return null; depth.graph = graph; depth.context_path.add( graph.start() ); @@ -61,12 +61,12 @@ class ND_SR_TM_Depth{ // instance data // protected Graph graph = null; - protected List context_path = new ArrayList<>(); + protected List context_path = new ArrayList<>(); protected Label cycle_node_label = null; // constructor // - protected ND_SR_TM_Depth(){ + protected TM_SR_ND_Depth(){ set_topography(topo_null); } @@ -78,7 +78,7 @@ class ND_SR_TM_Depth{ protected boolean complete_context_path(){ if( context_path.isEmpty() ){ - System.out.println("ND_SR_TM_Depth::complete_context_path empty context_path"); + System.out.println("TM_SR_ND_Depth::complete_context_path empty context_path"); return false; } @@ -87,8 +87,8 @@ class ND_SR_TM_Depth{ // should add cycle check for anomalous case caller fed us an initial path with a cycle // initialize the path_node set - Ariadne_ND_SR_TM_Array context_path_srtm = Ariadne_ND_SR_TM_Array.make(context_path); - Ariadne_ND_SR_TM_List