From: Thomas Walker Lynch Date: Wed, 15 Jan 2025 05:35:17 +0000 (+0000) Subject: identifier / filename updates X-Git-Url: https://git.reasoningtechnology.com/style/static/gitweb.js?a=commitdiff_plain;h=97de38f764a897e926294e88f105f231e0407ada;p=Ariadne identifier / filename updates --- 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/SRTM_Depth.java deleted file mode 100644 index efbff43..0000000 --- a/developer/example/GraphCycleCFinder/SRTM_Depth.java +++ /dev/null @@ -1,159 +0,0 @@ -/* -ND_SR_TM_Depth is a list of neighbor ND_SR_TMs 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. - -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 -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. - -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. - -Each call to step causes the TM read head to move to the next lowest -depth, leftmost unvisited node. This might require backtracking and -descending again. - -Nodes are referenced by label. - -A null valued label is flagged as an error, though we still look it up -in the graph. It is a fatal error, `exit(1)` if `lookup` returns a -null node. - -A `path` is a list of nodes (each referenced by a label). `context_path` -carries with it the child list for each node in the path. The child -list is represented as a srtm, and the head of the tape machine marks -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_Graph; - -class ND_SR_TM_Depth{ - - // static - // - ND_SR_TM_Depth make(Graph graph){ - ND_SR_TM_Depth depth = new ND_SR_TM_Depth(); - if(graph == null) return null; - depth.graph = graph; - depth.context_path.add( graph.start() ); - boolean flag = complete_context_path(); - if( flag ) return depth; - return null; - } - - // instance data - // - protected Graph graph = null; - protected List context_path = new ArrayList<>(); - protected Label cycle_node_label = null; - - // constructor - // - protected ND_SR_TM_Depth(){ - set_topography(topo_null); - } - - // instance interface implementation - // - - // A path is terminated by a leaf node or upon discovering a cycle. - // Return false iff can not complete the context path. This is generally a fatal error. - protected boolean complete_context_path(){ - - if( context_path.isEmpty() ){ - System.out.println("ND_SR_TM_Depth::complete_context_path empty context_path"); - return false; - } - - private final HashSet