From f40133804077578c4b906171e20327a983106bed Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 21 Jul 2004 05:00:27 +0000 Subject: [PATCH] Update to analysis. --- .../MCC/IR/ConcreteInterferes.java | 45 ++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java b/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java index 4f6c333..8769742 100755 --- a/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java +++ b/Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java @@ -344,12 +344,12 @@ public class ConcreteInterferes { return null; } - /** This function checks to see if an update is only performed if - * a given set is empty, and the algorithm is computing whether - * the update may falsify a rule that adds something to the set */ + * a given set (or image set produced by a relation) is empty, and + * the algorithm is computing whether the update may falsify a + * rule that adds something to the set */ - static private boolean initialinterferes(MultUpdateNode mun, Rule r, boolean satisfy) { + private boolean initialinterferes(MultUpdateNode mun, Rule r, boolean satisfy) { AbstractRepair ar=mun.getRepair(); if ((!satisfy)&&(ar!=null)&&(ar.getType()==AbstractRepair.ADDTOSET)) { if (!r.getInclusion().getTargetDescriptors().contains(ar.getDescriptor())) @@ -368,7 +368,42 @@ public class ConcreteInterferes { ((op==Opcode.GT)&&(ep.rightSize()==0))|| //(>0) ((op==Opcode.GE)&&(ep.rightSize()==1))) //(>=1) return false; - } + } else if ((!satisfy)&&(ar!=null)&&(ar.getType()==AbstractRepair.ADDTORELATION)) { + /* This test is for image sets of relations. */ + if (!r.getInclusion().getTargetDescriptors().contains(ar.getDescriptor())) + return true; + boolean negated=ar.getPredicate().isNegated(); + Predicate p=ar.getPredicate().getPredicate(); + if (!(p instanceof ExprPredicate)) + return true; + ExprPredicate ep=(ExprPredicate)p; + if (ep.getType()!=ExprPredicate.SIZE) + return true; + + Opcode op=Opcode.translateOpcode(negated,ep.getOp()); + if (!(((op==Opcode.EQ)&&(ep.rightSize()==1))|| //(=1) + ((op==Opcode.NE)&&(ep.rightSize()==0))|| //(!=0) + ((op==Opcode.GT)&&(ep.rightSize()==0))|| //(>0) + ((op==Opcode.GE)&&(ep.rightSize()==1)))) //(>=1) + return true; + + RelationInclusion ri=(RelationInclusion)r.getInclusion(); + Expr tmpve=ep.inverted()?ri.getRightExpr():ri.getLeftExpr(); + if (!(tmpve instanceof VarExpr)) + return true; + for(int i=0;i