X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=blobdiff_plain;f=Repair%2FRepairCompiler%2FMCC%2FIR%2FTermination.java;h=046e06062ba0481f9f21aa9a4d270f8475c9dc02;hp=764453f239535d979d072aa28fea54d0c94d9060;hb=494b62b8ddfc3c3a7282aab4ad96d0e10fb1d1bc;hpb=b02602973feb8ecb4fbb29562b04df1ebc214d2d diff --git a/Repair/RepairCompiler/MCC/IR/Termination.java b/Repair/RepairCompiler/MCC/IR/Termination.java index 764453f..046e060 100755 --- a/Repair/RepairCompiler/MCC/IR/Termination.java +++ b/Repair/RepairCompiler/MCC/IR/Termination.java @@ -31,6 +31,12 @@ public class Termination { ExactSize exactsize; ArrayAnalysis arrayanalysis; Sources sources; + static String conjoption="style=bold"; + static String absrepoption="shape=box,color=blue,style=bold"; + static String updateoption="shape=box,color=red,style=bold"; + static String scopeoption="color=brown"; + static String conseqoption="style=bold,color=green"; + static String compoption="shape=box,color=purple,style=bold"; public Termination(State state) { this.state=state; @@ -67,19 +73,20 @@ public class Termination { generateconjunctionnodes(); constraintdependence=new ConstraintDependence(state,this); - debugmsg("Generating scope nodes"); + debugmsg("*****Generating scope nodes*****"); generatescopenodes(); - debugmsg("Generating repair nodes"); + debugmsg("*****Generating repair nodes*****"); generaterepairnodes(); - debugmsg("Generating data structure nodes"); + debugmsg("*****Generating data structure nodes*****"); generatedatastructureupdatenodes(); - debugmsg("Generating compensation nodes"); - generatecompensationnodes(); - debugmsg("Generating abstract edges"); + debugmsg("*****Generating compensation nodes*****"); + if (!Compiler.OMITCOMP) + generatecompensationnodes(); + debugmsg("*****Generating abstract edges*****"); generateabstractedges(); - debugmsg("Generating scope edges"); + debugmsg("*****Generating scope edges*****"); generatescopeedges(); - debugmsg("Generating update edges"); + debugmsg("*****Generating update edges*****"); generateupdateedges(); @@ -170,6 +177,7 @@ public class Termination { GraphNode gn=new GraphNode("Conj"+i+"A"+j, "Conj ("+i+","+j+") "+dnf.get(j).name() ,tn); + gn.setOption(conjoption); conjunctions.add(gn); if (!conjunctionmap.containsKey(c)) conjunctionmap.put(c,new HashSet()); @@ -190,6 +198,7 @@ public class Termination { GraphNode gn=new GraphNode("Conj"+i+"AQ"+j, "Conj ("+i+","+j+") "+dconst.get(0).name() ,tn); + gn.setOption(conjoption); conjunctions.add(gn); if (!conjunctionmap.containsKey(c)) conjunctionmap.put(c,new HashSet()); @@ -207,6 +216,7 @@ public class Termination { GraphNode gn=new GraphNode("Conj"+i+"AQ"+j, "Conj ("+i+","+j+") "+dconst.get(0).name() ,tn); + gn.setOption(conjoption); conjunctions.add(gn); if (!conjunctionmap.containsKey(c)) conjunctionmap.put(c,new HashSet()); @@ -233,22 +243,22 @@ public class Termination { TupleOfExpr toe=(TupleOfExpr)e; if (negated) { GraphNode agn=(GraphNode)abstractremove.get(toe.relation); - GraphNode.Edge edge=new GraphNode.Edge("requires",agn); + GraphNode.Edge edge=new GraphNode.Edge("requirestupleremove",agn); gn.addEdge(edge); } else { GraphNode agn=(GraphNode)abstractadd.get(toe.relation); - GraphNode.Edge edge=new GraphNode.Edge("requires",agn); + GraphNode.Edge edge=new GraphNode.Edge("requirestupleadd",agn); gn.addEdge(edge); } } else if (e instanceof ElementOfExpr) { ElementOfExpr eoe=(ElementOfExpr)e; if (negated) { GraphNode agn=(GraphNode)abstractremove.get(eoe.set); - GraphNode.Edge edge=new GraphNode.Edge("requires",agn); + GraphNode.Edge edge=new GraphNode.Edge("requireselementremove",agn); gn.addEdge(edge); } else { GraphNode agn=(GraphNode)abstractadd.get(eoe.set); - GraphNode.Edge edge=new GraphNode.Edge("requires",agn); + GraphNode.Edge edge=new GraphNode.Edge("requireselementadd",agn); gn.addEdge(edge); } } else throw new Error("Unrecognized Abstract Update"); @@ -258,14 +268,20 @@ public class Termination { /* Cycle through the rules to look for possible conflicts */ for(int i=0;i"+((GraphNode)scopesatisfy.get(r)).getLabel()); + } if (concreteinterferes.interferes(mun,r,true)) { GraphNode scopenode=(GraphNode)scopesatisfy.get(r); - GraphNode.Edge e=new GraphNode.Edge("interferes",scopenode); + GraphNode.Edge e=new GraphNode.Edge("satisfyscopeinterferes",scopenode); gn.addEdge(e); } + if (Compiler.DEBUGGRAPH) { + System.out.println(gn.getLabel()+"--->"+((GraphNode)scopefalsify.get(r)).getLabel()); + } if (concreteinterferes.interferes(mun,r,false)) { GraphNode scopenode=(GraphNode)scopefalsify.get(r); - GraphNode.Edge e=new GraphNode.Edge("interferes",scopenode); + GraphNode.Edge e=new GraphNode.Edge("falsifyscopeinterferes",scopenode); gn.addEdge(e); } } @@ -288,7 +304,7 @@ public class Termination { if (abstractinterferes.checkrelationconstraint(ar, cons)) continue; if (AbstractInterferes.interferesquantifier(ar,cons)) { - GraphNode.Edge e=new GraphNode.Edge("interferes",gn2); + GraphNode.Edge e=new GraphNode.Edge("interferesquantifier",gn2); gn.addEdge(e); } else { for(int i=0;i