return possibleReachabilities.iterator();
}
-
+
public int size() {
return possibleReachabilities.size();
}
while( itrR.hasNext() ) {
TokenTupleSet r = (TokenTupleSet) itrR.next();
- TokenTupleSet theUnion = new TokenTupleSet();
+ TokenTupleSet theUnion = new TokenTupleSet().makeCanonical();
Iterator itrRelement = r.iterator();
while( itrRelement.hasNext() ) {
TokenTuple ttR = (TokenTuple) itrRelement.next();
- TokenTuple ttO = o.containsToken( ttR.getToken() );
+ TokenTuple ttO = o.containsToken(ttR.getToken() );
if( ttO != null ) {
- theUnion = theUnion.union( new TokenTupleSet( ttR.unionArity(ttO) ) ).makeCanonical();
+ theUnion = theUnion.union(new TokenTupleSet(ttR.unionArity(ttO) ) ).makeCanonical();
} else {
- theUnion = theUnion.union( new TokenTupleSet( ttR ) ).makeCanonical();
+ theUnion = theUnion.union(new TokenTupleSet(ttR) ).makeCanonical();
}
}
Iterator itrOelement = o.iterator();
while( itrOelement.hasNext() ) {
TokenTuple ttO = (TokenTuple) itrOelement.next();
- TokenTuple ttR = theUnion.containsToken( ttO.getToken() );
+ TokenTuple ttR = theUnion.containsToken(ttO.getToken() );
if( ttR == null ) {
- theUnion = theUnion.union( new TokenTupleSet(ttO) ).makeCanonical();
+ theUnion = theUnion.union(new TokenTupleSet(ttO) ).makeCanonical();
}
}
-
+
if( !theUnion.isEmpty() ) {
- ctsOut = ctsOut.union( new ChangeTupleSet( new ChangeTuple(o, theUnion) ) );
+ ctsOut = ctsOut.union(new ChangeTupleSet(new ChangeTuple(o, theUnion) ) );
}
}
}
int numDimensions = this.possibleReachabilities.size();
- if( numDimensions > 6 ) {
+ if( numDimensions > 1 ) {
// for problems that are too big, punt and use less
// precise arity for reachability information
TokenTupleSet ttsImprecise = new TokenTupleSet().makeCanonical();
Iterator<TokenTupleSet> itrThis = this.iterator();
while( itrThis.hasNext() ) {
TokenTupleSet ttsUnit = itrThis.next();
- ttsImprecise = ttsImprecise.unionUpArity( ttsUnit.makeArityZeroOrMore() );
+ ttsImprecise = ttsImprecise.unionUpArity(ttsUnit.makeArityZeroOrMore() );
}
- rsOut = rsOut.union( ttsImprecise );
+ //rsOut = this.union( ttsImprecise );
+ rsOut = rsOut.union(ttsImprecise);
return rsOut;
}
-
// add an extra digit to detect termination
int[] digits = new int[numDimensions+1];
return possibleReachabilities.equals(rs.possibleReachabilities);
}
+
+ private boolean oldHashSet = false;
+ private int oldHash = 0;
public int hashCode() {
- return possibleReachabilities.hashCode();
+ int currentHash = possibleReachabilities.hashCode();
+
+ if( oldHashSet == false ) {
+ oldHash = currentHash;
+ oldHashSet = true;
+ } else {
+ if( oldHash != currentHash ) {
+ System.out.println("IF YOU SEE THIS A CANONICAL ReachabilitySet CHANGED");
+ Integer x = null;
+ x.toString();
+ }
+ }
+
+ return currentHash;
}