More changes
authorbdemsky <bdemsky>
Tue, 6 Jan 2004 03:24:20 +0000 (03:24 +0000)
committerbdemsky <bdemsky>
Tue, 6 Jan 2004 03:24:20 +0000 (03:24 +0000)
Repair/RepairCompiler/MCC/IR/BooleanLiteralExpr.java
Repair/RepairCompiler/MCC/IR/CastExpr.java
Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java
Repair/RepairCompiler/MCC/IR/Expr.java
Repair/RepairCompiler/MCC/IR/IntegerLiteralExpr.java
Repair/RepairCompiler/MCC/IR/Termination.java
Repair/RepairCompiler/MCC/IR/TokenLiteralExpr.java

index d0729e6..be7eb88 100755 (executable)
@@ -11,6 +11,14 @@ public class BooleanLiteralExpr extends LiteralExpr {
         td = ReservedTypeDescriptor.INT;
     }
 
+    public abstract boolean equals(Map remap, Expr e) {
+       if (e==null)
+           return false;
+       else if (!e instanceof BooleanLiteralExpr)
+           return false;
+       else return (((BooleanLiteralExpr)e).value==value);
+    }
+
     public boolean getValue() {
         return value;
     }
index 83a1ddb..dc9c543 100755 (executable)
@@ -12,6 +12,14 @@ public class CastExpr extends Expr {
         this.expr = expr;
     }
 
+    public abstract boolean equals(Map remap, Expr e) {
+       if (e==null)
+           return false;
+       else if (!e instanceof CastExpr)
+           return false;
+       else return ((this.type==((CastExpr)e).type)&&equals(remap,expr,((CastExpr)e).expr));
+    }
+
     public Set getRequiredDescriptors() {
         return expr.getRequiredDescriptors();
     }
index d728062..e6718a6 100755 (executable)
@@ -6,12 +6,13 @@ class ConcreteInterferes {
            UpdateNode un=mun.getUpdate(i);
            for (int j=0;j<un.numUpdates();j++) {
                Updates update=un.getUpdate(j);
-               Descriptor des=update.getDescriptor();
                DNFRule drule=r.getDNFGuardExpr();
                for(int k=0;k<drule.size();k++) {
                    RuleConjunction rconj=drule.get(k);
                    for(int l=0;l<rconj.size();l++) {
                        DNFExpr dexpr=rconj.get(l);
+                       /* See if update interfers w/ dexpr */
+                       Descriptor updatedes=update.getDescriptor();
                        
                    }
                }
@@ -19,6 +20,4 @@ class ConcreteInterferes {
        }
        return false;
     }
-
-
 }
index 310e5ae..77ccbc6 100755 (executable)
@@ -8,6 +8,8 @@ public abstract class Expr {
 
     public Expr() {}
 
+    public abstract boolean equals(Map remap, Expr e);
+
     public abstract Set getRequiredDescriptors();
 
     public abstract void generate(CodeWriter writer, VarDescriptor dest);
index 46a8111..49f52b5 100755 (executable)
@@ -9,6 +9,14 @@ public class IntegerLiteralExpr extends LiteralExpr {
         td = ReservedTypeDescriptor.INT;
     }
 
+    public abstract boolean equals(Map remap, Expr e) {
+       if (e==null)
+           return false;
+       else if (!e instanceof IntegerLiteralExpr)
+           return false;
+       else return (((IntegerLiteralExpr)e).value==value);
+    }
+
     public int getValue() {
         return value;
     }
index 351f468..4d34f00 100755 (executable)
@@ -254,9 +254,10 @@ public class Termination {
                            boolean foundall=true;
                            if ((q instanceof SetQuantifier)||(q instanceof ForQuantifier)) {
                                VarDescriptor vd=null;
-                               if (q instanceof SetQuantifier)
+                               SetDescriptor set=null;
+                               if (q instanceof SetQuantifier) {
                                    vd=((SetQuantifier)q).getVar();
-                               else
+                               else
                                    vd=((ForQuantifier)q).getVar();
                                if(inc instanceof SetInclusion) {
                                    SetInclusion si=(SetInclusion)inc;
index 0a7c6f2..71b2ae0 100755 (executable)
@@ -22,6 +22,14 @@ public class TokenLiteralExpr extends LiteralExpr {
         }           
     }
 
+    public abstract boolean equals(Map remap, Expr e) {
+       if (e==null)
+           return false;
+       else if (!e instanceof TokenLiteralExpr)
+           return false;
+       else return ((BooleanLiteralExpr)e).num.equals(num);
+    }
+
     public String getValue() {
         return token;
     }