X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FIR%2FTermination.java;h=689a5d2382169d166d58fc60a370cb68c663e303;hb=445c4854d296285d0ed336f8cb9002ab2e3e75bc;hp=b788acc3ac8937242cd905b7a216dbe8ff5778f5;hpb=6e6caa157ea20e565ea92786ef266c952e6f39b3;p=repair.git diff --git a/Repair/RepairCompiler/MCC/IR/Termination.java b/Repair/RepairCompiler/MCC/IR/Termination.java index b788acc..689a5d2 100755 --- a/Repair/RepairCompiler/MCC/IR/Termination.java +++ b/Repair/RepairCompiler/MCC/IR/Termination.java @@ -17,6 +17,8 @@ public class Termination { Hashtable consequence; Hashtable abstractadd; Hashtable abstractremove; + Hashtable conjtonodemap; + Set removedset; State state; @@ -33,7 +35,7 @@ public class Termination { consequencenodes=new HashSet(); abstractadd=new Hashtable(); abstractremove=new Hashtable(); - + conjtonodemap=new Hashtable(); generateconjunctionnodes(); generatescopenodes(); @@ -66,6 +68,12 @@ public class Termination { System.out.println(mun.toString()); } GraphAnalysis ga=new GraphAnalysis(this); + removedset=ga.doAnalysis(); + System.out.println("Removing:"); + for(Iterator it=removedset.iterator();it.hasNext();) { + GraphNode gn=(GraphNode)it.next(); + System.out.println(gn.getTextLabel()); + } } void generateconjunctionnodes() { @@ -82,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); } } } @@ -264,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(); @@ -275,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