From: Thomas Walker Lynch Date: Tue, 14 Jan 2025 17:21:18 +0000 (+0000) Subject: adds complete_context_path function to SRTM_Depth X-Git-Url: https://git.reasoningtechnology.com/style/rt_dark_doc.css?a=commitdiff_plain;h=cc45234a2aab7e405bd6958dfe87cf460578dacc;p=Ariadne adds complete_context_path function to SRTM_Depth --- diff --git "a/developer/document\360\237\226\211/diagonal_traversal.txt" "b/developer/document\360\237\226\211/diagonal_traversal.txt" index fb50b4f..a157bab 100644 --- "a/developer/document\360\237\226\211/diagonal_traversal.txt" +++ "b/developer/document\360\237\226\211/diagonal_traversal.txt" @@ -67,10 +67,10 @@ How diagonalization works: 2. Populate diagonal_1 using child_srtm_list: 2.1 Bind child_srtm_list to an SRTM. - 2.2 For each STRM in the list: + 2.2 For each SRTM in the list: 2.2.1 Read the label from the SRTM. 2.2.2 Append a copy of this label to diagonal_1. - 2.2.3 if can_step the STRM, the step the head to the next sibling. + 2.2.3 if can_step the SRTM, the step the head to the next sibling. else remove SRTM from the child_srtm_list. (This removal will never happen on an infinite topology.) diff --git a/developer/example/GraphCycleCFinder/#SRTM_Depth.java# b/developer/example/GraphCycleCFinder/#SRTM_Depth.java# deleted file mode 100644 index 78de5f7..0000000 --- a/developer/example/GraphCycleCFinder/#SRTM_Depth.java# +++ /dev/null @@ -1,121 +0,0 @@ -/* -SRTM_Depth is a list of neighbor SRTMs 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 SRTM for iterating over the -node's neighbors. An SRTM 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 -`SRTM_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 `SRTM_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 found while traversing a tree. A road is a -list of child_srtm found while traversing the tree. - -*/ - -import com.ReasoningTechnology.Ariadne.Ariadne_SRTM; -import com.ReasoningTechnology.Ariadne.Ariadne_Graph; - - -class SRTM_Depth{ - - // static - // - - PathStack make(Graph g){ - return new SRTM_Depth(g); - } - - // instance data - // - protected List path; - protected Graph graph; - - // constructor - // - protected SRTM_Depth(Graph g){ - set_topography(topo_null); - if(g == null) return; - graph = g; - path.add( g.start() ); - descend(); - } - - // instance interface implementation - // - - - // A path is terminated by a leaf node or discovering a cycle. - protected boolean extend_path_to_termination(){ - - ArrayList