Allows creation of subgraphs of the dependency graph for debugging purposes.
[repair.git] / Repair / RepairCompiler / MCC / IR / SizeofPredicate.java
index fee97959dc4106e58f52eb0cb60851217fea29ba..4d375ac4f9a2f7c6cbbb96969986c0c56312792b 100755 (executable)
@@ -22,6 +22,29 @@ public class SizeofPredicate extends Predicate {
         this.cardinality = cardinality;
     }
 
+    public int[] getRepairs(boolean negated) {
+       if (setexpr instanceof ImageSetExpr) {
+           if (opcode==Opcode.EQ)
+               return new int[] {AbstractRepair.ADDTORELATION,
+                                     AbstractRepair.REMOVEFROMRELATION};
+           if (((opcode==Opcode.GE)&&!negated)||
+               ((opcode==Opcode.LE)&&negated))
+               return new int[]{AbstractRepair.ADDTORELATION};
+           else
+               return new int[]{AbstractRepair.REMOVEFROMRELATION};
+       } else {
+           if (opcode==Opcode.EQ)
+               return new int[] {AbstractRepair.ADDTOSET,
+                                     AbstractRepair.REMOVEFROMSET};
+
+           if (((opcode==Opcode.GE)&&!negated)||
+               ((opcode==Opcode.LE)&&negated))
+               return new int[] {AbstractRepair.ADDTOSET};
+           else 
+               return new int[] {AbstractRepair.REMOVEFROMSET};
+       }
+    }
+
     public Set getRequiredDescriptors() {
         assert setexpr != null;
         Set v = setexpr.getRequiredDescriptors();