Fixed lot of random bugs. Added code generate strings for expr's.
[repair.git] / Repair / RepairCompiler / MCC / IR / RelationExpr.java
index fc2a4c7dabcc76494438fefd1e821e7c9b42b4bf..543b8e78cc4391088b5ada51dadd9fca1eb4f144 100755 (executable)
@@ -14,11 +14,32 @@ public class RelationExpr extends Expr {
         this.inverse = inverse;
     }
 
+    public String name() {
+       String name=expr.name()+".";
+       if (inverse)
+           name+="~";
+       name+=relation.toString();
+       return name;
+    }
+
     public Expr getExpr() {
         return expr;
     }
 
-    public boolean usesDescriptor(RelationDescriptor rd) {
+    public boolean equals(Map remap, Expr e) {
+       if (e==null||!(e instanceof RelationExpr))
+           return false;
+       RelationExpr re=(RelationExpr)e;
+       if (re.relation!=relation)
+           return false;
+       if (!expr.equals(remap,re.expr))
+           return false;
+       if (inverse!=re.inverse)
+           return false;
+       return true;
+    }
+
+    public boolean usesDescriptor(Descriptor rd) {
        if (rd==relation)
            return true;
        else