-/*
+
public class Parameter {
flag w;
- int a, b;
- Parameter f, g;
+ int a;
+ int b;
+ Parameter f;
+ Parameter g;
Penguin p;
Foo h;
}
public class Penguin {
- int x, y;
+ int x;
+ int y;
Foo h;
public Penguin() { x = 0; y = 0; }
public void doTheBaw( Voo v ) { v = new Voo(); }
}
-*/
-
-
-task ObjectChainByMethodCalls( Foo a{ f } ) {
-
- Foo f = a.getAFoo();
- Foo g = a.newFooChain( f );
- // g -> f
-
- taskexit( a{ !f } );
-}
public class Foo {
public Foo x;
public Foo y;
public Foo z;
-
+ public Baw b;
public Foo getAFoo() {
return new Foo();
return b;
}
-
- /*
public void ruinSomeFoos( Foo a, Foo b ) {
a.x = b.x;
}
p0.y = p1;
p1.y = p0;
}
- */
}
+
// this empty task should still create a non-empty
// ownership graph showing parameter allocation
// look for the parameter s as a label referencing
// a heap region that is multi-object, flagged, not summary
task Startup( StartupObject s{ initialstate } ) {
- taskexit( s{ !initialstate } );
+
+ Parameter p0 = new Parameter();
+
+ //int a, b, c;
+
+
+ int a = 1;
+ int b = 2;
+ int c = 3;
+
+ b = c;
+ a = b;
+
+
+ taskexit( s{ !initialstate } );
}
-/*
+
task NewObjectA( Foo a{ f }, Foo b{ f } ) {
Foo c = new Foo();
}
+task ObjectChainByMethodCalls( Foo a{ f } ) {
+
+ Foo f = a.getAFoo();
+ Foo g = a.newFooChain( f );
+ // g -> f
+
+ taskexit( a{ !f } );
+}
+
+
+task arrayAssignments( Foo a{ f } ) {
+
+ Foo f[] = new Foo[3];
+
+ Foo g = new Foo();
+ Foo h = new Foo();
+
+ f[1] = g;
+ f[2] = h;
+
+ Foo i = f[0];
+
+ taskexit( a{ !f } );
+}
+
+
+public class Zool {
+ public Zool() {}
+
+ public static void FooToBaw( Baw x, Foo y ) {
+ x.f.b = y.b;
+ }
+}
+
+task showPrunedEdgesInMethodCall( Foo a{ f } ) {
+
+ Foo b = new Foo();
+ b.x = a;
+ b.y = new Foo();
+ b.b = new Baw();
+
+ Baw c = new Baw();
+ c.f = new Foo();
+ c.f.b = new Baw();
+
+ Zool.FooToBaw( c, b );
+
+ taskexit( a{ !f } );
+}
+
+
task methodTest( Foo p0{ f } ) {
Foo up0 = new Foo();
taskexit( p0{ !f }, p1{ !f } );
}
-*/
\ No newline at end of file