From ea5cc72b2325c08f90457d133a46d8fd0066223c Mon Sep 17 00:00:00 2001
From: jjenista <jjenista>
Date: Sun, 27 Jul 2008 22:17:25 +0000
Subject: [PATCH] Token propagation for normal assignments fixed.  Tokens do
 not "age" with edges properly during assignment to new allocation yet.

---
 .../OwnershipAnalysis/OwnershipGraph.java     | 25 ++++++++++++++-----
 .../OwnershipAnalysis/TokenTupleSet.java      |  2 +-
 .../OwnershipAnalysisTest/test01/test01.java  | 11 ++++++++
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
index ab25e11a..a7a65cd0 100644
--- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
+++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
@@ -357,9 +357,10 @@ public class OwnershipGraph {
 		ReferenceEdgeProperties rep2 = (ReferenceEdgeProperties) meH.getValue();
 		ReachabilitySet beta2        = rep2.getBeta();
 
-		ReferenceEdgeProperties rep = rep2.copy();
-		rep.setIsInitialParamReflexive( false );
-		rep.setBeta( beta1.intersection( beta2 ) );
+		ReferenceEdgeProperties rep = 
+		    new ReferenceEdgeProperties( false,
+						 false,
+						 beta1.intersection( beta2 ) );
 
 		addReferenceEdge( dstln, hrnOneHop, rep );
 	    }
@@ -399,18 +400,27 @@ public class OwnershipGraph {
 		
 		ReachabilitySet O = srcln.getReferenceTo( hrnSrc ).getBeta();
 
+		ReferenceEdgeProperties repNew 
+		    = new ReferenceEdgeProperties( false, false, repSrc.getBeta() );
+
+		addReferenceEdge( hrn, hrnSrc, repNew );
+
+
+
 		ChangeTupleSet Cy = O.unionUpArityToChangeSet( R );
-		ChangeTupleSet Cx = R.unionUpArityToChangeSet( O );
+		//ChangeTupleSet Cx = R.unionUpArityToChangeSet( O );
 
 		propagateTokens( hrnSrc, Cy, nodesWithNewAlpha, edgesWithNewBeta );
-		propagateTokens( hrn,    Cx, nodesWithNewAlpha, edgesWithNewBeta );
+		//propagateTokens( hrn,    Cx, nodesWithNewAlpha, edgesWithNewBeta );
 
+		/*
 		// note that this picks up the beta after the propogation has
 		// been applied
 		ReferenceEdgeProperties repNew 
 		    = new ReferenceEdgeProperties( false, false, repSrc.getBetaNew() );
 
 		addReferenceEdge( hrn, hrnSrc, repNew );
+		*/
 	    }
 	}	
 
@@ -691,6 +701,7 @@ public class OwnershipGraph {
 	clearReferenceEdgesFrom( hrn0 );
 	clearReferenceEdgesTo  ( hrn0 );
 
+	/*
 	// now tokens in reachability sets need to "age" as well
 	ReferenceEdgeProperties repToAge = null;
 	Iterator itrAllLabelNodes = td2ln.entrySet().iterator();
@@ -722,7 +733,9 @@ public class OwnershipGraph {
 
 		ageTokens( as, repToAge );
 	    }
-	}       	
+	}
+	*/
+      	
     }
 
     protected void ageTokens( AllocationSite as, ReferenceEdgeProperties rep ) {
diff --git a/Robust/src/Analysis/OwnershipAnalysis/TokenTupleSet.java b/Robust/src/Analysis/OwnershipAnalysis/TokenTupleSet.java
index ecf0633e..c9c96abe 100644
--- a/Robust/src/Analysis/OwnershipAnalysis/TokenTupleSet.java
+++ b/Robust/src/Analysis/OwnershipAnalysis/TokenTupleSet.java
@@ -172,7 +172,7 @@ public class TokenTupleSet extends Canonical {
 		} else {
 		    // otherwise, we change this token to the
 		    // next older token
-		    Integer tokenToChangeTo = as.getIthOldest( age + 1 );
+		    Integer tokenToChangeTo = as.getIthOldest( age + 1 );		   
 		    tt = tt.changeTokenTo( tokenToChangeTo );
 		}
 	    }
diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java b/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
index 2072c0b4..8b843453 100644
--- a/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
+++ b/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
@@ -59,12 +59,23 @@ task Startup( StartupObject s{ initialstate } ) {
 	a.x   = new Foo();
     }
 
+    /*
     Foo b;
     while( false ) {
 	Foo c = new Foo();
 	c.x = b;
 	b = c;
     }
+    */
+
+    /*
+    Foo a = new Foo();
+    Foo b = new Foo();
+    Foo c = new Foo();
+
+    a.x = b;
+    b.x = c;    
+    */
 
     taskexit( s{ !initialstate } );
 }
-- 
2.34.1