From: Thomas Walker Lynch Date: Sun, 12 Jan 2025 10:43:28 +0000 (+0000) Subject: close to getting Example_SRTM_Diagonal X-Git-Url: https://git.reasoningtechnology.com/home/twl/Documents/subuser/test_env.py?a=commitdiff_plain;h=824e880b82073c2ddd3de580b0b6f6b3bff7d9d9;p=Ariadne close to getting Example_SRTM_Diagonal --- diff --git "a/developer/document\360\237\226\211/diagonal_traversal.txt" "b/developer/document\360\237\226\211/diagonal_traversal.txt" new file mode 100644 index 0000000..b10710f --- /dev/null +++ "b/developer/document\360\237\226\211/diagonal_traversal.txt" @@ -0,0 +1,53 @@ +Does there exist a node in the tree, such that if that node were marked before the diagonal generating algorithm is run, that that node will never be reached no matter how long the diagonal generating algorithm runs? Or perhaps you can't tell. +ChatGPT said: +ChatGPT +This is an interesting and profound question that touches on the completeness of the diagonal traversal algorithm in enumerating all nodes in an infinite tree. Let’s analyze it step by step. + +Key Observations About the Algorithm +Breadth and Depth Expansion: + +The diagonal algorithm explicitly alternates between "expanding down" to include children of nodes on the current diagonal and "expanding across" to include siblings of nodes already encountered. +Infinite Iterations: + +The algorithm iteratively generates new diagonals, and given infinite time, it will traverse every node that can be reached by a finite number of inc_down and inc_across operations. +Traversal Guarantee: + +The algorithm systematically enumerates every node along both depth and breadth. No node can be skipped permanently unless: +It cannot be reached via any sequence of inc_down and inc_across operations starting from the root. +The marking somehow prevents traversal. +Impact of Marking a Node +If a node is marked before the algorithm starts: + +Does Marking Influence the Algorithm? + +In the current implementation, the diagonal algorithm operates solely on labels and their incremental modifications (inc_down and inc_across). The marking state of a node is not factored into the traversal logic. Therefore: +Marking a node has no direct effect on whether the algorithm traverses it. +The algorithm will still reach every node, regardless of whether it is marked. +Can a Marked Node Be Skipped? + +No, the diagonal algorithm’s design ensures that every node in the infinite tree will eventually be reached, even if it is marked, because: +Marking is a separate property and does not alter the traversal mechanics. +The algorithm is exhaustive in both depth (inc_down) and breadth (inc_across). +Does Any Node Remain Unreachable? +To ensure there is no unreachable node: + +Structural Guarantees: + +The index tree is connected, meaning every node is reachable from the root via a finite sequence of operations. +Algorithm Completeness: + +The diagonal algorithm guarantees eventual traversal of every node by alternating between expanding depth and breadth. +No Skipped Nodes: + +Since the algorithm generates all possible sequences of inc_down and inc_across, there cannot exist a node in the tree that remains permanently unreachable. +Conclusion +No, there does not exist a node in the infinite index tree that, if marked beforehand, would never be reached by the diagonal generating algorithm. + +The diagonal algorithm traverses every node eventually, regardless of marking. +Marking only adds an attribute to nodes but does not interfere with the traversal mechanism. +Let me know if you'd like a deeper mathematical formalism for this or additional edge cases analyzed! 😊 + + + + + diff --git a/developer/example/CountingNumber/CountingNumber$Topo_Infinite.class b/developer/example/CountingNumber/CountingNumber$Topo_Infinite.class new file mode 100644 index 0000000..24f713f Binary files /dev/null and b/developer/example/CountingNumber/CountingNumber$Topo_Infinite.class differ diff --git a/developer/example/CountingNumber/CountingNumber$Topo_Null.class b/developer/example/CountingNumber/CountingNumber$Topo_Null.class new file mode 100644 index 0000000..4c8d074 Binary files /dev/null and b/developer/example/CountingNumber/CountingNumber$Topo_Null.class differ diff --git a/developer/example/CountingNumber/CountingNumber$Topo_Rightmost.class b/developer/example/CountingNumber/CountingNumber$Topo_Rightmost.class new file mode 100644 index 0000000..3003cb0 Binary files /dev/null and b/developer/example/CountingNumber/CountingNumber$Topo_Rightmost.class differ diff --git a/developer/example/CountingNumber/CountingNumber$Topo_Segment.class b/developer/example/CountingNumber/CountingNumber$Topo_Segment.class new file mode 100644 index 0000000..09894f9 Binary files /dev/null and b/developer/example/CountingNumber/CountingNumber$Topo_Segment.class differ diff --git a/developer/example/CountingNumber/CountingNumber.class b/developer/example/CountingNumber/CountingNumber.class new file mode 100644 index 0000000..41ce6dc Binary files /dev/null and b/developer/example/CountingNumber/CountingNumber.class differ diff --git a/developer/example/CountingNumber/Example_CountingNumber_0 b/developer/example/CountingNumber/Example_CountingNumber_0 new file mode 100755 index 0000000..03434e8 --- /dev/null +++ b/developer/example/CountingNumber/Example_CountingNumber_0 @@ -0,0 +1,2 @@ +#!/bin/bash +java Example_CountingNumber_0 diff --git a/developer/example/CountingNumber/Example_CountingNumber_0.class b/developer/example/CountingNumber/Example_CountingNumber_0.class new file mode 100644 index 0000000..8ee76ad Binary files /dev/null and b/developer/example/CountingNumber/Example_CountingNumber_0.class differ diff --git a/developer/example/CountingNumber/temp.java b/developer/example/CountingNumber/temp.java deleted file mode 100644 index db47630..0000000 --- a/developer/example/CountingNumber/temp.java +++ /dev/null @@ -1,44 +0,0 @@ - // Implementation of instance interface. - // - - @Override public List read(){ - return diagonal; - } - - @Override public void step(){ - diagonal.clear(); - - // Process unopened nodes - while( !list_of__unopened_node.isEmpty() ){ - BigInteger[] label = list_of__unopened_node.remove(0); - - // Retrieve the node using lookup - Ariadne_Node node = lookup(label); - - // Descend by getting neighbors - List child_labels = fetch_child_labels(node); - if( !child_labels.isEmpty() ){ - list_of__opened_incomplete_child_list.add(child_labels); - } - } - - // Process incomplete child lists - while( !list_of__opened_incomplete_child_list.isEmpty() ){ - List child_labels = list_of__opened_incomplete_child_list.remove(0); - if( !child_labels.isEmpty() ){ - BigInteger[] label = child_labels.remove(0); - diagonal.add(label); - - // Retrieve node and check its neighbors - Ariadne_Node node = lookup(label); - if( !fetch_child_labels(node).isEmpty() ){ - list_of__unopened_node.add(label); - } - } - } - } - - private Ariadne_Node lookup(BigInteger[] label){ - // Perform a lookup to retrieve the node corresponding to the label - return Ariadne_Node.make(label); - } diff --git a/developer/example/IndexTree/Example_4x4 b/developer/example/IndexTree/Example_4x4 deleted file mode 100755 index 263380a..0000000 --- a/developer/example/IndexTree/Example_4x4 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java Example_4x4 diff --git a/developer/example/IndexTree/Example_4x4.class b/developer/example/IndexTree/Example_4x4.class deleted file mode 100644 index 0b68688..0000000 Binary files a/developer/example/IndexTree/Example_4x4.class and /dev/null differ diff --git a/developer/example/IndexTree/Example_SRTM_Diagonal b/developer/example/IndexTree/Example_SRTM_Diagonal deleted file mode 100755 index b170dce..0000000 --- a/developer/example/IndexTree/Example_SRTM_Diagonal +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java Example_SRTM_Diagonal diff --git a/developer/example/IndexTree/Example_SRTM_Diagonal.class b/developer/example/IndexTree/Example_SRTM_Diagonal.class deleted file mode 100644 index 8eb9033..0000000 Binary files a/developer/example/IndexTree/Example_SRTM_Diagonal.class and /dev/null differ diff --git a/developer/example/IndexTree/Example_SRTM_Diagonal.java b/developer/example/IndexTree/Example_SRTM_Diagonal.java index f7f15db..6473a04 100644 --- a/developer/example/IndexTree/Example_SRTM_Diagonal.java +++ b/developer/example/IndexTree/Example_SRTM_Diagonal.java @@ -1,7 +1,5 @@ - - -import java.math.BigInteger; -import java.util.Queue; +import java.util.List; +import com.ReasoningTechnology.Ariadne.Ariadne_SRTM_List; public class Example_SRTM_Diagonal { @@ -9,33 +7,34 @@ public class Example_SRTM_Diagonal { System.out.println("Starting IndexTree SRTM Example"); // Instantiate the IndexTree Diagonal SRTM - SRTM_Diagonal srm = SRTM_Diagonal.make(); + SRTM_Diagonal srtm = SRTM_Diagonal.make(); int step_count = 0; do{ - System.out.println("Step " + (step_count + 1) + ":"); - /* - Queue read_list = srm.read(); - if(!read_list.isEmpty()){ - for(BigInteger[] label : read_list){ - System.out.println(" Node Label: " + format_label(label)); - } + System.out.println("Diagonal " + step_count + ":"); + + // Read and print the current diagonal + List