Fixed a hack that was bugging me with a proper solution.
authorjjenista <jjenista>
Fri, 3 Oct 2008 21:47:05 +0000 (21:47 +0000)
committerjjenista <jjenista>
Fri, 3 Oct 2008 21:47:05 +0000 (21:47 +0000)
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java

index 735b86a41e645a3bc1e56e0dbb632c8a468c3eca..a4fa3272508cd3a2e0310c9eb63afa9c5e8e78d7 100644 (file)
@@ -437,7 +437,7 @@ public class OwnershipGraph {
        ChangeTupleSet Cx = R.unionUpArityToChangeSet(O);
 
 
-       HashSet<ReferenceEdge> todoEdges = new HashSet<ReferenceEdge>();
+       HashSet<ReferenceEdge> todoEdges = new HashSet<ReferenceEdge>();
 
        Hashtable<ReferenceEdge, ChangeTupleSet> edgePlannedChanges =
          new Hashtable<ReferenceEdge, ChangeTupleSet>();
@@ -453,32 +453,21 @@ public class OwnershipGraph {
                                 edgePlannedChanges,
                                 edgesWithNewBeta);
 
-
-       // THIS IS A HACK--NEED TO CHANGE GENERATATION OF BETA-NEW SO THIS DOESN'T
-       // HAPPEN OTHERWISE PROPAGATION FAILS
-       if( edgeY.getBetaNew().equals(new ReachabilitySet().makeCanonical() ) ) {
-         edgeY.setBetaNew(new ReachabilitySet(new TokenTupleSet().makeCanonical() ).makeCanonical() );
+       // if edgeY's beta was updated, use that to calculate beta for new edge
+       // otherwise the edgeY didn't change and it is the source for the calc
+       ReachabilitySet sourceBetaForNewEdge;
+       if( edgesWithNewBeta.contains( edgeY ) ) {
+         sourceBetaForNewEdge = edgeY.getBetaNew();
+       } else {
+         sourceBetaForNewEdge = edgeY.getBeta();
        }
 
-
-
-       /*
-          System.out.println( "---------------------------\n" +
-                           edgeY.getBetaNew() +
-                           "\nbeing pruned by\n" +
-                           hrnX.getAlpha() +
-                           "\nis\n" +
-                           edgeY.getBetaNew().pruneBy(hrnX.getAlpha())
-                           );
-        */
-
        // create the actual reference edge hrnX.f -> hrnY
        ReferenceEdge edgeNew = new ReferenceEdge(hrnX,
                                                  hrnY,
                                                  f,
                                                  false,
-                                                 edgeY.getBetaNew().pruneBy(hrnX.getAlpha() )
-                                                 //edgeY.getBeta().pruneBy( hrnX.getAlpha() )
+                                                 sourceBetaForNewEdge.pruneBy(hrnX.getAlpha() )
                                                  );
        addReferenceEdge(hrnX, hrnY, edgeNew);
 
index e4c750abc788d00a47cc8a72cf590540c38d7783..5b56727f7c50da8e4df9e3b9476e8163828b6b3a 100644 (file)
@@ -1,12 +1,12 @@
 
 public class Parameter {
   flag w;
-  int a;
-  int b;
-  Parameter f;
-  Parameter g;
-  Penguin p;
-  Foo h;
+  //int a;
+  //int b;
+  //Parameter f;
+  //Parameter g;
+  //Penguin p;
+  //Foo h;
   
   public Parameter() {}
   
@@ -28,6 +28,7 @@ public class Fooz {
   public Fooz x;
 }
 
+/*
 public class Penguin {
   int x;
   int y;
@@ -187,7 +188,7 @@ public class Foo {
     p1.y = g0;
   }
 }
-
+*/
 
 
 // this empty task should still create a non-empty
@@ -696,7 +697,7 @@ task methodTest08_( Foo p0{ f }, Foo p1{ f } ) {
 }
 */
 
-
+/*
 task methodTest09_( Foo p0{ f }, Foo p1{ f } ) {
 
   Foo a0before = new Foo();
@@ -732,4 +733,4 @@ task methodTest09_( Foo p0{ f }, Foo p1{ f } ) {
 
   taskexit( p0{ !f }, p1{ !f } );
 }
-
+*/