Quantifiers use relations!!!
[repair.git] / Repair / RepairCompiler / MCC / IR / Expr.java
index 771b9f8d8197194d5446db40631dda736eb0c44a..9eb610653591d7f8ac79a293cf916c0aadf0bef1 100755 (executable)
@@ -3,7 +3,7 @@ package MCC.IR;
 import java.util.*;
 
 public abstract class Expr {
-    
+
     TypeDescriptor td = null;
 
     public Expr() {}
@@ -19,6 +19,10 @@ public abstract class Expr {
         return td;
     }
 
+    public String toString() {
+        return name();
+    }
+
     public String name() {
        System.out.println(this.getClass().getName());
        return "?";
@@ -40,7 +44,7 @@ public abstract class Expr {
        return null;
     }
 
-    public boolean isValue() {
+    public boolean isValue(TypeDescriptor td) {
        return false;
     }
 
@@ -53,6 +57,10 @@ public abstract class Expr {
        return false;
     }
 
+    public Set useDescriptor(Descriptor d) {
+       return new HashSet();
+    }
+
     public boolean usesDescriptor(Descriptor rd) {
        System.out.println(this.getClass().getName());
        throw new Error("UNIMPLEMENTED");
@@ -75,10 +83,31 @@ public abstract class Expr {
     }
 
     public SetDescriptor getSet() {
-       throw new Error("No Set for this Expr");
+       return null; /* unknown value */
+    }
+
+    public Expr stripCastExpr() {
+       Expr ptr=this;
+       while (ptr instanceof CastExpr)
+           ptr=((CastExpr)ptr).getExpr();
+       return ptr;
     }
 
     public boolean isSafe() {
        return true;
     }
+
+    public Expr getLower() {
+       return null;
+    }
+
+    public Expr getUpper() {
+       return null;
+    }
+    public boolean isInvariant(Set vars) {
+       return false;
+    }
+    public Set findInvariants(Set vars) {
+       return new HashSet();
+    }
 }