}
}
+ protected void propagateTokens( HeapRegionNode nPrime,
+ ChangeTupleSet c0,
+ HashSet<HeapRegionNode> nodesWithNewAlpha,
+ HashSet<ReferenceEdgeProperties> edgesWithNewBeta ) {
-
- protected void propagateTokens( HeapRegionNode nPrime, ChangeTupleSet c0 ) {
HashSet<HeapRegionNode> todoNodes
= new HashSet<HeapRegionNode>();
todoNodes.add( nPrime );
Hashtable<ReferenceEdgeProperties, ChangeTupleSet> edgeChangesMade
= new Hashtable<ReferenceEdgeProperties, ChangeTupleSet>();
+ System.out.println( "New propagation with changes "+c0 );
+
while( !todoNodes.isEmpty() ) {
HeapRegionNode n = todoNodes.iterator().next();
todoNodes.remove( n );
+ System.out.println( " Propagating tokens over "+n );
+
if( !nodeChangesMade.containsKey( n ) ) {
nodeChangesMade.put( n, new ChangeTupleSet().makeCanonical() );
}
while( itrC.hasNext() ) {
ChangeTuple c = (ChangeTuple) itrC.next();
+ System.out.println( " Considering applying "+c );
+
if( n.getAlpha().contains( c.getSetToMatch() ) ) {
- n.setAlphaNew( n.getAlphaNew().union( c.getSetToAdd() ) );
+ n.setAlphaNew( n.getAlpha().union( c.getSetToAdd() ) );
+ nodesWithNewAlpha.add( n );
nodeChangesMade.put( n, nodeChangesMade.get( n ).union( c ) );
}
}
ReachabilitySet O = srcln.getReferenceTo( hrnSrc ).getBeta();
ChangeTupleSet C = O.unionUpArity( R );
- propagateTokens( hrnSrc, C );
+ propagateTokens( hrnSrc, C, nodesWithNewAlpha, edgesWithNewBeta );
}
}
LabelNode dst = getLabelNodeFromTemp( td );
clearReferenceEdgesFrom( dst );
- addReferenceEdge( dst, hrnNewest, new ReferenceEdgeProperties( false ) );
+
+ addReferenceEdge( dst, hrnNewest, new ReferenceEdgeProperties( false, false, null ) );
}
public ReachabilitySet() {
possibleReachabilities = new HashSet<TokenTupleSet>();
+ TokenTupleSet ttsEmpty = new TokenTupleSet().makeCanonical();
+ possibleReachabilities.add( ttsEmpty );
}
public ReachabilitySet( TokenTupleSet tts ) {
+ this();
assert tts != null;
- possibleReachabilities = new HashSet<TokenTupleSet>();
possibleReachabilities.add( tts );
}
public ReachabilitySet( TokenTuple tt ) {
- this( new TokenTupleSet( tt ) );
+ this( new TokenTupleSet( tt ).makeCanonical() );
}
public ReachabilitySet( ReachabilitySet rs ) {
assert rsIn != null;
ReachabilitySet rsOut = new ReachabilitySet( this );
+
+ System.out.println( "rsIn = "+rsIn );
+ System.out.println( "rsOut = "+rsOut );
+
rsOut.possibleReachabilities.addAll( rsIn.possibleReachabilities );
+
+ System.out.println( "union = "+rsOut );
+
return rsOut.makeCanonical();
}
Iterator i = this.iterator();
while( i.hasNext() ) {
- s += "\\n "+i.next();
+ if( possibleReachabilities.size() > 1 ) {
+ s += "\\n";
+ }
+ s += " "+i.next();
+ }
+
+ if( possibleReachabilities.size() > 1 ) {
+ s += "\\n";
}
- s += "]";
+ s += " ]";
return s;
}
Iterator i = this.iterator();
while( i.hasNext() ) {
- s += "\n "+i.next();
+ if( possibleReachabilities.size() > 1 ) {
+ s += "\n";
+ }
+ s += " "+i.next();
+ }
+
+ if( possibleReachabilities.size() > 1 ) {
+ s += "\n";
}
- s += "\n]";
+ s += " ]";
return s;
}