Added:
[repair.git] / Repair / RepairCompiler / MCC / IR / Termination.java
index 695699c178193b74784c564323b5fb1b1ef2cabe..689a5d2382169d166d58fc60a370cb68c663e303 100755 (executable)
@@ -17,7 +17,7 @@ public class Termination {
     Hashtable consequence;
     Hashtable abstractadd;
     Hashtable abstractremove;
-
+    Hashtable conjtonodemap;
     Set removedset;
 
     State state;
@@ -35,7 +35,7 @@ public class Termination {
        consequencenodes=new HashSet();
        abstractadd=new Hashtable();
        abstractremove=new Hashtable();
-
+       conjtonodemap=new Hashtable();
 
        generateconjunctionnodes();
        generatescopenodes();
@@ -90,6 +90,7 @@ public class Termination {
                if (!conjunctionmap.containsKey(c))
                    conjunctionmap.put(c,new HashSet());
                ((Set)conjunctionmap.get(c)).add(gn);
+               conjtonodemap.put(dnf.get(j),gn);
            }
        }
     }
@@ -272,9 +273,10 @@ public class Termination {
            Rule r=(Rule) state.vRules.get(i);
            Vector possiblerules=new Vector();
            /* Construct bindings */
-           Vector bindings=new Vector();
-           constructbindings(bindings, r,true);
-           
+           /* No need to construct bindings on remove
+              Vector bindings=new Vector();
+              constructbindings(bindings, r,true);
+           */
            for(int j=0;j<(r.numQuantifiers()+r.getDNFNegGuardExpr().size());j++) {
                GraphNode gn=(GraphNode)scopesatisfy.get(r);
                TermNode tn=(TermNode) gn.getOwner();
@@ -283,7 +285,8 @@ public class Termination {
                TermNode tn2=new TermNode(mun);
                GraphNode gn2=new GraphNode("CompRem"+compensationcount,tn2);
                UpdateNode un=new UpdateNode(r);
-               un.addBindings(bindings);
+               //              un.addBindings(bindings);
+               // Not necessary
                if (j<r.numQuantifiers()) {
                    /* Remove quantifier */
                    Quantifier q=r.getQuantifier(j);
@@ -383,9 +386,10 @@ public class Termination {
                Rule r=(Rule)possiblerules.get(i);
                UpdateNode un=new UpdateNode(r);
                /* Construct bindings */
-               Vector bindings=new Vector();
-               constructbindings(bindings, r,true);
-               un.addBindings(bindings);
+               /* No Need to construct bindings on remove
+                  Vector bindings=new Vector();
+                  constructbindings(bindings, r,true);
+                 un.addBindings(bindings);*/
                if (count[i]<r.numQuantifiers()) {
                    /* Remove quantifier */
                    Quantifier q=r.getQuantifier(count[i]);