From 6e6caa157ea20e565ea92786ef266c952e6f39b3 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 6 Feb 2004 22:33:01 +0000 Subject: [PATCH] Checking in code to perform safety checks on repair dependency graph. --- .../MCC/IR/AbstractInterferes.java | 49 ++++++++ .../MCC/IR/ConcreteInterferes.java | 69 +++++++++++ .../RepairCompiler/MCC/IR/GraphAnalysis.java | 117 ++++++++++++++++++ Repair/RepairCompiler/MCC/IR/GraphNode.java | 13 +- .../RepairCompiler/MCC/IR/MultUpdateNode.java | 1 + Repair/RepairCompiler/MCC/IR/ScopeNode.java | 4 + Repair/RepairCompiler/MCC/IR/TermNode.java | 4 + Repair/RepairCompiler/MCC/IR/Termination.java | 23 +++- Repair/RepairCompiler/MCC/IR/UpdateNode.java | 9 +- 9 files changed, 279 insertions(+), 10 deletions(-) create mode 100755 Repair/RepairCompiler/MCC/IR/GraphAnalysis.java diff --git a/Repair/RepairCompiler/MCC/IR/AbstractInterferes.java b/Repair/RepairCompiler/MCC/IR/AbstractInterferes.java index 4217361..5b24327 100755 --- a/Repair/RepairCompiler/MCC/IR/AbstractInterferes.java +++ b/Repair/RepairCompiler/MCC/IR/AbstractInterferes.java @@ -1,6 +1,55 @@ package MCC.IR; class AbstractInterferes { + static public boolean interferes(AbstractRepair ar, Rule r, boolean satisfy) { + boolean mayadd=false; + boolean mayremove=false; + switch (ar.getType()) { + case AbstractRepair.ADDTOSET: + case AbstractRepair.ADDTORELATION: + if (interferesquantifier(ar.getDescriptor(), true, r, satisfy)) + return true; + mayadd=true; + break; + case AbstractRepair.REMOVEFROMSET: + case AbstractRepair.REMOVEFROMRELATION: + if (interferesquantifier(ar.getDescriptor(), false, r, satisfy)) + return true; + mayremove=true; + break; + case AbstractRepair.MODIFYRELATION: + if (interferesquantifier(ar.getDescriptor(), true, r, satisfy)) + return true; + if (interferesquantifier(ar.getDescriptor(), false, r, satisfy)) + return true; + mayadd=true; + mayremove=true; + break; + default: + throw new Error("Unrecognized Abstract Repair"); + } + DNFRule drule=null; + if (satisfy) + drule=r.getDNFGuardExpr(); + else + drule=r.getDNFNegGuardExpr(); + + for(int i=0;i