Fix tabbing.... Please fix your editors so they do tabbing correctly!!! (Spaces...
[IRC.git] / Robust / src / Analysis / Disjoint / ChangeTuple.java
index d192d217ea19c27608d487f9ac9dfdf5a0138f86..9d1b96dc6e9aac585da2630d8868f8148c14ca90 100644 (file)
@@ -32,41 +32,52 @@ public class ChangeTuple extends Canonical
   protected ReachState toMatch;
   protected ReachState toAdd;
 
-  public static ChangeTuple factory( ReachState toMatch,
-                                     ReachState toAdd ) {
-    ChangeTuple out = new ChangeTuple( toMatch,
-                                       toAdd );
-    out = (ChangeTuple) Canonical.makeCanonical( out );
+  public static ChangeTuple factory(ReachState toMatch,
+                                    ReachState toAdd) {
+    // we don't care about the predicates hanging on
+    // change tuple states, so always set them to empty
+    // to ensure change tuple sets work out
+    ReachState toMatchNoPreds =
+      ReachState.factory(toMatch.reachTuples,
+                         ExistPredSet.factory()
+                         );
+    ReachState toAddNoPreds =
+      ReachState.factory(toAdd.reachTuples,
+                         ExistPredSet.factory()
+                         );
+    ChangeTuple out = new ChangeTuple(toMatchNoPreds,
+                                      toAddNoPreds);
+    out = (ChangeTuple) Canonical.makeCanonical(out);
     return out;
   }
 
-  protected ChangeTuple( ReachState toMatch,
-                         ReachState toAdd ) {
+  protected ChangeTuple(ReachState toMatch,
+                        ReachState toAdd) {
     this.toMatch = toMatch;
     this.toAdd   = toAdd;
   }
 
-  public ReachState getSetToMatch() {
+  public ReachState getStateToMatch() {
     return toMatch;
   }
-  public ReachState getSetToAdd() {
+  public ReachState getStateToAdd() {
     return toAdd;
   }
-  
 
-  public boolean equals( Object o ) {
+
+  public boolean equalsSpecific(Object o) {
     if( o == null ) {
       return false;
     }
-    
+
     if( !(o instanceof ChangeTuple) ) {
       return false;
     }
 
     ChangeTuple ct = (ChangeTuple) o;
-    assert this.isCanonical();
-    assert ct.isCanonical();
-    return this == ct;
+    return
+      toMatch.equals(ct.toMatch) &&
+      toAdd.equals(ct.toAdd);
   }
 
   public int hashCodeSpecific() {