From 1a8a3cb17f4e40b028712e839c0f76b8ab66cd75 Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 3 Oct 2008 21:47:05 +0000 Subject: [PATCH] Fixed a hack that was bugging me with a proper solution. --- .../OwnershipAnalysis/OwnershipGraph.java | 29 ++++++------------- .../OwnershipAnalysisTest/test01/test01.java | 19 ++++++------ 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 735b86a4..a4fa3272 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -437,7 +437,7 @@ public class OwnershipGraph { ChangeTupleSet Cx = R.unionUpArityToChangeSet(O); - HashSet todoEdges = new HashSet(); + HashSet todoEdges = new HashSet(); Hashtable edgePlannedChanges = new Hashtable(); @@ -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); diff --git a/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java b/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java index e4c750ab..5b56727f 100644 --- a/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java +++ b/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java @@ -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 } ); } - +*/ -- 2.34.1