added back in the singularReductions cache, I wish we didnt need it but we do
[sbp.git] / src / edu / berkeley / sbp / Sequence.java
index d8f39fd..ac34264 100644 (file)
@@ -87,7 +87,7 @@ public abstract class Sequence extends Element implements Iterable<Element> {
     // Position //////////////////////////////////////////////////////////////////////////////
 
     /** the imaginary position before or after an element of a sequence; corresponds to an "LR item" */
-    public class Position {
+    public class Position implements IntegerMappable {
 
         private Forest zero = null;
         public Forest zero() {
@@ -151,8 +151,10 @@ public abstract class Sequence extends Element implements Iterable<Element> {
             ret.append("}>");
             return ret.toString();
         }
+        private final int idx = master_position_idx++;
+        public int toInt() { return idx; }
     }
-
+    private static int master_position_idx = 0;
 
     // toString //////////////////////////////////////////////////////////////////////////////