From e91208825162897f17c2dd0ace6a4768f258e7de Mon Sep 17 00:00:00 2001 From: Thomas Walker Lynch Date: Fri, 8 Nov 2024 15:55:55 +0000 Subject: [PATCH] updates to the _ identifier convention for class. Tests up through Graph (all writtent thus far) now passing. --- developer/document/GraphDirectedAcyclic_1.txt | 84 +++++++ developer/javac/Ariadne_File.java | 76 +++++++ developer/javac/Ariadne_Graph.java | 62 +++++ .../javac/Ariadne_GraphDirectedAcyclic.java | 214 ++++++++++++++++++ developer/javac/Ariadne_Label.java | 42 ++++ developer/javac/Ariadne_LabelList.java | 18 ++ developer/javac/Ariadne_Node.java | 30 +++ developer/javac/Ariadne_NodeList.java | 10 + developer/javac/Ariadne_Production.java | 5 + developer/javac/Ariadne_ProductionList.java | 10 + developer/javac/Ariadne_Token.java | 35 +++ developer/javac/Ariadne_TokenSet.java | 10 + developer/javac/Ariadne_Util.java | 25 ++ .../Ariadne/Ariadne_File.class | Bin 0 -> 4576 bytes .../Ariadne/Ariadne_Graph.class | Bin 0 -> 3058 bytes .../Ariadne_GraphDirectedAcyclic$1.class | Bin 0 -> 864 bytes .../Ariadne_GraphDirectedAcyclic$2.class | Bin 0 -> 896 bytes .../Ariadne_GraphDirectedAcyclic.class | Bin 0 -> 9044 bytes .../Ariadne/Ariadne_Label.class | Bin 0 -> 1062 bytes .../Ariadne/Ariadne_LabelList.class | Bin 0 -> 877 bytes .../Ariadne/Ariadne_Node.class | Bin 0 -> 1573 bytes .../Ariadne/Ariadne_NodeList.class | Bin 0 -> 436 bytes .../Ariadne/Ariadne_Production.class | Bin 0 -> 349 bytes .../Ariadne/Ariadne_ProductionList.class | Bin 0 -> 460 bytes .../Ariadne/Ariadne_Token.class | Bin 0 -> 972 bytes .../Ariadne/Ariadne_TokenSet.class | Bin 0 -> 433 bytes .../Ariadne/Ariadne_Util.class | Bin 0 -> 1697 bytes .../ReasoningTechnology/Ariadne}/File.java | 14 +- .../ReasoningTechnology/Ariadne}/Graph.java | 0 .../Ariadne}/GraphDirectedAcyclic.java | 70 ------ .../ReasoningTechnology/Ariadne}/Label.java | 0 .../Ariadne}/LabelList.java | 0 .../ReasoningTechnology/Ariadne}/Node.java | 0 .../Ariadne}/NodeList.java | 0 .../Ariadne}/Production.java | 0 .../Ariadne}/ProductionList.java | 0 .../ReasoningTechnology/Ariadne}/Token.java | 0 .../Ariadne}/TokenSet.java | 0 .../ReasoningTechnology/Ariadne}/Util.java | 0 developer/tool/distribute_source | 67 ++++-- release/Ariadne.jar | Bin 15291 -> 38814 bytes tester/deprecated/Test_File_0.java | 114 ++++++++++ tester/deprecated/Test_Graph_0.java | 72 ++++++ .../deprecated}/scratch_pad/.gitignore | 0 tester/javac/#Test2.javax# | 10 +- tester/javac/#Test_Node_0.java# | 63 ------ tester/javac/In.java | 76 ------- tester/javac/TestMosaicUtil.java | 15 -- tester/javac/Test_File_0.java | 85 ++++--- tester/javac/Test_Graph_0.java | 50 ++-- tester/javac/Test_LabelList_0.java | 22 +- tester/javac/Test_Label_0.java | 19 +- tester/javac/Test_NodeList_0.java | 16 +- tester/javac/Test_Node_0.java | 49 ++-- tester/javac/Test_TokenSet_0.java | 27 ++- tester/javac/Test_Token_0.java | 26 ++- tester/javac/Test_Util_0.java | 25 +- tester/jvm/Test_Ariadne.jar | Bin 17220 -> 17173 bytes tester/scratch_pad/.gitignore | 2 - tester/scratchpad/In$MIO.class | Bin 320 -> 0 bytes tester/scratchpad/In$MU.class | Bin 320 -> 0 bytes tester/scratchpad/In$TB.class | Bin 324 -> 0 bytes tester/scratchpad/In$TestBench.class | Bin 345 -> 0 bytes tester/scratchpad/In.class | Bin 3182 -> 0 bytes tester/scratchpad/MU.class | Bin 262 -> 0 bytes tester/scratchpad/Test_File_0$TestSuite.class | Bin 4749 -> 4975 bytes tester/scratchpad/Test_File_0.class | Bin 739 -> 902 bytes .../scratchpad/Test_Graph_0$TestSuite.class | Bin 3150 -> 3307 bytes tester/scratchpad/Test_Graph_0.class | Bin 745 -> 752 bytes .../Test_LabelList_0$TestSuite.class | Bin 1855 -> 1948 bytes tester/scratchpad/Test_LabelList_0.class | Bin 769 -> 776 bytes .../scratchpad/Test_Label_0$TestSuite.class | Bin 1464 -> 1541 bytes tester/scratchpad/Test_Label_0.class | Bin 745 -> 752 bytes .../Test_NodeList_0$TestSuite.class | Bin 1413 -> 1506 bytes tester/scratchpad/Test_NodeList_0.class | Bin 763 -> 770 bytes tester/scratchpad/Test_Node_0$TestSuite.class | Bin 2884 -> 3041 bytes tester/scratchpad/Test_Node_0.class | Bin 739 -> 746 bytes .../Test_TokenSet_0$TestSuite.class | Bin 1819 -> 1912 bytes tester/scratchpad/Test_TokenSet_0.class | Bin 763 -> 770 bytes .../scratchpad/Test_Token_0$TestSuite.class | Bin 1738 -> 1815 bytes tester/scratchpad/Test_Token_0.class | Bin 745 -> 752 bytes tester/scratchpad/Test_Util_0$TestSuite.class | Bin 1890 -> 1975 bytes tester/scratchpad/Test_Util_0.class | Bin 739 -> 746 bytes 83 files changed, 1045 insertions(+), 398 deletions(-) create mode 100644 developer/document/GraphDirectedAcyclic_1.txt create mode 100644 developer/javac/Ariadne_File.java create mode 100644 developer/javac/Ariadne_Graph.java create mode 100644 developer/javac/Ariadne_GraphDirectedAcyclic.java create mode 100644 developer/javac/Ariadne_Label.java create mode 100644 developer/javac/Ariadne_LabelList.java create mode 100644 developer/javac/Ariadne_Node.java create mode 100644 developer/javac/Ariadne_NodeList.java create mode 100644 developer/javac/Ariadne_Production.java create mode 100644 developer/javac/Ariadne_ProductionList.java create mode 100644 developer/javac/Ariadne_Token.java create mode 100644 developer/javac/Ariadne_TokenSet.java create mode 100644 developer/javac/Ariadne_Util.java create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_File.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Graph.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_GraphDirectedAcyclic$1.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_GraphDirectedAcyclic$2.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_GraphDirectedAcyclic.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Label.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_LabelList.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Node.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_NodeList.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Production.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_ProductionList.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Token.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_TokenSet.class create mode 100644 developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Util.class rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/File.java (88%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/Graph.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/GraphDirectedAcyclic.java (79%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/Label.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/LabelList.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/Node.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/NodeList.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/Production.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/ProductionList.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/Token.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/TokenSet.java (100%) rename developer/{javac => scratchpad/com/ReasoningTechnology/Ariadne}/Util.java (100%) create mode 100644 tester/deprecated/Test_File_0.java create mode 100644 tester/deprecated/Test_Graph_0.java rename {developer => tester/deprecated}/scratch_pad/.gitignore (100%) delete mode 100644 tester/javac/#Test_Node_0.java# delete mode 100644 tester/javac/In.java delete mode 100644 tester/javac/TestMosaicUtil.java delete mode 100644 tester/scratch_pad/.gitignore delete mode 100644 tester/scratchpad/In$MIO.class delete mode 100644 tester/scratchpad/In$MU.class delete mode 100644 tester/scratchpad/In$TB.class delete mode 100644 tester/scratchpad/In$TestBench.class delete mode 100644 tester/scratchpad/In.class delete mode 100644 tester/scratchpad/MU.class diff --git a/developer/document/GraphDirectedAcyclic_1.txt b/developer/document/GraphDirectedAcyclic_1.txt new file mode 100644 index 0000000..7a202e2 --- /dev/null +++ b/developer/document/GraphDirectedAcyclic_1.txt @@ -0,0 +1,84 @@ + /*-------------------------------------------------------------------------------- + Interface + + 1. nodes are referenced by label. + + 2. A list is a kind of sequence. It consists of a leftmost item, subsequent + items, and a rightmost item. + + 3. A node list consists of a leftmost node, subsequent nodes, and a rightmost node. + + 4. `path_stack` + + The `path_stack` is a list. Each item in the stack is a node list. + + The rightmost items is the top of the stack. + + The leftmost item is a list of root nodes, where traversal of the graph + starts. + + Given two adjacent items on the path stack, say e0 and e1: + + Say k0 is the leftmost node on the node list e0. + + The e1 will be the neighbor (child) list from node k0. + + Hence, the path stack consists of the child lists of nodes along + a traversal. We chose a leftmost traversal. + + e0: k_0 k_1 ... k_2 + + e1: k_0_0 k_0_1 ... k_0_2 ; children of k_0 + + e2: K_0_0_0 k_0_0_1 ... k_0_0_2 ; children of k_0_0 + + + 5. `path` + + A list of the leftmost nodes from a path stack. + + Given that e0 is a root node, `path` will consist of + + k_0, k_0_0, k_0_0_0 ... k_0_0..._0 + + Within the context of a path, k_0 is the leftmost item, and k_n is the + rightmost item. + + + 6. removing a cycle + + This is a build tool. Each node corresponds to a build objective, and the + neighbor nodes are dependencies. A neighbor node is a child node in our + tree descent, and is a dependency to our build tool. + + This routine is called as part of the analysis phase. Nothing is + built here, rather we are merely marking dependency cycles that we + find when descending from the root nodes. + + When we find a cycle, we remove those nodes from the current traversal + path, because we do not went the analysis to do in circles. It is + possible that there are spurs that emanate from the cycle, and following + these might lead to finding more cycles. + + Our build tool (which is not in this file) will stop descending through + the graph upon finding a cycle, and the effects of this will cause + upstream nodes to also not be built. Hence, the cycles hidden behind + other cycles are irrelevant. + + However, if we want to make routine of more general use, then the + discovered cycles should be pushed on to a cycle stack, and then each + item on the cycle stack would be used as root nodes for a new cycle + search. Note the leftmost cycle on each recursive search on the leftmost + node, will be the original cycle. + */ + + /* + Given a path to a node in the graph, `left_path`. + + Checks if the rightmost node (referenced by label) recurs earlier in the path. + Presumably the rightmost node has been recently appended to the path. + + If there is no cycle, returns null, otherwise returns the interval [i ,n], + of indexes into the path where the cycle is found. `n` will always be + the index of the rightmost node in the path list. + */ diff --git a/developer/javac/Ariadne_File.java b/developer/javac/Ariadne_File.java new file mode 100644 index 0000000..825b499 --- /dev/null +++ b/developer/javac/Ariadne_File.java @@ -0,0 +1,76 @@ +package com.ReasoningTechnology.Ariadne; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Ariadne_File { + static boolean debug = false; + + public static Map unpack_file_path(String file_fp) { + if (debug) System.out.println("unpack_file_path::file_fp: " + file_fp); + + // Use java.io.File explicitly to avoid conflict with the custom Ariadne_File class + java.io.File file = new java.io.File(file_fp); + String parent_dp = (file.getParent() != null) ? file.getParent() : ""; + + if (!parent_dp.isEmpty() && !parent_dp.endsWith(java.io.File.separator)) { + parent_dp += java.io.File.separator; + } + + String file_fn = file.getName(); + String file_fn_base = file_fn; + String file_fn_ext = ""; + + int last_index = file_fn.lastIndexOf('.'); + if (last_index > 0) { + file_fn_base = file_fn.substring(0, last_index); + if (last_index + 1 < file_fn.length()) { + file_fn_ext = file_fn.substring(last_index + 1); + } + } + + Map ret_val = new HashMap<>(); + ret_val.put("dp", parent_dp); + ret_val.put("fn", file_fn); + ret_val.put("fn_base", file_fn_base); + ret_val.put("fn_ext", file_fn_ext); + + if (debug) System.out.println("unpack_file_path::ret_val: " + ret_val); + + return ret_val; + } + + public static boolean file_exists_q(String fp_string) { + Path fp_object = Paths.get(fp_string); + return Files.exists(fp_object); + } + + /* + Given a target_fp and a list of dependency_fp. + + Returns false if the target is newer than all dependencies or if a file is missing; + otherwise, returns true. + */ + public static boolean newer_than_all(String target_fp_string, List dependency_fp_list) throws IOException { + Path target_fp_object = Paths.get(target_fp_string); + if (!Files.exists(target_fp_object)) return false; + + long target_last_modified_time = Files.getLastModifiedTime(target_fp_object).toMillis(); + + return dependency_fp_list.stream().allMatch(dependency_fp -> { + try { + Path dependency_fp_object = Paths.get(dependency_fp); + if (!Files.exists(dependency_fp_object)) return false; + long dependency_last_modified_time = Files.getLastModifiedTime(dependency_fp_object).toMillis(); + return target_last_modified_time > dependency_last_modified_time; + } catch (IOException e) { + return false; + } + }); + } +} diff --git a/developer/javac/Ariadne_Graph.java b/developer/javac/Ariadne_Graph.java new file mode 100644 index 0000000..2dd28b6 --- /dev/null +++ b/developer/javac/Ariadne_Graph.java @@ -0,0 +1,62 @@ +package com.ReasoningTechnology.Ariadne; + +import java.util.HashMap; +import java.util.Map; + +public class Ariadne_Graph { + + /*-------------------------------------------------------------------------------- + constructors + */ + + public Ariadne_Graph(Map node_map, Ariadne_ProductionList recognizer_f_list) { + if (node_map == null && recognizer_f_list == null) { + System.err.println("Ariadne_Graph: At least one of 'node_map' (Map) or 'recognizer_f_list' (List) must be provided."); + System.exit(1); + } + + // Initialize each of node_map and recognizer_f_list to empty collections if null + this.node_map = (node_map != null) ? node_map : new HashMap<>(); + this.recognizer_f_list = (recognizer_f_list != null) ? recognizer_f_list : new Ariadne_ProductionList(); + } + + /*-------------------------------------------------------------------------------- + instance data + */ + + private static boolean debug = true; + private Map node_map; + private Ariadne_ProductionList recognizer_f_list; + + /*-------------------------------------------------------------------------------- + interface + */ + + // Lookup method to find a node by its label + public Ariadne_Node lookup(Ariadne_Label node_label, boolean verbose) { + if (node_label == null || node_label.isEmpty()) { + if (verbose) { + System.out.println("lookup:: given node_label is null or empty."); + } + return null; + } + + // Try to retrieve the node from the map + Ariadne_Node node = this.node_map.get(node_label); + + if (verbose) { + if (node != null) { + System.out.println("lookup:: found node: " + node); + } else { + System.out.println("lookup:: node not found for label: " + node_label); + } + } + + return node; + } + + // Overloaded lookup method with default verbosity (true) + public Ariadne_Node lookup(Ariadne_Label node_label) { + return lookup(node_label, true); + } +} diff --git a/developer/javac/Ariadne_GraphDirectedAcyclic.java b/developer/javac/Ariadne_GraphDirectedAcyclic.java new file mode 100644 index 0000000..3a8e9e2 --- /dev/null +++ b/developer/javac/Ariadne_GraphDirectedAcyclic.java @@ -0,0 +1,214 @@ +package com.ReasoningTechnology.Ariadne; + +import java.util.HashMap; +import java.util.Map; +import java.util.List; +import java.util.ArrayList; + +public class Ariadne_GraphDirectedAcyclic extends Ariadne_Graph { + + /*-------------------------------------------------------------------------------- + Constructors + */ + + public Ariadne_GraphDirectedAcyclic(Map node_map, Ariadne_ProductionList recognizer_f_list, Ariadne_LabelList root_node_list, int max_depth, boolean verbose) { + super(node_map, recognizer_f_list); + Ariadne_TokenSet cycle_detection_result = graph_mark_cycles(root_node_list, max_depth, verbose); + } + + public Ariadne_GraphDirectedAcyclic(Map node_map, Ariadne_ProductionList recognizer_f_list, Ariadne_LabelList root_node_list) { + super(node_map, recognizer_f_list); + Ariadne_TokenSet cycle_detection_result = graph_mark_cycles(root_node_list); + } + + /*-------------------------------------------------------------------------------- + Instance Data Extension + */ + + private static boolean debug = true; + + /*-------------------------------------------------------------------------------- + Interface + */ + + private List path_find_cycle(Ariadne_LabelList path) { + if (path.size() <= 1) return null; + + int rightmost_index = path.size() - 1; + Ariadne_Label rightmost_node_label = path.get(rightmost_index); + + int cycle_leftmost_index = path.indexOf(rightmost_node_label); + Boolean has_cycle = cycle_leftmost_index < rightmost_index; + if (!has_cycle) return null; + + List result = new ArrayList<>(); + result.add(cycle_leftmost_index); + result.add(rightmost_index); + return result; + } + + private boolean graph_descend_cycle_case(Ariadne_LabelList left_path, List path_stack, boolean verbose) { + + List cycle_index_interval = path_find_cycle(left_path); + if (cycle_index_interval == null) { + return false; + } + + int cycle_i0 = cycle_index_interval.get(0); + int cycle_n = cycle_index_interval.get(1); + + if (verbose) Ariadne_Util.print_list( + "Found cycle:", + left_path.subList(cycle_i0, cycle_n + 1) + ); + + Ariadne_LabelList undefined_node_list = new Ariadne_LabelList(); + for (int i = cycle_i0; i <= cycle_n; i++) { + Ariadne_Label node_label = left_path.get(i); + Ariadne_Node node = super.lookup(node_label); + if (node != null) { + node.mark(new Ariadne_Token("cycle_member")); + } else { + undefined_node_list.add(node_label); + } + } + + if (verbose) Ariadne_Util.print_list( + "Each undefined node could not be marked as a cycle member:", + undefined_node_list + ); + + path_stack.subList(cycle_i0 + 1, cycle_n + 1).clear(); + + return true; + } + + private static Ariadne_TokenSet graph_descend_set = new Ariadne_TokenSet() {{ + add(new Ariadne_Token("empty_path_stack")); + add(new Ariadne_Token("cycle_found")); + add(new Ariadne_Token("undefined_node")); + add(new Ariadne_Token("leaf")); + add(new Ariadne_Token("max_depth_reached")); + }}; + + private Ariadne_TokenSet graph_descend(List path_stack, int max_depth, boolean verbose) { + Ariadne_TokenSet ret_value = new Ariadne_TokenSet(); + + if (path_stack.isEmpty()) { + ret_value.add(new Ariadne_Token("empty_path_stack")); + return ret_value; + } + + Ariadne_LabelList left_path = new Ariadne_LabelList(); + for (Ariadne_LabelList neighbor_list : path_stack) { + left_path.add(neighbor_list.get(0)); + } + + do { + + if (graph_descend_cycle_case(left_path, path_stack, verbose)) { + ret_value.add(new Ariadne_Token("cycle_found")); + return ret_value; + } + + Ariadne_Label it_node_label = path_stack.get(path_stack.size() - 1).get(0); + Ariadne_Node it_node = super.lookup(it_node_label); + if (it_node == null) { + ret_value.add(new Ariadne_Token("undefined_node")); + return ret_value; + } + + Ariadne_LabelList neighbor_list = it_node.neighbor_LabelList(); + if (neighbor_list.isEmpty()) { + ret_value.add(new Ariadne_Token("leaf")); + return ret_value; + } + + path_stack.add(new Ariadne_LabelList(neighbor_list)); + Ariadne_Label it_next_label = neighbor_list.get(0); + left_path.add(it_next_label); + + if (max_depth > 0) { + max_depth--; + if (max_depth == 0) { + if (verbose) { + Ariadne_Util.print_list("GraphDirectedAcyclic.GraphDescend:: max_depth reached, ending descent:", path_stack); + } + ret_value.add(new Ariadne_Token("max_depth_reached")); + return ret_value; + } + } + + } while (true); + } + + public static Ariadne_TokenSet graph_mark_cycles_set = new Ariadne_TokenSet() {{ + add(new Ariadne_Token("empty_root_label_list")); + add(new Ariadne_Token("cycle_exists")); + add(new Ariadne_Token("undefined_node_exists")); + add(new Ariadne_Token("bad_descent_termination")); + add(new Ariadne_Token("max_depth_reached")); + }}; + + public Ariadne_TokenSet graph_mark_cycles(Ariadne_LabelList root_node_LabelList, int max_depth, boolean verbose) { + Ariadne_TokenSet ret_value = new Ariadne_TokenSet(); + boolean exists_malformed = false; + Ariadne_TokenSet result; + + if (root_node_LabelList.isEmpty()) { + ret_value.add(new Ariadne_Token("empty_root_label_list")); + return ret_value; + } + + List path_stack = new ArrayList<>(); + path_stack.add(new Ariadne_LabelList(root_node_LabelList)); + + do { + result = graph_descend(path_stack, max_depth, verbose); + if (result.contains(new Ariadne_Token("cycle_found"))) ret_value.add(new Ariadne_Token("cycle_exists")); + if (result.contains(new Ariadne_Token("undefined_node"))) ret_value.add(new Ariadne_Token("undefined_node_exists")); + if (result.contains(new Ariadne_Token("max_depth_reached"))) ret_value.add(new Ariadne_Token("max_depth_reached")); + if (!result.contains(new Ariadne_Token("leaf")) && !result.contains(new Ariadne_Token("cycle_found"))) ret_value.add(new Ariadne_Token("bad_descent_termination")); + + Ariadne_LabelList top_list = path_stack.get(path_stack.size() - 1); + top_list.remove(0); + if (top_list.isEmpty()) path_stack.remove(path_stack.size() - 1); + + } while (!path_stack.isEmpty()); + + if (verbose) { + if (ret_value.contains("bad_descent_termination")) { + System.out.println("GraphDirectedAcyclic.graph_mark_cycles:: terminated with unexpected condition."); + } + if (ret_value.contains("cycle_exists")) { + System.out.println("GraphDirectedAcyclic.graph_mark_cycles:: One or more cycles detected."); + } + if (ret_value.contains("undefined_node_exists")) { + System.out.println("GraphDirectedAcyclic.graph_mark_cycles:: Undefined nodes exist."); + } + } + + return ret_value; + } + + public Ariadne_TokenSet graph_mark_cycles(Ariadne_LabelList root_node_LabelList) { + return graph_mark_cycles(root_node_LabelList, this.debug ? 40 : -1, this.debug); + } + + @Override + public Ariadne_Node lookup(Ariadne_Label node_label, boolean verbose) { + Ariadne_Node node = super.lookup(node_label, verbose); + if (node != null && node.has_mark(new Ariadne_Token("cycle_member"))) { + if (verbose) { + System.out.println("GraphDirectedAcyclic.lookup:: Node is part of a cycle, not returned: " + node_label); + } + return null; + } + return node; + } + + public Ariadne_Node lookup(Ariadne_Label node_label) { + return lookup(node_label, this.debug); + } + +} diff --git a/developer/javac/Ariadne_Label.java b/developer/javac/Ariadne_Label.java new file mode 100644 index 0000000..9f10fcb --- /dev/null +++ b/developer/javac/Ariadne_Label.java @@ -0,0 +1,42 @@ +package com.ReasoningTechnology.Ariadne; + +/* + A value for the node.label property. + + This is a wrapper for a String. We can't instead use an alias by extending + String, because String is a JavaScript 'final' type. + +*/ +public class Ariadne_Label{ + private final String value; + + public Ariadne_Label(String value){ + this.value = value; + } + + public boolean isEmpty(){ + return value.isEmpty(); + } + + public String get(){ + return value; + } + + @Override + public String toString(){ + return value; + } + + @Override + public boolean equals(Object o){ + if(this == o) return true; + if( o == null || getClass() != o.getClass() ) return false; + Ariadne_Label label = (Ariadne_Label)o; + return value.equals( label.value ); + } + + @Override + public int hashCode(){ + return value.hashCode(); + } +} diff --git a/developer/javac/Ariadne_LabelList.java b/developer/javac/Ariadne_LabelList.java new file mode 100644 index 0000000..ae2dd0b --- /dev/null +++ b/developer/javac/Ariadne_LabelList.java @@ -0,0 +1,18 @@ +// LabelList.java +package com.ReasoningTechnology.Ariadne; +import java.util.List; +import java.util.ArrayList; + +public class Ariadne_LabelList extends ArrayList{ + // Constructor + public Ariadne_LabelList(){ + super(); + } + public Ariadne_LabelList(List labels){ + super(); // Initialize the parent class + if(labels != null){ + this.addAll(labels); // Copy all elements from the provided list + } + } + +} diff --git a/developer/javac/Ariadne_Node.java b/developer/javac/Ariadne_Node.java new file mode 100644 index 0000000..41d8ccd --- /dev/null +++ b/developer/javac/Ariadne_Node.java @@ -0,0 +1,30 @@ +package com.ReasoningTechnology.Ariadne; +import java.util.HashMap; + +public class Ariadne_Node extends HashMap { + + private static String mark_property_name = "mark"; + private static String neighbor_property_name = "neighbor"; + + public Ariadne_Node() { + super(); + this.put(neighbor_property_name, new Ariadne_LabelList()); + } + + public void mark(Ariadne_Token token) { + if (this.get(mark_property_name) == null) { + this.put(mark_property_name, new Ariadne_TokenSet()); + } + ((Ariadne_TokenSet) this.get(mark_property_name)).add(token); + } + + public boolean has_mark(Ariadne_Token token) { + Ariadne_TokenSet mark = (Ariadne_TokenSet) this.get(mark_property_name); + return mark != null && mark.contains(token); + } + + public Ariadne_LabelList neighbor_LabelList() { + return (Ariadne_LabelList) this.get(neighbor_property_name); + } + +} diff --git a/developer/javac/Ariadne_NodeList.java b/developer/javac/Ariadne_NodeList.java new file mode 100644 index 0000000..69e4284 --- /dev/null +++ b/developer/javac/Ariadne_NodeList.java @@ -0,0 +1,10 @@ +// NodeList.java +package com.ReasoningTechnology.Ariadne; +import java.util.ArrayList; + +public class Ariadne_NodeList extends ArrayList { + // Constructor + public Ariadne_NodeList(){ + super(); + } +} diff --git a/developer/javac/Ariadne_Production.java b/developer/javac/Ariadne_Production.java new file mode 100644 index 0000000..ab6aed9 --- /dev/null +++ b/developer/javac/Ariadne_Production.java @@ -0,0 +1,5 @@ +// Production.java +package com.ReasoningTechnology.Ariadne; +import java.util.function.Function; + +public interface Ariadne_Production extends Function {} diff --git a/developer/javac/Ariadne_ProductionList.java b/developer/javac/Ariadne_ProductionList.java new file mode 100644 index 0000000..03b2461 --- /dev/null +++ b/developer/javac/Ariadne_ProductionList.java @@ -0,0 +1,10 @@ +// ProductionList.java +package com.ReasoningTechnology.Ariadne; +import java.util.ArrayList; + +public class Ariadne_ProductionList extends ArrayList { + // Constructor + public Ariadne_ProductionList(){ + super(); + } +} diff --git a/developer/javac/Ariadne_Token.java b/developer/javac/Ariadne_Token.java new file mode 100644 index 0000000..98e3863 --- /dev/null +++ b/developer/javac/Ariadne_Token.java @@ -0,0 +1,35 @@ +package com.ReasoningTechnology.Ariadne; + +/* +An error token. + +*/ +public class Ariadne_Token { + private final String value; + + public Ariadne_Token(String value){ + this.value = value; + } + + public String get(){ + return value; + } + + @Override + public String toString(){ + return value; + } + + @Override + public boolean equals(Object o){ + if(this == o) return true; // No padding, not nested + if( o == null || getClass() != o.getClass() ) return false; // Padded, because it's nested + Ariadne_Token token = (Ariadne_Token)o; + return value.equals( token.value ); + } + + @Override + public int hashCode(){ + return value.hashCode(); + } +} diff --git a/developer/javac/Ariadne_TokenSet.java b/developer/javac/Ariadne_TokenSet.java new file mode 100644 index 0000000..9ec671c --- /dev/null +++ b/developer/javac/Ariadne_TokenSet.java @@ -0,0 +1,10 @@ +// TokenSet.java +package com.ReasoningTechnology.Ariadne; +import java.util.HashSet; + +public class Ariadne_TokenSet extends HashSet { + // Constructor + public Ariadne_TokenSet(){ + super(); + } +} diff --git a/developer/javac/Ariadne_Util.java b/developer/javac/Ariadne_Util.java new file mode 100644 index 0000000..28009b3 --- /dev/null +++ b/developer/javac/Ariadne_Util.java @@ -0,0 +1,25 @@ +package com.ReasoningTechnology.Ariadne; +import java.util.List; + +public class Ariadne_Util{ + static boolean debug = false; + + public static void print_list(String prefix ,List item_list){ + if( item_list == null || item_list.isEmpty() ){ + return; + } + if( prefix != null && !prefix.isEmpty() ){ + System.out.print(prefix); + } + int i = 0; + int n = item_list.size() - 1; + System.out.print( " '" + item_list.get(i) + "'" ); + do{ + i++; + if( i > n ) break; + System.out.print(", " + "'" + item_list.get(i) + "'"); + }while( true ); + System.out.println("."); + } + +} diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_File.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_File.class new file mode 100644 index 0000000000000000000000000000000000000000..4b98d4991f981f6d89eef0f37f8fa130fe05b9d2 GIT binary patch literal 4576 zcmcIn`Fj)B6+I)#8c8055!jAna3DC;D+Ww9n-Z2lF_o8MHx$xVjHQu1Sej9!5wY7e zNmsfrY1$^VfhJu@TDMI|W58+BJxxQprF;JtzNY8B8ObB8Ce05ud^7Le_wIf7o_p?n zqgVdD^df*;@vj)RAQ{C?I1z=8sW_#X7^X3!!i*t|lj1QOK{kdqLY`M9R+fA2IZzZJE~eq>-Aj?5sUK z-@ljJ)0R6m0HHoYYV0{aM|b?w@c9v@_J@ib{@| z?H|$eR8*x#CNKP1v7O$FWd*C;HPi0*&Wq;tf?+wyG!;D)mIBQ+W+kWeBDLzvQ)A9i z5Xy|CZ8ZFk(Q0v?X zETSze^^Y^1j9`^z+-nq)&Wvs)^(;}lsfJx2ItiXX)Wvfe9lbD3sC~!9(?;H4Cal!F z5NElS`>s{4QZ0Me>RFT7%-Lx(V;bqCW9EpWa#%sfHCAfCwtGm$S4fBhb15V5n6^d6 z-~Q&o)U+f5Y{}}mskGiv4N%861%0VoHz!6&X6AcJgjEiya9W0eR5 z!+g4;o+7(aS+5hsChSrnWgL{Xw8kr8S-M*V@ilazTf^JXsp6{|zJ^DL{65=u$PPU} zVmLE)y0|)wMbK*JOGmWFR*K*M)%AcF4- z)$`Adt>$cpA@elwpCZnR0E1IbvBy za6y=TmJUm8AI>U%tl>EjAKa*r#5sM|*l$}Y-8pJH zGaMBi-EvqOTWXYs*T{WvlYtdbe5W&KdErZz*{j)zctu6o9mZupXJK^KG_9J&1G&62 zFK;!`yNU*H0Nt?*Bsx1uQTR-fD2(K`8vfR(!j&TWN>4_0(Msw?`3;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Ariadne_Graph.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Graph.class new file mode 100644 index 0000000000000000000000000000000000000000..62d332436b32b9b5df8d8cf8e0f4cdce950803e9 GIT binary patch literal 3058 zcmcImZF3V<6n<`!X47;_OAAHiZNWnG(l#K9*wi9aN`X+2RuE9bCb>5B~Yi6$LTXycUSsU^8NtRa}*LJJxxig++Rvh{ITP&C*Y3I8ZU!Xtv85-Z|$+BB@tnZ~) zTrS#H!xuQ!HOy7dtu)KNoa52>xN%yY3ftkK85SyjDiaN`Y3(Z=FU*TEt~drlVot++Kl-tRzo1ybrk14v%W&-M>^5g>#q^}7k#t5%4`J|G<+fO z;~Vk)-B2t(#d4s%lbQb{z+CLc=v3i&zpU zc1TPaXMDrv4fhS#k%qf$j0F_3S&SJe)?C_fJ!9;xYsy1)=h8;4N!5}x>Ylr1Rb*vS z!8>oZ5B6^|N7gz-7S|iTtO-P==Lzf% zd!6Oxu6mZ^FZ!M|YiuaP0YK+AYrL+6Y=?TSCK6bs7F&Ei=y&ovi}quw3u@JMB*7&j zzSTIVn5K8BG=Dx(w@I*QRdPJqZZV8ApANlm3!VSMW$@QEvXRzhx9L=Zv`!g9U{B3l zm9wr>HvJoxzrtC=Hyxi{_iXpqPbId)c#8pn(G9z*kZ9I7LI;*vML}-~yqN9YR@h(K zBW)Seu%b$b&1!VB04!(CU6r{|Bn)%TEc>pvu7PQb7h3&Pzu-91o3+hGLo)Us+R1HU zgw;B4Iu%YCX`6h7S zzvXa9Y7+fFX>Q8D!`8}O^3Xy$*;qez3 zc!u z?7{%u8Ag_~89MnsPmRzdMsb8I8gIF(X3EJ3j&fJ0qv6>;&c-;OL(eOMMK$c!kka@H z#60J(_%>|Yi-gCQ{_Ui`WXL5ie;q#&3b~CbLhV-^0#*_t5tc{X;v*g?Nzp z8Hwz#7>M8x3@-5O@WgWr@qFSLb^?^Suc+(KJ_BE%TuwY7UKEOz4ATNe+sDWT7|R}{ z8S?~ZIeKu6<8iWc0vGv|RSac9Up5#jV4Tv5j{+u1L4=w|sCA6^iWwa}eSP9DjA|I{ z3*tK7iYrfv2qm;kHueO=%B4u)Qapg04$O^&A{*wkmbnBzpi?11`vZBPC-w-tRK7(U h%wAggFo6CDtNbQ;YN3X^jPg9!J7{2@dl!Q7(m&(YL!gr4LtFXsG=%&(jt*4r3J~_tS7NsXE(APL_UI# z;e|>d@d11kV(f;8NO{OgJF{nY=XQ4f{QdbGz*AHTDB`+}8xC$3ki)G43b^fH)xjMH zYYx_J+_iB}V6GnMAlVVfS2o)M)}HZ5V4)FcIvDml6t!e0WJ|eWlnmQ43Q{~aT8SUT z0;M-vQ?wV#I3|YA8p`ymA4tYV2fEiH$qr?U4f;( z{OWo%;0O^(Rz>(M9gz79hbcH zxS@&L_ni~|&f4ZN)_CTMJdS|i%|F0;o=@LkWtMkaXAoPzkUJ{p&tUz)g~M|+H-YR4 zK8WAvTF=CHtW6*kK@r#M6zAGwGlY~vVpe8O9N#vmN$`gr4dR7|L={!J6N*HlB6zVj>mlCa>_+wmH6OtP z_wV3^N+9t8d=z4G0Vz@+V#zZ;GoH(tncshY`~q+rl|1Hg*26g;=kv(mLLPZs^s(gQ zl8wZkv*pY{zUVHms8Iu1xe0PmDPi z=~STb$QVktW0|JJ@J>V7ZuL3I)EaF%EmD!OvF!}1TO1u4`lo{jiR?vpbwbKfxTOXv z)@t=uO(5U2{Y24yJuJO42|M)njXn8Ra>MtGifzi}o|21f=wVgB-=Wk!w5cngfMWtT zX6>tG-;fa~QMcy?L1L{7V%erRi1j$x)dH^JIx`>kOabk)otc;VCZyLqx-c+2$N%9pk%i(R?To}P<>grtfn6xf`#&BMnhaC6oKBc4ri0`*x#4y(z; zD~;hEsRN@0B$_e*q|O^YH)x literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_GraphDirectedAcyclic.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_GraphDirectedAcyclic.class new file mode 100644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&b^+TEBIMjtj@F8C{{@sYELfgc5PciRagsV|NogpQLfZ0?*liqRAd#vEE@+cliHl>G#HrK^ z{{~JufCNS2fH-mBMbIT2u55czyPzYzJvneyoNT7Uo;wt%H#G literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_LabelList.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_LabelList.class new file mode 100644 index 0000000000000000000000000000000000000000..079acaf861698d54db304d99a813e55108faaf74 GIT binary patch literal 877 zcmb7CO>fgc5Ph4tF)?nEwh$dx-D zLU7`TMxmM5%)Fgk4orTg2acZ2#HZSw>)eVxcLv3U9V;9rslV*JGkWYZn~ly)dXahO zN7GJ^>BG$2=#PmW7?;>_(N);mNj~Xo-I)~DbxNNQs5wa?XlpsD(Egvp^y-F3Zz=a^ zHA3BE(pm2pI{o}cUzNRuc%o46+fk;ANzVRXFSA|!4r%Z77Smpy>!~!pI+Q}x_mey| zr&gBJp3iwP-vb$Kj5X9^JjFAGmn*M`8(Qq=A6JFO!YkytGCdsjoKx7oJ);xvoJkAo zv+nK(yx^M)_y&Orl+dCKX&q84>b1RZP+!XM9m78{uG4PtYn71gS=k(t0E{;X-DJ(|I`OpV*${ZBKMYqw VR6{}nTRauq4N4xYq_zMdC*(d-2 literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Node.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Node.class new file mode 100644 index 0000000000000000000000000000000000000000..e03285e0bc5d795898f7651dafe77b1102ed48ce GIT binary patch literal 1573 zcmbVMT~8B16g|_HcG)f>6^ei;enAVB0*V4{h{lBYP%yCsqc3DyHtj;Y+ibTc{1ktI zFFvRwkVs;9(!}3njAyn>CBj4TWoPEjz2}_!vGeoy*KYuxAg`kz>0VsHbPO{(!bs~p zWR&HB+Ret0)uAb~hB@__*D$JKA%=%BJQ7IMrMtJ?aGi$fdi&e9teZ3zcI7*ntx3C* zEqbnHS8@VL+q5dxlH>mC9nD*|<*f>YQ|T>%$a80h82tsyHaA-JlId>BQq4zo%Cfd4 zT}zz8Fq}w#hRokgKmHq59y6@QL>AJl^bgGFc-2w}#t^+rn zJ=4x9g*~3y3S=)CE6`W;WO;90HUjlpRW`T(SIJw-znp@i=`r<0rx68NGHV5^=?N^R z(p_V9!U(42%eA0=y+x~HORwd!SIg}QXn9sG`$9IWOgVpkD9%`3mUhjums=&IUUXV+ z*<7Qy1;s4Khb$ZYCh0(wKGUjwir5^}% zCzKoIE63rF@>RX5wDMH2)v0yu8Sa!i7;$Div6aj86V)4^Zp;5luj-NnA=(1hyKXFS z^3RSqL%`RppWx5Yj2%|DjRxA6?+_av1c(@8W?+wvT}B{b8=F|g%mMZrOmNWf;Sae! BaH{|S literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Production.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Production.class new file mode 100644 index 0000000000000000000000000000000000000000..776a9af807e59bbd15b7e50f3d9dd0463532f92d GIT binary patch literal 349 zcmX^0Z`VEs1_pBmZgvI^b_Py%1};Vh&fv`Syu^~yqEtqPKA)__vPAuy#JqHU|D>$c zRdl4@;d&B(wNoL^d$oa&aD19Y7@)YSNZqWqLnuv7Fv?qy^! sBGw%Uos0|u=ze8nkOm83_beMD10w?y5HkaVkO9bI0h6o@Y+#xl0OG4|>;M1& literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_ProductionList.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_ProductionList.class new file mode 100644 index 0000000000000000000000000000000000000000..c02c0d13698aebb48942e3de49d62c60d7052b92 GIT binary patch literal 460 zcmbVI!AiqG6r4@d#>QxCJ$mw{9?U^dp`}m+F9s1?dX;Umq)*aa*lY^@EKh<5KfsR? zUqZczr|!ZG^O*PE?0$WJd;++^AVdqj0Q~?*0-X_Qa$|wk+4)?+zcZN<=q04pW3^f+ zJClooD}%(OvY1OtwcZwex1>_wHc8DYepa$Hnsh!>=~A1*Oky;*AR)0>+RT*kfat5s28vCRQP{hy4a4 I95j6R1Cyb9M*si- literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Token.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Token.class new file mode 100644 index 0000000000000000000000000000000000000000..79242712b7531e4835660babd3fb94f3285af238 GIT binary patch literal 972 zcmb7C%Wl&^6g?Biwd=ZRDJhh;fre-70G8OWC_+M&Dj}sHk*EtcXyRIlTi1rfslrkFZFOqT3Yo~)S?rjUqJqY74eJHTnID72u3zT<~0~Rl}!Z>&` zI_?I8j_gKRyTq5#z8r)qE;h?)KO72pEk8N-o&|E4#Kh?Yem_p4r1#o;#PowW_&vYq zBu7C^9$GI*1*#3_EDHfMO>)BI8@w9Hh!8V;pLP!eKizho3y5S^X>mjwQUxWj*iNN? zv?pH{l+C^z_H&V1!+9)VwUg1n4|c;$WkEP6dRIAU!@^A)CgyG2LPOxre~C5V*r;OF z#yU0xmj7HzPL*CXl<_7V*@@(kTF=kel5Ntmsmk0P)cFbwz6v^^=y9cUZDE0<&1e@T zet_kEhH#soQ2M~Aghh@OXzGL=7FcOB1}@~;Si&+Rb*j43W1J&G-qXusBDo(?de5Z1 z-5j^ULe<93)_T!~a{jHj`qyGQS0KM3l;Z5T&3Dktdy3X= z{uAh9CTp4470LuI(X4f>VFNX6W?)-+!&AWyEx1Uy8a1rZgc56%shUwyF7N^iF84Sq Y!KQ+nU`|0z8&RLqVxAhYnPt^}0r*I-Pyhe` literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_TokenSet.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_TokenSet.class new file mode 100644 index 0000000000000000000000000000000000000000..c623bdce0534efbe3f2f2bbac8da8abc8324ff14 GIT binary patch literal 433 zcmb7A!AiqG6r7i)jg8UTf*;^bJs8o0hn9j=#6$34La(w-mt-~Fg=ACkvpfkN`~W|y z_!6oYPu+zX<}u7X-uLG73&0IVJ~|k9IPx$g^d?FxJ0)~Z&*lVoW|opLh?JI(^=cu@ zL@WxPj3SeYVlGP6=B5x_;4aJlQk zgyFvxaRP@=**xOU!Hhjt*R2M+=O3VV9ystAeP&>fjeSNSU>loQ`OFUXTMTf}^5GBj Cg>P;E literal 0 HcmV?d00001 diff --git a/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Util.class b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Ariadne_Util.class new file mode 100644 index 0000000000000000000000000000000000000000..cd8d2d7dd9a08483f045ba1b0f9751027a435381 GIT binary patch literal 1697 zcmb7ETXWM!7(MHoVnuNhhg;ilOB3SQA*Q#`)=3H&(xi2O;t*Px4x`wMvqY9Wmdwx}XXwBKk38@<`a60#D+zE&rk#4m+THJ_bH4AaUi|g+8G!S+VETzR$E-j>}>d)uKUU-KHavt@UcKF7vXu%mo|g<8XFmv2bh_gv++ zHf3YS^&GF&FJEMM)0HpRyEg;nR0PaUSGmDmNBM!kOrdt)eqfg!+ijKW0X?lsWa%-w zTw_p0L(6o!@}BxmL)jNEkX3&RF`kj|_Cf>+fDy|UhNIkF{ zyBl^VCY`OTmTL#SF1u3rZ|u5=hCj5_aN<^*b+6ZL$W^5qJ0ABa?9GB^W?>w81Irdx z@R@-N1}<8-gsOqd7Or5`!sl4Cu#PVT#x8kY;0Im1vmt{Wuj!9w@Z}I{7B+Bo2-nDX z!NPT&G>S2S`TsL1mVe#pYuoo_gX7ADrdOj8FqD6#-3j`kgs7;2oM@VRO?{t(VyxF= zvBOcvl~=y56~TCEx7qWF@FjcA)NLpmW*yM=P`tkSo*kuK7E&=LX~wk*JvX z3O6YBQ?p`L;Aq?4l~vDe*ugCo>~QA?wi{5`X9iys=MI*O)kTgRyl&sXH`I5{^LBe30c+iLWw+|szAp*l$3YNrjcC|ww%c^1 zKOH5;muCMp3N3pQH>vpp!td*-%Q`5P<^TMRTc&BC*^B~ZW?SCigNe2tr=@d3{{dOoD>qwsnDAJtEm A9smFU literal 0 HcmV?d00001 diff --git a/developer/javac/File.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/File.java similarity index 88% rename from developer/javac/File.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/File.java index 4058dc7..825b499 100644 --- a/developer/javac/File.java +++ b/developer/scratchpad/com/ReasoningTechnology/Ariadne/File.java @@ -4,16 +4,17 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.HashMap; import java.util.List; -import com.ReasoningTechnology.Mosaic.Mosaic_IO; +import java.util.Map; -public class File { +public class Ariadne_File { static boolean debug = false; public static Map unpack_file_path(String file_fp) { if (debug) System.out.println("unpack_file_path::file_fp: " + file_fp); - // Use java.io.File explicitly to avoid conflict with the custom File class + // Use java.io.File explicitly to avoid conflict with the custom Ariadne_File class java.io.File file = new java.io.File(file_fp); String parent_dp = (file.getParent() != null) ? file.getParent() : ""; @@ -50,10 +51,10 @@ public class File { } /* - Given a target_fp and a list of list of dependency_fp. + Given a target_fp and a list of dependency_fp. - Returns false if either the target is newer than all the dependencies, or one - of the specified files is missing. Otherwise returns true. + Returns false if the target is newer than all dependencies or if a file is missing; + otherwise, returns true. */ public static boolean newer_than_all(String target_fp_string, List dependency_fp_list) throws IOException { Path target_fp_object = Paths.get(target_fp_string); @@ -72,5 +73,4 @@ public class File { } }); } - } diff --git a/developer/javac/Graph.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Graph.java similarity index 100% rename from developer/javac/Graph.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/Graph.java diff --git a/developer/javac/GraphDirectedAcyclic.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/GraphDirectedAcyclic.java similarity index 79% rename from developer/javac/GraphDirectedAcyclic.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/GraphDirectedAcyclic.java index c71a2b9..f01e8de 100644 --- a/developer/javac/GraphDirectedAcyclic.java +++ b/developer/scratchpad/com/ReasoningTechnology/Ariadne/GraphDirectedAcyclic.java @@ -31,76 +31,6 @@ public class GraphDirectedAcyclic extends Graph{ /*-------------------------------------------------------------------------------- Interface - - 1. nodes are referenced by label. - - 2. A list is a kind of sequence. It consists of a leftmost item, subsequent - items, and a rightmost item. - - 3. A node list consists of a leftmost node, subsequent nodes, and a rightmost node. - - 4. `path_stack` - - The `path_stack` is a list. Each item in the stack is a node list. - - The rightmost items is the top of the stack. - - The leftmost item is a list of root nodes, where traversal of the graph - starts. - - Given two adjacent items on the path stack, say e0 and e1: - - Say k0 is the leftmost node on the node list e0. - - The e1 will be the neighbor (child) list from node k0. - - Hence, the path stack consists of the child lists of nodes along - a traversal. We chose a leftmost traversal. - - e0: k_0 k_1 ... k_2 - - e1: k_0_0 k_0_1 ... k_0_2 ; children of k_0 - - e2: K_0_0_0 k_0_0_1 ... k_0_0_2 ; children of k_0_0 - - - 5. `path` - - A list of the leftmost nodes from a path stack. - - Given that e0 is a root node, `path` will consist of - - k_0, k_0_0, k_0_0_0 ... k_0_0..._0 - - Within the context of a path, k_0 is the leftmost item, and k_n is the - rightmost item. - - - 6. removing a cycle - - This is a build tool. Each node corresponds to a build objective, and the - neighbor nodes are dependencies. A neighbor node is a child node in our - tree descent, and is a dependency to our build tool. - - This routine is called as part of the analysis phase. Nothing is - built here, rather we are merely marking dependency cycles that we - find when descending from the root nodes. - - When we find a cycle, we remove those nodes from the current traversal - path, because we do not went the analysis to do in circles. It is - possible that there are spurs that emanate from the cycle, and following - these might lead to finding more cycles. - - Our build tool (which is not in this file) will stop descending through - the graph upon finding a cycle, and the effects of this will cause - upstream nodes to also not be built. Hence, the cycles hidden behind - other cycles are irrelevant. - - However, if we want to make routine of more general use, then the - discovered cycles should be pushed on to a cycle stack, and then each - item on the cycle stack would be used as root nodes for a new cycle - search. Note the leftmost cycle on each recursive search on the leftmost - node, will be the original cycle. */ /* diff --git a/developer/javac/Label.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Label.java similarity index 100% rename from developer/javac/Label.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/Label.java diff --git a/developer/javac/LabelList.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/LabelList.java similarity index 100% rename from developer/javac/LabelList.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/LabelList.java diff --git a/developer/javac/Node.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Node.java similarity index 100% rename from developer/javac/Node.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/Node.java diff --git a/developer/javac/NodeList.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/NodeList.java similarity index 100% rename from developer/javac/NodeList.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/NodeList.java diff --git a/developer/javac/Production.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Production.java similarity index 100% rename from developer/javac/Production.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/Production.java diff --git a/developer/javac/ProductionList.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/ProductionList.java similarity index 100% rename from developer/javac/ProductionList.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/ProductionList.java diff --git a/developer/javac/Token.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Token.java similarity index 100% rename from developer/javac/Token.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/Token.java diff --git a/developer/javac/TokenSet.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/TokenSet.java similarity index 100% rename from developer/javac/TokenSet.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/TokenSet.java diff --git a/developer/javac/Util.java b/developer/scratchpad/com/ReasoningTechnology/Ariadne/Util.java similarity index 100% rename from developer/javac/Util.java rename to developer/scratchpad/com/ReasoningTechnology/Ariadne/Util.java diff --git a/developer/tool/distribute_source b/developer/tool/distribute_source index faf844d..6629cdc 100755 --- a/developer/tool/distribute_source +++ b/developer/tool/distribute_source @@ -1,32 +1,53 @@ #!/bin/env bash script_afp=$(realpath "${BASH_SOURCE[0]}") -# This script links the sources into the directory tree in parallel to the package. +# This script links the sources in javac into the directory tree that parallels +# the package name in scratch_pad. If the `-nolink` option is specified, +# it makes a copy instead of a link. # Input guards - - env_must_be="developer/tool/env" - if [ "$ENV" != "$env_must_be" ]; then - echo "$(script_fp):: error: must be run in the $env_must_be environment" - exit 1 - fi - - cd "$REPO_HOME"/developer - -# Link sources into the package tree - - package_tree="scratchpad/com/ReasoningTechnology/$PROJECT" - mkdir -p "$package_tree" - echo "Package: $package_tree" - - echo -n "Linking:" - for source_file in javac/*.java; do - echo -n " $(basename "$source_file")" - link_target="$package_tree/$(basename "$source_file")" +env_must_be="developer/tool/env" +if [ "$ENV" != "$env_must_be" ]; then + echo "$script_afp:: error: must be run in the $env_must_be environment" + exit 1 +fi + +cd "$REPO_HOME"/developer || exit 1 + +# Parse options +nolink=false +while [[ "$1" == -* ]]; do + case "$1" in + -nolink) nolink=true ;; + *) echo "$script_afp:: error: unknown option $1" && exit 1 ;; + esac + shift +done + +# Set up package tree +package_tree="scratchpad/com/ReasoningTechnology/$PROJECT" +mkdir -p "$package_tree" +echo "Package: $package_tree" + +# Process files +echo -n "$([[ $nolink == true ]] && echo "Copying" || echo "Linking"):" +for source_file in javac/*.java; do + echo -n " $(basename "$source_file")" + link_target="$package_tree/$(basename "$source_file")" + # Copy the file if -nolink option is provided, otherwise create a link + if [[ $nolink == true ]]; then + # Remove link if present, otherwise copy will try to overwrite the link target (and fail). + rm -f "$link_target" + cp "$source_file" "$link_target" + else + # Create a symbolic link if -nolink is not provided if [ ! -L "$link_target" ]; then ln -s "$(realpath --relative-to="$package_tree" "$source_file")" "$link_target" fi - done - echo "." + fi +done +echo "." + +echo "$script_afp done." + -echo "$(script_fp) done." diff --git a/release/Ariadne.jar b/release/Ariadne.jar index af08da9bc084cc0f1acfffdc52cde5e7dfa61832..968598e04d514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)0j*9@XXKcmn=25gwN*BD$h%BUEEHUHf?|GBM_!7;;R z(KFXrugP+Yba3a+zdd)AubR-u809lOsKlJl%{+bHAt5|YNpMRM&(O~Ohsq$W&b*jx zFKxTym4z9DM8T(ElXDlF_goPt#(ob=o}d9qw=f2u_)|+^hpF2+dDpGfvfYHPSe%$F zimP4KB``y9hF%W6MfJMl&+xDQq&8gJy}1!d>;ntPYZ>YTTvUIj!NZtBl}QQkFgKtL z^;72D692K!^w+xv6r-&yM9PdOOUkolVZ0BLQgTsd3Qz%n^eRLU zlB&%94~}GzQj$%|Be4G{)FpCa|A2^UZM%0AQehwzZ$P?A#eFF^<#m$mQ3`6M_l*%h z8J{8FAW>-i51S;AQosrHOo|Z+gpzkhesv9rq*P2w0ZfLQkWFgBK>uozQotw!0NqW= zAW?1kuOOvPP#yqkn*9YbLdhfFzg;h-C=Tdd1#=Qj6dL}kRZ0;W@ILD-esHu3KNWPp zRtu$~3h3P|OA-tHTeU_>lD0%C1EJ*r_j&?OBKKol2Ne$skO;~MSzQ2ubpR5?aA}O1 z5+|9W44DK{TTZ`HVq}8y5KISP$IKN-5CbbEf4witO<-UhcKVTM&7VQt6z68YmO;76 z2Q1_8Wk4AeyT`wlLAf~s^zUyWq%t&qUdR6K;IBncZVada9MKdGbcC;p0NHhvi)dv4 zaUv2(465*w3Ch)&5`Zwc0wknVdB_Ci+CvdQ7)1k#1l40?f^v=tbZ0q=MEqSP6ibv} zeL*?L0$OE_1zOdF{jf^eqXR3zFOEcr{j7lfshEW^EwTHjqLLy$HQA}C&Ri#b`yb=q B)OG*> delta 83 zcmbQYo@saaBn_#FQo56K`2;40pPkIoA+Xtmk;jCWkx7I>gn@&DgF(bJb#g?z1v7}A b+`b*GB&s8VRfLs|0SJVFFdfLUGX?Pg(v}lj diff --git a/tester/deprecated/Test_File_0.java b/tester/deprecated/Test_File_0.java new file mode 100644 index 0000000..44342ba --- /dev/null +++ b/tester/deprecated/Test_File_0.java @@ -0,0 +1,114 @@ +import java.lang.reflect.Method; + +public class Test_File_0 { + + public class TestSuite { + + public Boolean unpack_file_path_0(In.MIO io) { + Boolean[] conditions = new Boolean[5]; + int i = 0; + + String test_fp = "/home/user/test.txt"; + String expected_dp = "/home/user/"; + String expected_fn = "test.txt"; + String expected_fn_base = "test"; + String expected_fn_ext = "txt"; + + try { + // Use reflection to call In.File.unpack_file_path + Method unpackFilePath = In.File.getMethod("unpack_file_path", String.class); + java.util.Map result = (java.util.Map) unpackFilePath.invoke(null, test_fp); + + conditions[i++] = result.get("dp").equals(expected_dp); + conditions[i++] = result.get("fn").equals(expected_fn); + conditions[i++] = result.get("fn_base").equals(expected_fn_base); + conditions[i++] = result.get("fn_ext").equals(expected_fn_ext); + conditions[i++] = result.size() == 4; + + Method allMethod = In.MU.getMethod("all", Boolean[].class); + return (Boolean) allMethod.invoke(null, (Object) conditions); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + public Boolean file_exists_q_0(In.MIO io) { + Boolean[] conditions = new Boolean[2]; + int i = 0; + + String repoHome = System.getenv("REPO_HOME"); + String existingFilePath = repoHome + "/tester/data_Test_File_0/I_exist"; + String nonExistentFilePath = repoHome + "/tester/data_Test_File_0/I_do_not_exist"; + + try { + // Use reflection to call In.File.file_exists_q + Method fileExistsMethod = In.File.getMethod("file_exists_q", String.class); + conditions[i++] = (Boolean) fileExistsMethod.invoke(null, existingFilePath); + conditions[i++] = !(Boolean) fileExistsMethod.invoke(null, nonExistentFilePath); + + Method allMethod = In.MU.getMethod("all", Boolean[].class); + return (Boolean) allMethod.invoke(null, (Object) conditions); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + public Boolean newer_than_all_0(In.MIO io) throws java.io.IOException { + Boolean[] conditions = new Boolean[5]; + int i = 0; + + String repoHome = System.getenv("REPO_HOME"); + String file_0 = repoHome + "/tester/data_Test_File_0/file_0"; + String file_1 = repoHome + "/tester/data_Test_File_0/file_1"; + String file_2 = repoHome + "/tester/data_Test_File_0/file_2"; + String file_3 = repoHome + "/tester/data_Test_File_0/file_3"; + String missing_file_0 = repoHome + "/tester/data_Test_File_0/missing_file_0"; + + try { + Method setLastModifiedTime = In.Files.getMethod("setLastModifiedTime", java.nio.file.Path.class, java.nio.file.attribute.FileTime.class); + Method getPath = In.Paths.getMethod("get", String.class); + Method fromMillis = In.FileTime.getMethod("fromMillis", long.class); + + // Setting modification times + setLastModifiedTime.invoke(null, getPath.invoke(null, file_3), fromMillis.invoke(null, System.currentTimeMillis() - 20000)); + setLastModifiedTime.invoke(null, getPath.invoke(null, file_2), fromMillis.invoke(null, System.currentTimeMillis() - 15000)); + setLastModifiedTime.invoke(null, getPath.invoke(null, file_1), fromMillis.invoke(null, System.currentTimeMillis() - 10000)); + setLastModifiedTime.invoke(null, getPath.invoke(null, file_0), fromMillis.invoke(null, System.currentTimeMillis() - 5000)); + + Method newerThanAll = In.File.getMethod("newer_than_all", String.class, java.util.List.class); + conditions[i++] = (Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, file_2, file_3)); + + // Updating times and repeating checks + setLastModifiedTime.invoke(null, getPath.invoke(null, file_2), fromMillis.invoke(null, System.currentTimeMillis() + 10000)); + conditions[i++] = !(Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, file_2, file_3)); + + setLastModifiedTime.invoke(null, getPath.invoke(null, file_1), fromMillis.invoke(null, System.currentTimeMillis() + 15000)); + conditions[i++] = !(Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, file_2, file_3)); + + conditions[i++] = !(Boolean) newerThanAll.invoke(null, missing_file_0, java.util.List.of(file_1, file_2, file_3)); + + conditions[i++] = !(Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, missing_file_0)); + + Method allMethod = In.MU.getMethod("all", Boolean[].class); + return (Boolean) allMethod.invoke(null, (Object) conditions); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + } + + public static void main(String[] args) { + try { + Method runMethod = In.TB.getMethod("run", Object.class); + TestSuite suite = new Test_File_0().new TestSuite(); + int result = (int) runMethod.invoke(null, suite); + System.exit(result); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/tester/deprecated/Test_Graph_0.java b/tester/deprecated/Test_Graph_0.java new file mode 100644 index 0000000..4c8dc6a --- /dev/null +++ b/tester/deprecated/Test_Graph_0.java @@ -0,0 +1,72 @@ + + +public class Test_Graph_0 { + + public class TestSuite { + + // Test constructor with null parameters (expecting error message) + public Boolean graph_constructor_null_params(IO io) { + Boolean[] conditions = new Boolean[1]; + int i = 0; + + // Attempt to initialize Graph with both parameters null + new Graph(null, null); + + // Capture stderr to check for error message + String stderrContent = io.get_err_content(); + conditions[i++] = stderrContent.contains("AriadneGraph: At least one of 'node_map' (Map) or 'recognizer_f_list' (List) must be provided."); + io.clear_buffers(); // Clear after validation + return MU.all(conditions); + } + + // Test lookup with populated node_map + public Boolean graph_lookup_populated_map(IO io) { + Boolean[] conditions = new Boolean[2]; + int i = 0; + + // Setup node_map with labeled nodes + Map nodeMap = new HashMap<>(); + Label label1 = new Label("node1"); + Label label2 = new Label("node2"); + Node node1 = new Node(); + Node node2 = new Node(); + nodeMap.put(label1, node1); + nodeMap.put(label2, node2); + + Graph graph = new Graph(nodeMap, new ProductionList()); + + // Test lookup for existing and non-existing labels + conditions[i++] = graph.lookup(label1, true) == node1; + conditions[i++] = graph.lookup(new Label("nonexistent"), true) == null; + + io.clear_buffers(); // Clear after each case + return MU.all(conditions); + } + + // Test lookup without verbosity + public Boolean graph_lookup_non_verbose(IO io) { + Boolean[] conditions = new Boolean[1]; + int i = 0; + + // Initialize node_map with one node + Map nodeMap = new HashMap<>(); + Label label = new Label("singleNode"); + Node node = new Node(); + nodeMap.put(label, node); + + Graph graph = new Graph(nodeMap, new ProductionList()); + + // Perform lookup without verbosity + Node result = graph.lookup(label, false); + conditions[i++] = result == node; // Expected to find node without verbose output + + return MU.all(conditions); + } + } + + public static void main(String[] args) { + TestSuite suite = new Test_Graph_0().new TestSuite(); + int result = TestBench.run(suite); + System.exit(result); + } +} diff --git a/developer/scratch_pad/.gitignore b/tester/deprecated/scratch_pad/.gitignore similarity index 100% rename from developer/scratch_pad/.gitignore rename to tester/deprecated/scratch_pad/.gitignore diff --git a/tester/javac/#Test2.javax# b/tester/javac/#Test2.javax# index c38d8d5..63b716a 100644 --- a/tester/javac/#Test2.javax# +++ b/tester/javac/#Test2.javax# @@ -1,4 +1,4 @@ -package com.ReasoningTechnology.Ariadne.TestBench; +package com.ReasoningTechnology.Ariadne.Testbench; /* Component smoke test. At least call each method of each class. @@ -7,7 +7,7 @@ Component smoke test. At least call each method of each class. import com.ReasoningTechnology.Ariadne.*; -import com.ReasoningTechnology.TestBench.*; +import com.ReasoningTechnology.Testbench.*; import java.util.List; import java.util.Map; import java.util.ArrayList; @@ -16,7 +16,7 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; -public class Test2 extends TestBench{ +public class Test2 extends Testbench{ public static boolean test_Label_0(){ boolean[] conditions = new boolean[2]; @@ -202,8 +202,8 @@ public class Test2 extends TestBench{ test_map.put("test_Graph_0", test_Graph_0()); test_map.put("test_Util_print_list_0", test_Util_print_list_0()); - // Run the tests using TestBench - TestBench.run( test_map ); + // Run the tests using Testbench + Testbench.run( test_map ); } // Main function to provide a shell interface for running tests diff --git a/tester/javac/#Test_Node_0.java# b/tester/javac/#Test_Node_0.java# deleted file mode 100644 index 98cf614..0000000 --- a/tester/javac/#Test_Node_0.java# +++ /dev/null @@ -1,63 +0,0 @@ - -public class Test_Node_0 { - - public class TestSuite { - - public Boolean node_creation_0(IO io) { - Boolean[] conditions = new Boolean[2]; - int i = 0; - - // Test that neighbor list is initialized - Node node = new Node(); - conditions[i++] = node.neighbor_LabelList() != null && node.neighbor_LabelList().isEmpty(); // Expect true - - // Test that the mark property is not initialized until used - conditions[i++] = node.get("mark") == null; // Expect true - - // Return true if all conditions are met - return MU.all(conditions); - } - - public Boolean node_marking_0(IO io) { - Boolean[] conditions = new Boolean[3]; - int i = 0; - - Node node = new Node(); - Token token1 = new Token("token1"); - Token token2 = new Token("token2"); - - // Test marking the node with token1 - node.mark(token1); - conditions[i++] = node.has_mark(token1); // Expect true - conditions[i++] = !node.has_mark(token2); // Expect false for unmarked token - - // Test that mark property is now initialized and contains token1 - TokenSet markSet = (TokenSet) node.get("mark"); - conditions[i++] = markSet != null && markSet.contains(token1); // Expect true - - // Return true if all conditions are met - return MU.all(conditions); - } - - public Boolean node_neighbor_0(IO io) { - Boolean[] conditions = new Boolean[1]; - int i = 0; - - // Test adding and retrieving neighbors - Node node = new Node(); - LabelList neighbors = node.neighbor_LabelList(); - neighbors.add(new Label("neighbor1")); - neighbors.add(new Label("neighbor2")); - conditions[i++] = neighbors.size() == 2 && neighbors.get(0).get().equals("neighbor1") && neighbors.get(1).get().equals("neighbor2"); // Expect true - - // Return true if all conditions are met - return MU.all(conditions); - } - } - - public static void main(String[] args) { - TestSuite suite = new Test_Node_0().new TestSuite(); - int result = TestBench.run(suite); - System.exit(result); - } -} diff --git a/tester/javac/In.java b/tester/javac/In.java deleted file mode 100644 index 09d3af6..0000000 --- a/tester/javac/In.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Import to the package, rather than to individual files. -*/ -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.FileTime; -import java.util.List; -import java.util.Map; - -import com.ReasoningTechnology.Ariadne.File; -import com.ReasoningTechnology.Ariadne.Util; -import com.ReasoningTechnology.Mosaic.IO; -import com.ReasoningTechnology.Mosaic.TestBench; - - -public class In { - // Mosaic imports - public static final Class MIO = com.ReasoningTechnology.Mosaic.IO.class; - public static final Class MU = com.ReasoningTechnology.Mosaic.Util.class; - public static final Class TB = com.ReasoningTechnology.Mosaic.TestBench.class; - - // Ariadne imports - public static final Class File = com.ReasoningTechnology.Ariadne.File.class; - public static final Class AU = com.ReasoningTechnology.Ariadne.Util.class; - public static final Class Graph = com.ReasoningTechnology.Ariadne.Graph.class; - public static final Class Label = com.ReasoningTechnology.Ariadne.Label.class; - public static final Class LabelList = com.ReasoningTechnology.Ariadne.LabelList.class; - public static final Class Node = com.ReasoningTechnology.Ariadne.Node.class; - public static final Class NodeList = com.ReasoningTechnology.Ariadne.NodeList.class; - public static final Class ProductionList = com.ReasoningTechnology.Ariadne.ProductionList.class; - public static final Class Token = com.ReasoningTechnology.Ariadne.Token.class; - public static final Class TokenSet = com.ReasoningTechnology.Ariadne.TokenSet.class; - - // Java standard library imports - public static final Class Arrays = java.util.Arrays.class; - public static final Class Files = java.nio.file.Files.class; - public static final Class Path = java.nio.file.Path.class; - public static final Class Paths = java.nio.file.Paths.class; - public static final Class FileTime = java.nio.file.attribute.FileTime.class; - public static final Class HashMap = java.util.HashMap.class; - public static final Class List = java.util.List.class; - public static final Class Map = java.util.Map.class; -} -/* - -public class In { - // Class references for direct access to imported class definitions - public static final Class MIO = com.ReasoningTechnology.Mosaic.IO.class; - public static final Class MU = com.ReasoningTechnology.Mosaic.Util.class; - public static final Class TestBench = com.ReasoningTechnology.Mosaic.TestBench.class; - - public static final Class File = com.ReasoningTechnology.Ariadne.File.class; - public static final Class Graph = com.ReasoningTechnology.Ariadne.Graph.class; - public static final Class Label = com.ReasoningTechnology.Ariadne.Label.class; - public static final Class LabelList = com.ReasoningTechnology.Ariadne.LabelList.class; - public static final Class Node = com.ReasoningTechnology.Ariadne.Node.class; - public static final Class NodeList = com.ReasoningTechnology.Ariadne.NodeList.class; - public static final Class ProductionList = com.ReasoningTechnology.Ariadne.ProductionList.class; - public static final Class Token = com.ReasoningTechnology.Ariadne.Token.class; - public static final Class TokenSet = com.ReasoningTechnology.Ariadne.TokenSet.class; - public static final Class AU = com.ReasoningTechnology.Ariadne.Util.class; - - // For standard Java classes - public static final Class Arrays = java.util.Arrays.class; - public static final Class Files = java.nio.file.Files.class; - public static final Class Path = java.nio.file.Path.class; - public static final Class Paths = java.nio.file.Paths.class; - public static final Class FileTime = java.nio.file.attribute.FileTime.class; - public static final Class HashMap = java.util.HashMap.class; - public static final Class List = java.util.List.class; - public static final Class Map = java.util.Map.class; - - // Optional: Utility methods to create instances or perform actions on these classes could be added here -} -*/ diff --git a/tester/javac/TestMosaicUtil.java b/tester/javac/TestMosaicUtil.java deleted file mode 100644 index 17be83f..0000000 --- a/tester/javac/TestMosaicUtil.java +++ /dev/null @@ -1,15 +0,0 @@ -import com.ReasoningTechnology.Mosaic; // Importing the entire Mosaic package - -public class TestMosaicUtil { - - public static void main(String[] args) { - // Sample array of conditions to check with Util.all - Boolean[] conditions = {true, true, true}; - - // Using Mosaic.Util.all() to check if all conditions are true - boolean result = Mosaic.Util.all(conditions); - - // Print the result - System.out.println("All conditions are true: " + result); - } -} diff --git a/tester/javac/Test_File_0.java b/tester/javac/Test_File_0.java index 44342ba..e3bb697 100644 --- a/tester/javac/Test_File_0.java +++ b/tester/javac/Test_File_0.java @@ -1,10 +1,26 @@ + +import java.io.IOException; import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.ReasoningTechnology.Mosaic.Mosaic_IO; +import com.ReasoningTechnology.Mosaic.Mosaic_Testbench; +import com.ReasoningTechnology.Mosaic.Mosaic_Util; + +import com.ReasoningTechnology.Ariadne.Ariadne_File; + public class Test_File_0 { public class TestSuite { - public Boolean unpack_file_path_0(In.MIO io) { + public Boolean unpack_file_path_0(Mosaic_IO io) { Boolean[] conditions = new Boolean[5]; int i = 0; @@ -15,9 +31,7 @@ public class Test_File_0 { String expected_fn_ext = "txt"; try { - // Use reflection to call In.File.unpack_file_path - Method unpackFilePath = In.File.getMethod("unpack_file_path", String.class); - java.util.Map result = (java.util.Map) unpackFilePath.invoke(null, test_fp); + Map result = Ariadne_File.unpack_file_path(test_fp); conditions[i++] = result.get("dp").equals(expected_dp); conditions[i++] = result.get("fn").equals(expected_fn); @@ -25,15 +39,14 @@ public class Test_File_0 { conditions[i++] = result.get("fn_ext").equals(expected_fn_ext); conditions[i++] = result.size() == 4; - Method allMethod = In.MU.getMethod("all", Boolean[].class); - return (Boolean) allMethod.invoke(null, (Object) conditions); + return Mosaic_Util.all(conditions); } catch (Exception e) { e.printStackTrace(); return false; } } - public Boolean file_exists_q_0(In.MIO io) { + public Boolean file_exists_q_0(Mosaic_IO io) { Boolean[] conditions = new Boolean[2]; int i = 0; @@ -41,21 +54,13 @@ public class Test_File_0 { String existingFilePath = repoHome + "/tester/data_Test_File_0/I_exist"; String nonExistentFilePath = repoHome + "/tester/data_Test_File_0/I_do_not_exist"; - try { - // Use reflection to call In.File.file_exists_q - Method fileExistsMethod = In.File.getMethod("file_exists_q", String.class); - conditions[i++] = (Boolean) fileExistsMethod.invoke(null, existingFilePath); - conditions[i++] = !(Boolean) fileExistsMethod.invoke(null, nonExistentFilePath); + conditions[i++] = Ariadne_File.file_exists_q(existingFilePath); + conditions[i++] = !Ariadne_File.file_exists_q(nonExistentFilePath); - Method allMethod = In.MU.getMethod("all", Boolean[].class); - return (Boolean) allMethod.invoke(null, (Object) conditions); - } catch (Exception e) { - e.printStackTrace(); - return false; - } + return Mosaic_Util.all(conditions); } - public Boolean newer_than_all_0(In.MIO io) throws java.io.IOException { + public Boolean newer_than_all_0(Mosaic_IO io) throws IOException { Boolean[] conditions = new Boolean[5]; int i = 0; @@ -66,45 +71,33 @@ public class Test_File_0 { String file_3 = repoHome + "/tester/data_Test_File_0/file_3"; String missing_file_0 = repoHome + "/tester/data_Test_File_0/missing_file_0"; - try { - Method setLastModifiedTime = In.Files.getMethod("setLastModifiedTime", java.nio.file.Path.class, java.nio.file.attribute.FileTime.class); - Method getPath = In.Paths.getMethod("get", String.class); - Method fromMillis = In.FileTime.getMethod("fromMillis", long.class); - - // Setting modification times - setLastModifiedTime.invoke(null, getPath.invoke(null, file_3), fromMillis.invoke(null, System.currentTimeMillis() - 20000)); - setLastModifiedTime.invoke(null, getPath.invoke(null, file_2), fromMillis.invoke(null, System.currentTimeMillis() - 15000)); - setLastModifiedTime.invoke(null, getPath.invoke(null, file_1), fromMillis.invoke(null, System.currentTimeMillis() - 10000)); - setLastModifiedTime.invoke(null, getPath.invoke(null, file_0), fromMillis.invoke(null, System.currentTimeMillis() - 5000)); + // Setting modification times + Files.setLastModifiedTime(Path.of(file_3), FileTime.fromMillis(System.currentTimeMillis() - 20000)); + Files.setLastModifiedTime(Path.of(file_2), FileTime.fromMillis(System.currentTimeMillis() - 15000)); + Files.setLastModifiedTime(Path.of(file_1), FileTime.fromMillis(System.currentTimeMillis() - 10000)); + Files.setLastModifiedTime(Path.of(file_0), FileTime.fromMillis(System.currentTimeMillis() - 5000)); - Method newerThanAll = In.File.getMethod("newer_than_all", String.class, java.util.List.class); - conditions[i++] = (Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, file_2, file_3)); + conditions[i++] = Ariadne_File.newer_than_all(file_0, List.of(file_1, file_2, file_3)); - // Updating times and repeating checks - setLastModifiedTime.invoke(null, getPath.invoke(null, file_2), fromMillis.invoke(null, System.currentTimeMillis() + 10000)); - conditions[i++] = !(Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, file_2, file_3)); + // Updating times and repeating checks + Files.setLastModifiedTime(Path.of(file_2), FileTime.fromMillis(System.currentTimeMillis() + 10000)); + conditions[i++] = !Ariadne_File.newer_than_all(file_0, List.of(file_1, file_2, file_3)); - setLastModifiedTime.invoke(null, getPath.invoke(null, file_1), fromMillis.invoke(null, System.currentTimeMillis() + 15000)); - conditions[i++] = !(Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, file_2, file_3)); + Files.setLastModifiedTime(Path.of(file_1), FileTime.fromMillis(System.currentTimeMillis() + 15000)); + conditions[i++] = !Ariadne_File.newer_than_all(file_0, List.of(file_1, file_2, file_3)); - conditions[i++] = !(Boolean) newerThanAll.invoke(null, missing_file_0, java.util.List.of(file_1, file_2, file_3)); + conditions[i++] = !Ariadne_File.newer_than_all(missing_file_0, List.of(file_1, file_2, file_3)); - conditions[i++] = !(Boolean) newerThanAll.invoke(null, file_0, java.util.List.of(file_1, missing_file_0)); + conditions[i++] = !Ariadne_File.newer_than_all(file_0, List.of(file_1, missing_file_0)); - Method allMethod = In.MU.getMethod("all", Boolean[].class); - return (Boolean) allMethod.invoke(null, (Object) conditions); - } catch (Exception e) { - e.printStackTrace(); - return false; - } + return Mosaic_Util.all(conditions); } } public static void main(String[] args) { try { - Method runMethod = In.TB.getMethod("run", Object.class); TestSuite suite = new Test_File_0().new TestSuite(); - int result = (int) runMethod.invoke(null, suite); + int result = Mosaic_Testbench.run(suite); System.exit(result); } catch (Exception e) { e.printStackTrace(); diff --git a/tester/javac/Test_Graph_0.java b/tester/javac/Test_Graph_0.java index 4c8dc6a..fa85d74 100644 --- a/tester/javac/Test_Graph_0.java +++ b/tester/javac/Test_Graph_0.java @@ -1,72 +1,82 @@ +import java.util.HashMap; +import java.util.Map; +import com.ReasoningTechnology.Mosaic.Mosaic_Util; +import com.ReasoningTechnology.Mosaic.Mosaic_IO; +import com.ReasoningTechnology.Mosaic.Mosaic_Testbench; + +import com.ReasoningTechnology.Ariadne.Ariadne_Graph; +import com.ReasoningTechnology.Ariadne.Ariadne_Label; +import com.ReasoningTechnology.Ariadne.Ariadne_Node; +import com.ReasoningTechnology.Ariadne.Ariadne_ProductionList; public class Test_Graph_0 { public class TestSuite { // Test constructor with null parameters (expecting error message) - public Boolean graph_constructor_null_params(IO io) { + public Boolean graph_constructor_null_params(Mosaic_IO io) { Boolean[] conditions = new Boolean[1]; int i = 0; // Attempt to initialize Graph with both parameters null - new Graph(null, null); + new Ariadne_Graph(null, null); // Capture stderr to check for error message String stderrContent = io.get_err_content(); conditions[i++] = stderrContent.contains("AriadneGraph: At least one of 'node_map' (Map) or 'recognizer_f_list' (List) must be provided."); io.clear_buffers(); // Clear after validation - return MU.all(conditions); + return Mosaic_Util.all(conditions); } // Test lookup with populated node_map - public Boolean graph_lookup_populated_map(IO io) { + public Boolean graph_lookup_populated_map(Mosaic_IO io) { Boolean[] conditions = new Boolean[2]; int i = 0; // Setup node_map with labeled nodes - Map nodeMap = new HashMap<>(); - Label label1 = new Label("node1"); - Label label2 = new Label("node2"); - Node node1 = new Node(); - Node node2 = new Node(); + Map nodeMap = new HashMap<>(); + Ariadne_Label label1 = new Ariadne_Label("node1"); + Ariadne_Label label2 = new Ariadne_Label("node2"); + Ariadne_Node node1 = new Ariadne_Node(); + Ariadne_Node node2 = new Ariadne_Node(); nodeMap.put(label1, node1); nodeMap.put(label2, node2); - Graph graph = new Graph(nodeMap, new ProductionList()); + Ariadne_Graph graph = new Ariadne_Graph(nodeMap, new Ariadne_ProductionList()); // Test lookup for existing and non-existing labels conditions[i++] = graph.lookup(label1, true) == node1; - conditions[i++] = graph.lookup(new Label("nonexistent"), true) == null; + conditions[i++] = graph.lookup(new Ariadne_Label("nonexistent"), true) == null; io.clear_buffers(); // Clear after each case - return MU.all(conditions); + return Mosaic_Util.all(conditions); } // Test lookup without verbosity - public Boolean graph_lookup_non_verbose(IO io) { + public Boolean graph_lookup_non_verbose(Mosaic_IO io) { Boolean[] conditions = new Boolean[1]; int i = 0; // Initialize node_map with one node - Map nodeMap = new HashMap<>(); - Label label = new Label("singleNode"); - Node node = new Node(); + Map nodeMap = new HashMap<>(); + Ariadne_Label label = new Ariadne_Label("singleNode"); + Ariadne_Node node = new Ariadne_Node(); nodeMap.put(label, node); - Graph graph = new Graph(nodeMap, new ProductionList()); + Ariadne_Graph graph = new Ariadne_Graph(nodeMap, new Ariadne_ProductionList()); // Perform lookup without verbosity - Node result = graph.lookup(label, false); + Ariadne_Node result = graph.lookup(label, false); conditions[i++] = result == node; // Expected to find node without verbose output - return MU.all(conditions); + return Mosaic_Util.all(conditions); } } public static void main(String[] args) { TestSuite suite = new Test_Graph_0().new TestSuite(); - int result = TestBench.run(suite); + int result = Mosaic_Testbench.run(suite); System.exit(result); } } diff --git a/tester/javac/Test_LabelList_0.java b/tester/javac/Test_LabelList_0.java index 3a6ea44..258362e 100644 --- a/tester/javac/Test_LabelList_0.java +++ b/tester/javac/Test_LabelList_0.java @@ -1,31 +1,39 @@ +import java.util.Arrays; +import java.util.List; + +import com.ReasoningTechnology.Mosaic.Mosaic_IO; +import com.ReasoningTechnology.Mosaic.Mosaic_Util; +import com.ReasoningTechnology.Mosaic.Mosaic_Testbench; + +import com.ReasoningTechnology.Ariadne.Ariadne_Label; +import com.ReasoningTechnology.Ariadne.Ariadne_LabelList; public class Test_LabelList_0 { public class TestSuite { - public Boolean labelList_creation_0(IO io) { + public Boolean labelList_creation_0(Mosaic_IO io) { Boolean[] conditions = new Boolean[2]; int i = 0; // Test the default constructor - LabelList emptyList = new LabelList(); + Ariadne_LabelList emptyList = new Ariadne_LabelList(); conditions[i++] = emptyList.isEmpty(); // Expect true for an empty list // Test the constructor with a list of labels - List