Modify Generators to allow multiple specs
[repair.git] / Repair / RepairCompiler / MCC / IR / ExprPredicate.java
index 04b223ac205163fbdae870416e09c7cc7ed5eb64..7c305db39f035989ffb47f0d57121735a3fcb055 100755 (executable)
@@ -3,13 +3,16 @@ package MCC.IR;
 import java.util.*;
 
 public class ExprPredicate extends Predicate {
-    
     Expr expr;
 
-
     public static final int SIZE=1;
     public static final int COMPARISON=2;
 
+    public TypeDescriptor typecheck(SemanticAnalyzer sa) {
+       TypeDescriptor t=expr.typecheck(sa);
+       return t;
+    }
+
     public String name() {
        return expr.name();
     }
@@ -26,8 +29,13 @@ public class ExprPredicate extends Predicate {
        return ((OpExpr)expr).opcode;
     }
 
-    public int leftsize() {
-       return ((IntegerLiteralExpr)((OpExpr)expr).right).getValue();
+    public int rightSize() {
+       assert isRightInt();
+       return OpExpr.getInt(((OpExpr)expr).right);
+    }
+
+    public boolean isRightInt() {
+       return OpExpr.isInt(((OpExpr)expr).right);
     }
 
     public ExprPredicate(Expr expr) {
@@ -41,8 +49,8 @@ public class ExprPredicate extends Predicate {
         return expr.getInversedRelations();
     }
 
-    public int[] getRepairs(boolean negated) {
-       return expr.getRepairs(negated);
+    public int[] getRepairs(boolean negated, Termination t) {
+       return expr.getRepairs(negated,t);
     }
 
     public Descriptor getDescriptor() {
@@ -53,7 +61,7 @@ public class ExprPredicate extends Predicate {
        return expr.inverted();
     }
 
-    public boolean usesDescriptor(RelationDescriptor rd) {
+    public boolean usesDescriptor(Descriptor rd) {
        return expr.usesDescriptor(rd);
     }