AWESOME. Used just the R relation of definite reach to successfully improve the...
[IRC.git] / Robust / src / Tests / disjoint / definite / test.java
1 public class Foo {
2   public Foo f;
3   public Foo g;
4 }
5
6 public class Test {
7
8   
9
10   static public void main( String args[] ) {
11
12     gendefreach yn1;    
13
14     Foo x = getFlagged();
15     Foo y = getUnflagged();
16     x.f = y;
17
18     // x is flagged and y is reachable from
19     // at most one object from that site
20     gendefreach y0;
21     genreach y0;
22
23     Foo t = getFlagged();
24     t = getFlagged();
25
26     // x is flagged and y is reachable from
27     // at most one object from that site, even
28     // though x is summarized now
29     gendefreach y1;
30     genreach y1;
31
32     x.g = y;
33
34     // if we had definite reachability analysis
35     // we would realize y is already reachable
36     // from x, but we don't and x is summarized
37     // so we conservatively increase the arity
38     // of objects y is reachable from.
39     gendefreach y2;
40     genreach y2;
41
42     System.out.println( " "+x+y );
43   }
44
45   static public Foo getFlagged() {
46     return disjoint jupiter new Foo();
47   }
48
49   static public Foo getUnflagged() {
50     return new Foo();
51   }
52
53 }