Broadening implementation for reachability in ownership analysis.
[IRC.git] / Robust / src / Analysis / OwnershipAnalysis / ChangeTupleSet.java
1 package Analysis.OwnershipAnalysis;
2
3 import IR.*;
4 import IR.Flat.*;
5 import java.util.*;
6 import java.io.*;
7
8
9 public class ChangeTupleSet {
10
11     public HashSet<ChangeTuple> changeTuples;
12
13     public ChangeTupleSet() {
14         changeTuples = new HashSet<ChangeTuple>();
15     }
16
17     public ChangeTupleSet( ChangeTuple ct ) {
18         this();
19         changeTuples.add( ct );
20     }
21
22     public ChangeTupleSet( ChangeTupleSet cts ) {
23         changeTuples = (HashSet<ChangeTuple>) cts.changeTuples.clone(); //COPY?!
24     }
25
26     public ChangeTupleSet union( ChangeTupleSet ctsIn ) {
27         ChangeTupleSet ctsOut = new ChangeTupleSet( this );
28         ctsOut.changeTuples.addAll( ctsIn.changeTuples );
29         return ctsOut;
30     }
31
32     public boolean isSubset( ChangeTupleSet ctsIn ) {
33         return ctsIn.changeTuples.containsAll( this.changeTuples );
34     }
35
36     public String toString() {
37         return changeTuples.toString();
38     }
39 }