--- /dev/null
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
+import java.math.BigInteger;
+
+public class CountingNumber_0_CLI{
+
+ protected static void print_ten(CountingNumber n){
+ System.out.println("Iterating through Counting Numbers:");
+
+ if( !n.can_read() ) return;
+
+ if( n.topology() == Ariadne_SRTM.Topology.SEGMENT ){
+ do{
+ System.out.println("Current Number: " + n.read());
+ if( !n.can_step() ) break;
+ n.step();
+ }while( true );
+
+ }else if( n.topology() == Ariadne_SRTM.Topology.INFINITE ){
+ int count = 0;
+ do{
+ System.out.println("Current Number: " + n.read());
+ if( count == 9 ) break;
+ n.step();
+ count++;
+ }while( true );
+
+ }else{
+ System.out.println("Unrecognized or invalid tape state.");
+ }
+ }
+
+ public static void main(String[] args){
+ print_ten( CountingNumber.make(BigInteger.TEN) ); // Finite segment up to 10
+ print_ten( CountingNumber.make() ); // Infinite tape, stopping after 10 steps
+ }
+
+}
--- /dev/null
+Iterating through Counting Numbers:
+Current Number: 1
+Current Number: 2
+Current Number: 3
+Current Number: 4
+Current Number: 5
+Current Number: 6
+Current Number: 7
+Current Number: 8
+Current Number: 9
+Current Number: 10
+Iterating through Counting Numbers:
+Current Number: 1
+Current Number: 2
+Current Number: 3
+Current Number: 4
+Current Number: 5
+Current Number: 6
+Current Number: 7
+Current Number: 8
+Current Number: 9
+Current Number: 10
+++ /dev/null
-#!/bin/bash
-java Example_CountingNumber_0
+++ /dev/null
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
-import java.math.BigInteger;
-
-public class Example_CountingNumber_0{
-
- protected static void print_ten(CountingNumber n){
- System.out.println("Iterating through Counting Numbers:");
-
- if( !n.can_read() ) return;
-
- if( n.topology() == Ariadne_SRTM.Topology.SEGMENT ){
- do{
- System.out.println("Current Number: " + n.read());
- if( !n.can_step() ) break;
- n.step();
- }while( true );
-
- }else if( n.topology() == Ariadne_SRTM.Topology.INFINITE ){
- int count = 0;
- do{
- System.out.println("Current Number: " + n.read());
- if( count == 9 ) break;
- n.step();
- count++;
- }while( true );
-
- }else{
- System.out.println("Unrecognized or invalid tape state.");
- }
- }
-
- public static void main(String[] args){
- print_ten( CountingNumber.make(BigInteger.TEN) ); // Finite segment up to 10
- print_ten( CountingNumber.make() ); // Infinite tape, stopping after 10 steps
- }
-
-}
+++ /dev/null
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTM_List;
-
-public class Example_4x4{
-
- public static void main(String[] args){
-
- System.out.println("Example_4x4");
-
- // Initialize graph and start at root
- Graph graph = Graph.make();
- SRTM_Child start = graph.start();
- Label label = start.read();
- Node node;
- SRTM_Child child_srm;
-
- System.out.println("starting at: " + start.read());
-
- // Descend 3 more levels
- int i = 1;
- do{
- node = graph.lookup(label);
- child_srm = node.neighbor();
- label = child_srm.read();
- System.out.println("Descended to: " + label.toString());
- if(i == 3) break;
- i++;
- }while(true);
-
- // Move across three more nodes
- i = 1;
- do{
- child_srm.step();
- label = child_srm.read();
- System.out.println("Across to: " + label.toString());
- if(i == 3) break;
- i++;
- }while(true);
-
- }
-}
+++ /dev/null
-import java.util.List;
-
-public class Example_SRTM_Diagonal{
-
- public static void main(String[] args){
- System.out.println("Starting IndexTree SRTM Example");
-
- // Instantiate the IndexTree Diagonal SRTM
- SRTM_Diagonal srtm = SRTM_Diagonal.make();
- int step_count = 0;
- if( srtm.can_read() ){
- do{
- System.out.println(step_count ": " + diagonal);
- if( !srtm.can_step() ) break;
- if( step_count == 4 ) break; // Stop after 5 diagonals
- step_count++;
- srtm.step();
- }while(true);
- }
- }
-
-}
-
--- /dev/null
+import java.util.List;
+
+public class SRTM_Diagonal_CLI{
+
+ public static void main(String[] args){
+ System.out.println("Starting IndexTree SRTM Example");
+
+ // Instantiate the IndexTree Diagonal SRTM
+ SRTM_Diagonal srtm = SRTM_Diagonal.make();
+ int step_count = 0;
+ if( srtm.can_read() ){
+ do{
+ System.out.println(step_count + ": " + srtm.read());
+ if( !srtm.can_step() ) break;
+ if( step_count == 4 ) break; // Stop after 5 diagonals
+ step_count++;
+ srtm.step();
+ }while(true);
+ }
+ }
+
+}
+
--- /dev/null
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTM_List;
+
+public class four_down_four_across_CLI{
+
+ public static void main(String[] args){
+
+ System.out.println("Example_4x4");
+
+ // Initialize graph and start at root
+ Graph graph = Graph.make();
+ SRTM_Child start = graph.start();
+ Label label = start.read();
+ Node node;
+ SRTM_Child child_srm;
+
+ System.out.println("starting at: " + start.read());
+
+ // Descend 3 more levels
+ int i = 1;
+ do{
+ node = graph.lookup(label);
+ child_srm = node.neighbor();
+ label = child_srm.read();
+ System.out.println("Descended to: " + label.toString());
+ if(i == 3) break;
+ i++;
+ }while(true);
+
+ // Move across three more nodes
+ i = 1;
+ do{
+ child_srm.step();
+ label = child_srm.read();
+ System.out.println("Across to: " + label.toString());
+ if(i == 3) break;
+ i++;
+ }while(true);
+
+ }
+}
+++ /dev/null
-#!/bin/bash
-java Example_SRTMI_Array
+++ /dev/null
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTMI_Array;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class Example_SRTMI_Array {
- public static void main( String[] args ){
- // Create an Array
- List<String> label_array = Arrays.asList( "A", "B", "C", "D" );
-
- // Attach SRTMI to the array
- Ariadne_SRTMI_Array srm = Ariadne_SRTMI_Array.make( label_array );
- if( srm.can_read() ){
- do{
- System.out.println( "Reading: " + srm.read() );
- System.out.println( "Topology: " + srm.topology() );
- if( !srm.can_step() ) break;
- srm.step();
- }while(true);
- }
- }
-}
+++ /dev/null
-#!/bin/bash
-java Example_SRTM_List
+++ /dev/null
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
-import com.ReasoningTechnology.Ariadne.Ariadne_SRTM_List;
-
-import java.util.LinkedList;
-
-public class Example_SRTM_List {
- public static void main( String[] args ){
- // Create a linked list
- LinkedList<String> label_list = new LinkedList<>();
- label_list.add( "A" );
- label_list.add( "B" );
- label_list.add( "C" );
-
- // Attach SRTM to the linked list and traverse
- Ariadne_SRTM_List<String> srm = Ariadne_SRTM_List.make(label_list);
- if( srm.can_read() ){
- do{
- System.out.println( "Reading: " + srm.read() );
- System.out.println( "Topology: " + srm.topology() );
- if( !srm.can_step() ) break;
- srm.step();
- }while(true);
- }
- }
-}
--- /dev/null
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTMI_Array;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class SRTMI_Array_CLI {
+ public static void main( String[] args ){
+ // Create an Array
+ List<String> label_array = Arrays.asList( "A", "B", "C", "D" );
+
+ // Attach SRTMI to the array
+ Ariadne_SRTMI_Array srm = Ariadne_SRTMI_Array.make( label_array );
+ if( srm.can_read() ){
+ do{
+ System.out.println( "Reading: " + srm.read() );
+ System.out.println( "Topology: " + srm.topology() );
+ if( !srm.can_step() ) break;
+ srm.step();
+ }while(true);
+ }
+ }
+}
--- /dev/null
+Reading: A
+Topology: SEGMENT
+Reading: B
+Topology: SEGMENT
+Reading: C
+Topology: SEGMENT
+Reading: D
+Topology: RIGHTMOST
--- /dev/null
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTM;
+import com.ReasoningTechnology.Ariadne.Ariadne_SRTM_List;
+
+import java.util.LinkedList;
+
+public class SRTM_List_CLI {
+ public static void main( String[] args ){
+ // Create a linked list
+ LinkedList<String> label_list = new LinkedList<>();
+ label_list.add( "A" );
+ label_list.add( "B" );
+ label_list.add( "C" );
+
+ // Attach SRTM to the linked list and traverse
+ Ariadne_SRTM_List<String> srm = Ariadne_SRTM_List.make(label_list);
+ if( srm.can_read() ){
+ do{
+ System.out.println( "Reading: " + srm.read() );
+ System.out.println( "Topology: " + srm.topology() );
+ if( !srm.can_step() ) break;
+ srm.step();
+ }while(true);
+ }
+ }
+}
--- /dev/null
+Reading: A
+Topology: SEGMENT
+Reading: B
+Topology: SEGMENT
+Reading: C
+Topology: RIGHTMOST
# remove wrappers and class files
- for file in Example_*.class; do
+ for file in *_CLI.class; do
echo "file: " $file
wrapper_name=$(basename "$file" .class)
rm_na "$wrapper_name"
echo "Creating bash wrappers..."
- for file in Example_*.class; do
+ for file in *_CLI.class; do
echo "file: " $file
wrapper_name=$(basename "$file" .class)
cat > "$wrapper_name" << EOL