adds entanglment copy and rewind to tm sr nd
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Wed, 15 Jan 2025 12:35:26 +0000 (12:35 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Wed, 15 Jan 2025 12:35:26 +0000 (12:35 +0000)
16 files changed:
developer/example/TM_SR_ND/ND_SR_TM_Array_CLI.java [deleted file]
developer/example/TM_SR_ND/ND_SR_TM_Array_transcript.txt [deleted file]
developer/example/TM_SR_ND/ND_SR_TM_List_CLI.java [deleted file]
developer/example/TM_SR_ND/ND_SR_TM_List_transcript.txt [deleted file]
developer/example/TM_SR_ND/ND_SR_TM_Set_CLI.java [deleted file]
developer/example/TM_SR_ND/TM_SR_ND_Array_CLI.java [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_Array_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_List_CLI.java [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_List_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_Print_CLI.java [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_Print_transcript.txt [new file with mode: 0644]
developer/example/TM_SR_ND/TM_SR_ND_Set_CLI.java [new file with mode: 0644]
developer/javacđź–‰/Ariadne_TM_SR_ND.java
developer/javacđź–‰/Ariadne_TM_SR_ND_Array.java
developer/javacđź–‰/Ariadne_TM_SR_ND_List.java
developer/javacđź–‰/Ariadne_Test.java

diff --git a/developer/example/TM_SR_ND/ND_SR_TM_Array_CLI.java b/developer/example/TM_SR_ND/ND_SR_TM_Array_CLI.java
deleted file mode 100644 (file)
index bda904d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_Array;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class TM_SR_ND_Array_CLI {
-  public static void main( String[] args ){
-    // Create an Array
-    List<String> label_array = Arrays.asList( "A", "B", "C", "D" );
-
-    // Attach TM_SR_ND to the array
-    Ariadne_TM_SR_ND_Array<String> srm = Ariadne_TM_SR_ND_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);
-    }
-  }
-}
diff --git a/developer/example/TM_SR_ND/ND_SR_TM_Array_transcript.txt b/developer/example/TM_SR_ND/ND_SR_TM_Array_transcript.txt
deleted file mode 100644 (file)
index 4a1e3c1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-Reading: A
-Topology: SEGMENT
-Reading: B
-Topology: SEGMENT
-Reading: C
-Topology: SEGMENT
-Reading: D
-Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/ND_SR_TM_List_CLI.java b/developer/example/TM_SR_ND/ND_SR_TM_List_CLI.java
deleted file mode 100644 (file)
index 127d510..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND;
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_List;
-
-import java.util.LinkedList;
-
-public class TM_SR_ND_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 TM_SR_ND to the linked list and traverse
-    Ariadne_TM_SR_ND_List<String> srm = Ariadne_TM_SR_ND_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);
-    }
-  }
-}
diff --git a/developer/example/TM_SR_ND/ND_SR_TM_List_transcript.txt b/developer/example/TM_SR_ND/ND_SR_TM_List_transcript.txt
deleted file mode 100644 (file)
index 43b78f7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Reading: A
-Topology: SEGMENT
-Reading: B
-Topology: SEGMENT
-Reading: C
-Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/ND_SR_TM_Set_CLI.java b/developer/example/TM_SR_ND/ND_SR_TM_Set_CLI.java
deleted file mode 100644 (file)
index 7083403..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_Set;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class TM_SR_ND_Set_CLI {
-  public static void main( String[] args ){
-    // Create a Set
-    Set<String> label_set = new HashSet<>();
-    label_set.add("A");
-    label_set.add("B");
-    label_set.add("C");
-
-    // Attach TM_SR_ND to the set and traverse
-    Ariadne_TM_SR_ND_Set<String> srm = Ariadne_TM_SR_ND_Set.make(label_set);
-    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);
-    }
-  }
-}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Array_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_Array_CLI.java
new file mode 100644 (file)
index 0000000..bda904d
--- /dev/null
@@ -0,0 +1,23 @@
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_Array;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class TM_SR_ND_Array_CLI {
+  public static void main( String[] args ){
+    // Create an Array
+    List<String> label_array = Arrays.asList( "A", "B", "C", "D" );
+
+    // Attach TM_SR_ND to the array
+    Ariadne_TM_SR_ND_Array<String> srm = Ariadne_TM_SR_ND_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);
+    }
+  }
+}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Array_transcript.txt b/developer/example/TM_SR_ND/TM_SR_ND_Array_transcript.txt
new file mode 100644 (file)
index 0000000..4a1e3c1
--- /dev/null
@@ -0,0 +1,8 @@
+Reading: A
+Topology: SEGMENT
+Reading: B
+Topology: SEGMENT
+Reading: C
+Topology: SEGMENT
+Reading: D
+Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_List_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_List_CLI.java
new file mode 100644 (file)
index 0000000..8852f37
--- /dev/null
@@ -0,0 +1,25 @@
+import java.util.LinkedList;
+
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_List;
+
+public class TM_SR_ND_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 TM_SR_ND to the linked list and traverse
+    Ariadne_TM_SR_ND_List<String> srm = Ariadne_TM_SR_ND_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);
+    }
+  }
+}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_List_transcript.txt b/developer/example/TM_SR_ND/TM_SR_ND_List_transcript.txt
new file mode 100644 (file)
index 0000000..43b78f7
--- /dev/null
@@ -0,0 +1,6 @@
+Reading: A
+Topology: SEGMENT
+Reading: B
+Topology: SEGMENT
+Reading: C
+Topology: RIGHTMOST
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Print_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_Print_CLI.java
new file mode 100644 (file)
index 0000000..4e24e17
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+Example of the TM_SR_ND's toString function.
+
+*/
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND;
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_List;
+
+public class TM_SR_ND_Print_CLI{
+
+  public static void main(String[] args){
+    List<Object> data = Arrays.asList(42 ,null ,"" ,"World" ,1000);
+    Ariadne_TM_SR_ND tm = Ariadne_TM_SR_ND_List.make(data);
+    tm.step();
+    tm.step();
+    System.out.println(tm.toString());
+  }
+}
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Print_transcript.txt b/developer/example/TM_SR_ND/TM_SR_ND_Print_transcript.txt
new file mode 100644 (file)
index 0000000..6ff8231
--- /dev/null
@@ -0,0 +1,2 @@
+TM_SR_ND(SEGMENT(  42        World  1000  )
+                  |dd||-|<e>|ddddd||dddd|  
diff --git a/developer/example/TM_SR_ND/TM_SR_ND_Set_CLI.java b/developer/example/TM_SR_ND/TM_SR_ND_Set_CLI.java
new file mode 100644 (file)
index 0000000..7083403
--- /dev/null
@@ -0,0 +1,25 @@
+import com.ReasoningTechnology.Ariadne.Ariadne_TM_SR_ND_Set;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class TM_SR_ND_Set_CLI {
+  public static void main( String[] args ){
+    // Create a Set
+    Set<String> label_set = new HashSet<>();
+    label_set.add("A");
+    label_set.add("B");
+    label_set.add("C");
+
+    // Attach TM_SR_ND to the set and traverse
+    Ariadne_TM_SR_ND_Set<String> srm = Ariadne_TM_SR_ND_Set.make(label_set);
+    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);
+    }
+  }
+}
index a53a211..4d53353 100644 (file)
@@ -17,6 +17,8 @@ public class Ariadne_TM_SR_ND{
   // static
   //
 
+  protected static int id_well = 100;
+
   public enum Topology{
     NULL
     ,CYCLIC
@@ -32,14 +34,18 @@ public class Ariadne_TM_SR_ND{
   // instance data
   //
 
+  private int id;
+  Ariadne_Test test = null;
   protected TopoIface current_topology;
-  public final TopoIface not_mounted = new NotMounted();
   protected BigInteger index;
 
   // constructor(s)
   //
 
   public Ariadne_TM_SR_ND(){
+    id = id_well++;
+    test = Ariadne_Test.make("Ariadne_TM_SR_ND::" + id + "::");
+    test.switch_test(false);
     set_topology( not_mounted );
     this.index = BigInteger.ZERO;
   }
@@ -47,6 +53,10 @@ public class Ariadne_TM_SR_ND{
   // Implementation of instance interface.
   //
 
+  public int id(){
+    return this.id;
+  }
+
   public BigInteger head_address(){
     return index;
   }
@@ -56,43 +66,62 @@ public class Ariadne_TM_SR_ND{
   }
 
   public boolean head_on_same_cell(Ariadne_TM_SR_ND tm){
-    return this.index.equals(tm.index);
+    boolean p = this.index.equals(tm.index);
+    if( test.is_on() ){
+      test.print("head_on_same_cell this id/index: " + this.id() + "/" + this.index );
+      test.print("head_on_same_cell tm id/index: " + tm.id() + "/" + tm.index );
+      test.print("head_on_same_cell returning: " + p );
+    }
+    return p;
   }
 
-  public Ariadne_TM_SR_ND entangle(){
-    Ariadne_TM_SR_ND copy = make();
-
-    // entangled copy shares the same tape
-    copy.current_topology = this.current_topology; // Shares the same reference
-
+  protected void entangle(Ariadne_TM_SR_ND copy){
+    copy.current_topology = this.current_topology;
     // Nuance here, BigInteger is immutable, so operation on the original
     // index, and the copy index, will be independent, which is what we want.
     copy.index = this.index; 
-
-    return copy;
+  }
+  public Ariadne_TM_SR_ND entangle(){
+    throw new UnsupportedOperationException("Ariadne_TM_SR_ND::entangle not implemented.");
   }
 
   public boolean is_mounted(){
     return 
       current_topology != null 
-      && current_topology != not_mounted;
+      && current_topology != not_mounted
+      ;
+  }
+
+  public boolean can_rewind(){
+    return false;
+  }
+
+  public void rewind(){
+    index = BigInteger.ZERO;
   }
 
   public boolean can_read(){
-    return current_topology.can_read();
+    boolean p = current_topology.can_read();
+    if( test.is_on() ) test.print("can_read " + p);
+    return p;
   }
 
   public Object read(){
-    return current_topology.read();
+    Object o = current_topology.read();
+    if( test.is_on() ) test.print("read: " + o);
+    return o;
   }
 
   public boolean can_step(){
-    return current_topology.can_step();
+    boolean p = current_topology.can_step();
+    if( test.is_on() ) test.print("can_step " + p);
+    return p;
   }
 
   public void step(){
-    current_topology.step();
     increment();
+    if( test.is_on() ) test.print("step: " + index);
+    current_topology.step();
   }
 
   public Topology topology(){
@@ -102,6 +131,14 @@ public class Ariadne_TM_SR_ND{
   // Sets the tape access methods to be used.
   protected void set_topology(TopoIface new_topology){
     current_topology = new_topology;
+    if( test.is_on() ){
+      test.print("set_topology i: " + index);
+      if(is_mounted()){
+        test.print("set_topology to: " + new_topology.topology());
+      }else{
+        test.print("set_topology to: Unmounted");
+      }
+    }
   }
 
   protected interface TopoIface{
@@ -112,8 +149,7 @@ public class Ariadne_TM_SR_ND{
     Topology topology();
   }
 
-  // Initially, the tape has not been mounted.
-  protected class NotMounted implements TopoIface{
+  protected final TopoIface not_mounted = new TopoIface(){
     @Override public boolean can_read(){
       return false;
     }
@@ -129,8 +165,25 @@ public class Ariadne_TM_SR_ND{
     @Override public Topology topology(){
       throw new UnsupportedOperationException("Ariadne_TM_SR_ND::NotMounted::topology.");
     }
-  }
+    };
 
+  protected final TopoIface topo_null = new TopoIface(){
+    @Override public boolean can_read(){
+      return false;
+    }
+    @Override public Object read(){
+      throw new UnsupportedOperationException( "Cannot read from null topology." );
+    }
+    @Override public boolean can_step(){
+      return false;
+    }
+    @Override public void step(){
+      throw new UnsupportedOperationException( "Cannot step over null topology." );
+    }
+    @Override public Topology topology(){
+      return Topology.NULL;
+    }
+    };
 
   // good citizen
   //
@@ -139,28 +192,31 @@ public class Ariadne_TM_SR_ND{
     if(!is_mounted()) return "TM_SR_ND(NotMounted)";
     if(!can_read()) return "TM_SR_ND(Null)";
 
-    StringBuilder data_channel = new StringBuilder(" ");
-    StringBuilder control_channel = new StringBuilder("|");
+    StringBuilder data_channel = new StringBuilder("");
+    StringBuilder control_channel = new StringBuilder("");
     
     data_channel.append( "TM_SR_ND(" ).append( topology().name()).append("( " );
     control_channel.append( " ".repeat(data_channel.length()) );
 
     String element = null;
-    Ariadne_TM_SR_ND copy = (Ariadne_TM_SR_ND) this.entangle();
+    Ariadne_TM_SR_ND copy = this.entangle();
+    if( copy.can_rewind() ) copy.rewind();
+
     Object o = null;
     do{
+
       o = copy.read();
 
       if(o == null){
         data_channel.append( " ".repeat(3) );
-        if(head_on_same_cell(copy)){
+        if( head_on_same_cell(copy) ){
           control_channel.append("<->");
         }else{
           control_channel.append("|-|");
         }
       }else if(o.toString().isEmpty()){
         data_channel.append( " ".repeat(3) );
-        if(head_on_same_cell(copy)){
+        if( head_on_same_cell(copy) ){
           control_channel.append("<e>");
         }else{
           control_channel.append("|e|");
@@ -181,8 +237,9 @@ public class Ariadne_TM_SR_ND{
         }
       }
 
-      if(!copy.can_step()) break;
+      if( !copy.can_step() ) break;
       copy.step();
+
     }while(true);
 
     data_channel.append(" )");
@@ -192,7 +249,6 @@ public class Ariadne_TM_SR_ND{
       data_channel
       .append("\n")
       .append(control_channel)
-      .append("\n")
       .toString();
   }
 
index 32c5da2..62a88dc 100644 (file)
@@ -17,10 +17,6 @@ public class Ariadne_TM_SR_ND_Array<T> extends Ariadne_TM_SR_ND{
   
   private final List<T> array;
 
-  private final TopoIface topo_null = new TopoNull();
-  private final TopoIface topo_segment = new TopoSegment();
-  private final TopoIface topo_rightmost = new TopoRightmost();
-
   // Constructor
   protected Ariadne_TM_SR_ND_Array(List<T> array){
     super();
@@ -39,27 +35,22 @@ public class Ariadne_TM_SR_ND_Array<T> extends Ariadne_TM_SR_ND{
     set_topology( topo_segment );
   }
 
-  // TopoNull
-  private class TopoNull implements TopoIface{
-    @Override public boolean can_read(){
-      return false;
-    }
-    @Override public Object read(){
-      throw new UnsupportedOperationException( "Cannot read from NULL topo." );
-    }
-    @Override public boolean can_step(){
-      return false;
-    }
-    @Override public void step(){
-      throw new UnsupportedOperationException( "Cannot step from NULL topo." );
-    }
-    @Override public Topology topology(){
-      return Topology.NULL;
+  // instance interface implementation
+
+  @Override public boolean can_rewind(){
+    return true;
+  }
+
+  @Override public void rewind() {
+    super.rewind();
+    if (array == null || array.isEmpty()) {
+      set_topology(topo_null); // Null topology for empty or null arrays
+      return;
     }
+    set_topology(array.size() == 1 ? topo_rightmost : topo_segment); // Adjust topology
   }
 
-  // TopoSegment
-  private class TopoSegment implements TopoIface{
+  protected final TopoIface topo_segment = new TopoIface(){
     @Override public boolean can_read(){
       return true;
     }
@@ -76,10 +67,9 @@ public class Ariadne_TM_SR_ND_Array<T> extends Ariadne_TM_SR_ND{
     @Override public Topology topology(){
       return Topology.SEGMENT;
     }
-  }
+    };
 
-  // TopoRightmost
-  private class TopoRightmost implements TopoIface{
+  protected final TopoIface topo_rightmost = new TopoIface(){
     @Override public boolean can_read(){
       return true;
     }
@@ -95,5 +85,6 @@ public class Ariadne_TM_SR_ND_Array<T> extends Ariadne_TM_SR_ND{
     @Override public Topology topology(){
       return Topology.RIGHTMOST;
     }
-  }
+    };
+  
 }
index 85d9b1c..9163754 100644 (file)
@@ -27,10 +27,6 @@ public class Ariadne_TM_SR_ND_List<T> extends Ariadne_TM_SR_ND{
   private ListIterator<T> iterator;  // Iterator for traversal
   private T read_value;  // Stores the current cell value
 
-  private final TopoIface topo_null = new TopoNull();
-  private final TopoIface topo_segment = new TopoSegment();
-  private final TopoIface topo_rightmost = new TopoRightmost();
-
   // constructor(s)
   //
 
@@ -57,31 +53,60 @@ public class Ariadne_TM_SR_ND_List<T> extends Ariadne_TM_SR_ND{
   // instance interface implementation
   //
 
+  protected void entangle(Ariadne_TM_SR_ND_List<T> copy){
+    super.entangle(copy);
+    copy.read_value = this.read_value;
+    copy.iterator = this.list.listIterator(this.iterator.nextIndex());
+  }
+
+  @Override public Ariadne_TM_SR_ND_List<T> entangle(){
+    Ariadne_TM_SR_ND_List<T> copy = Ariadne_TM_SR_ND_List.make(this.list);
+
+    // Copy shared fields
+    copy.index = this.index; // Copy the step count
+    copy.read_value = this.read_value; // Synchronize the current read value
+    copy.iterator = this.list.listIterator(this.iterator.nextIndex()); // Align iterator
+
+    // Set the appropriate topology in the copy based on the current topology
+    switch (this.current_topology.topology()) {
+    case NULL:
+      copy.current_topology = copy.topo_null;
+      break;
+    case SEGMENT:
+      copy.current_topology = copy.topo_segment;
+      break;
+    case RIGHTMOST:
+      copy.current_topology = copy.topo_rightmost;
+      break;
+    default:
+      throw new IllegalStateException("Unexpected topology: " + this.current_topology.topology());
+    }
+
+    return copy;
+  }
+
+  @Override public boolean can_rewind(){
+    return true;
+  }
+
+  @Override public void rewind(){
+    super.rewind();
+    if(list == null || list.isEmpty()){
+      set_topology(topo_null);
+      return;
+    }
+    iterator = list.listIterator(); // Reset the iterator
+    read_value = iterator.next(); // Sync the read value
+    set_topology(list.size() == 1 ? topo_rightmost : topo_segment); // Adjust topology
+  }
+
   @Override 
   @SuppressWarnings("unchecked")
   public T read(){
     return (T) current_topology.read(); // Cast to ensure T is returned
   }
 
-  private class TopoNull implements TopoIface{
-    @Override public boolean can_read(){
-      return false;
-    }
-    @Override public T read(){
-      throw new UnsupportedOperationException( "Cannot read from NULL topo." );
-    }
-    @Override public boolean can_step(){
-      return false;
-    }
-    @Override public void step(){
-      throw new UnsupportedOperationException( "Cannot step over NULL topo." );
-    }
-    @Override public Topology topology(){
-      return Topology.NULL;
-    }
-  }
-
-  private class TopoSegment implements TopoIface{
+  protected final TopoIface topo_segment = new TopoIface(){
     @Override public boolean can_read(){
       return true;
     }
@@ -98,9 +123,9 @@ public class Ariadne_TM_SR_ND_List<T> extends Ariadne_TM_SR_ND{
     @Override public Topology topology(){
       return Topology.SEGMENT;
     }
-  }
+    };
 
-  private class TopoRightmost implements TopoIface{
+  protected final TopoIface topo_rightmost = new TopoIface(){
     @Override public boolean can_read(){
       return true;
     }
@@ -116,7 +141,7 @@ public class Ariadne_TM_SR_ND_List<T> extends Ariadne_TM_SR_ND{
     @Override public Topology topology(){
       return Topology.RIGHTMOST;
     }
-  }
+    };
 }
 
 
index 5ce6637..fd6618d 100644 (file)
@@ -14,6 +14,10 @@ public class Ariadne_Test {
   protected Ariadne_Test(){
   }
 
+  public boolean is_on(){
+    return test;
+  }
+
   public void switch_test(boolean enable){
     if( test && !enable ){
       print("test messages off");