Quantifiers use relations!!!
[repair.git] / Repair / RepairCompiler / MCC / IR / Expr.java
index 77ccbc630b44c46b305fa550207ef35207f36a13..9eb610653591d7f8ac79a293cf916c0aadf0bef1 100755 (executable)
@@ -3,11 +3,11 @@ package MCC.IR;
 import java.util.*;
 
 public abstract class Expr {
-    
+
     TypeDescriptor td = null;
 
     public Expr() {}
-
+    /* Remap this's variables using the remap mapping */
     public abstract boolean equals(Map remap, Expr e);
 
     public abstract Set getRequiredDescriptors();
@@ -19,6 +19,15 @@ public abstract class Expr {
         return td;
     }
 
+    public String toString() {
+        return name();
+    }
+
+    public String name() {
+       System.out.println(this.getClass().getName());
+       return "?";
+    }
+
     public abstract TypeDescriptor typecheck(SemanticAnalyzer sa);
 
     public abstract void prettyPrint(PrettyPrinter pp);
@@ -35,16 +44,70 @@ public abstract class Expr {
        return null;
     }
 
-    public int[] getRepairs(boolean negated) {
-       return new int[0];
+    public boolean isValue(TypeDescriptor td) {
+       return false;
+    }
+
+    public int[] getRepairs(boolean negated, Termination t) {
+       System.out.println(this.getClass().getName());
+       throw new Error("Unrecognized EXPR");
     }
 
     public boolean inverted() {
        return false;
     }
 
-    public boolean usesDescriptor(RelationDescriptor rd) {
+    public Set useDescriptor(Descriptor d) {
+       return new HashSet();
+    }
+
+    public boolean usesDescriptor(Descriptor rd) {
+       System.out.println(this.getClass().getName());
+       throw new Error("UNIMPLEMENTED");
+    }
+    public boolean isNull() {
+       return false;
+    }
+    public boolean isNonNull() {
        return false;
     }
+    public Set freeVars() {
+       return null;
+    }
+
+    public void findmatch(Descriptor d, Set s) {
+    }
 
+    public Set getfunctions() {
+       return null;
+    }
+
+    public SetDescriptor getSet() {
+       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();
+    }
 }