From: bdemsky Date: Tue, 27 Jul 2004 05:43:06 +0000 (+0000) Subject: Add updates... X-Git-Url: http://plrg.eecs.uci.edu/git/?p=repair.git;a=commitdiff_plain;h=ffbc6aa80c7e3ea6aff0cae778ecdbcdbf49a175 Add updates... --- diff --git a/Repair/RepairCompiler/MCC/CLI.java b/Repair/RepairCompiler/MCC/CLI.java index f1f5d87..10d5d4b 100755 --- a/Repair/RepairCompiler/MCC/CLI.java +++ b/Repair/RepairCompiler/MCC/CLI.java @@ -11,7 +11,7 @@ import MCC.IR.DebugItem; * files. * * @author le01, 6.035 Staff (6.035-staff@mit.edu) - * @version $Id: CLI.java,v 1.9 2004/07/18 19:19:57 bdemsky Exp $ + * @version $Id: CLI.java,v 1.10 2004/07/27 05:42:30 bdemsky Exp $ */ public class CLI { /** @@ -100,7 +100,8 @@ public class CLI { if (args.length==0) { System.out.println("-debugcompiler -- print out debug messages"); - System.out.println("-depth depthnum constraintnum -- generate dependency graph from constraintnum with depf of depthnum"); + System.out.println("-depth depthnum constraintnum -- generate dependency graph from constraintnum with depth of depthnum"); + System.out.println("-depthconj depthnum constraintnum conjunctionnum -- generate dependency graph from constraintnum with depth of depthnum"); System.out.println("-instrument -- generate instrumentation code"); System.out.println("-aggressivesearch"); System.out.println("-prunequantifiernodes"); @@ -116,6 +117,9 @@ public class CLI { } else if (args[i].equals("-depth")) { Compiler.debuggraphs.add(new DebugItem(Integer.parseInt(args[i+1]),Integer.parseInt(args[i+2]))); i+=2; + } else if (args[i].equals("-depthconj")) { + Compiler.debuggraphs.add(new DebugItem(Integer.parseInt(args[i+1]),Integer.parseInt(args[i+2]),Integer.parseInt(args[i+3]))); + i+=3; } else if (args[i].equals("-debug")) { Compiler.GENERATEDEBUGHOOKS=true; } else if (args[i].equals("-instrument")) { diff --git a/Repair/RepairCompiler/MCC/IR/AbstractRepair.java b/Repair/RepairCompiler/MCC/IR/AbstractRepair.java index 033d838..3783f4b 100755 --- a/Repair/RepairCompiler/MCC/IR/AbstractRepair.java +++ b/Repair/RepairCompiler/MCC/IR/AbstractRepair.java @@ -28,7 +28,16 @@ class AbstractRepair { return "Unknown"; } } - + + public boolean isNewObject(boolean isdomain) { + if (getType()==ADDTOSET) { + return sources.allocSource((SetDescriptor)descriptor); + } else if (getType()==ADDTORELATION) { + RelationDescriptor rd=(RelationDescriptor)descriptor; + return sources.relallocSource(rd,isdomain); + } else throw new Error(""); + } + public SetDescriptor getDomainSet() { if (torepair==null) return null; diff --git a/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java b/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java index 8769742..8741821 100755 --- a/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java +++ b/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java @@ -31,6 +31,15 @@ public class ConcreteInterferes { Descriptor updated_des=update.getDescriptor(); assert updated_des!=null; + /* Test to see if the update only effects new + objects and we're only testing for falsifying + model definition rules. */ + + if ((!satisfy)&&updateonlytonewobject(mun,un,update)) + continue; + + + // See if the update interferes with the inclusion // condition for the rule if (r.getInclusion().usesDescriptor(updated_des)) { @@ -59,7 +68,6 @@ public class ConcreteInterferes { } else throw new Error(); } - if (!ok) { if (satisfy) { /** Check to see if the update definitely falsifies r, thus @@ -95,6 +103,40 @@ public class ConcreteInterferes { } return false; } + + static private boolean updateonlytonewobject(MultUpdateNode mun, UpdateNode un, Updates updates) { + AbstractRepair ar=mun.getRepair(); + for(int i=0;i "+gn2.getTextLabel()); if (AbstractInterferes.interferes(ar,cons)|| abstractinterferes.interferes(ar,dp)) { GraphNode.Edge e=new GraphNode.Edge("interferes",gn2); @@ -286,7 +288,6 @@ public class Termination { } } } - for(Iterator scopeiterator=scopenodes.iterator();scopeiterator.hasNext();) { GraphNode gn2=(GraphNode)scopeiterator.next(); TermNode tn2=(TermNode)gn2.getOwner(); @@ -528,6 +529,7 @@ public class Termination { void generatedatastructureupdatenodes() { for(Iterator absiterator=abstractrepair.iterator();absiterator.hasNext();) { GraphNode gn=(GraphNode)absiterator.next(); + System.out.println("Analysing: "+gn.getTextLabel()); TermNode tn=(TermNode) gn.getOwner(); AbstractRepair ar=tn.getAbstract(); if (ar.getType()==AbstractRepair.ADDTOSET) { @@ -774,11 +776,14 @@ public class Termination { /* Construct bindings */ Hashtable setmapping=new Hashtable(); + System.out.println("Attempting to construct bindings"); if (!constructbindings(bindings,r,ar,setmapping,false)) continue; + System.out.println("Bindings constructed"); //Generate add instruction DNFRule dnfrule=r.getDNFGuardExpr(); + endloop: for(int j=0;j