projects
/
repair.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added:
[repair.git]
/
Repair
/
RepairCompiler
/
MCC
/
IR
/
Termination.java
diff --git
a/Repair/RepairCompiler/MCC/IR/Termination.java
b/Repair/RepairCompiler/MCC/IR/Termination.java
index b788acc3ac8937242cd905b7a216dbe8ff5778f5..689a5d2382169d166d58fc60a370cb68c663e303 100755
(executable)
--- 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 consequence;
Hashtable abstractadd;
Hashtable abstractremove;
+ Hashtable conjtonodemap;
+ Set removedset;
State state;
State state;
@@
-33,7
+35,7
@@
public class Termination {
consequencenodes=new HashSet();
abstractadd=new Hashtable();
abstractremove=new Hashtable();
consequencenodes=new HashSet();
abstractadd=new Hashtable();
abstractremove=new Hashtable();
-
+ conjtonodemap=new Hashtable();
generateconjunctionnodes();
generatescopenodes();
generateconjunctionnodes();
generatescopenodes();
@@
-66,6
+68,12
@@
public class Termination {
System.out.println(mun.toString());
}
GraphAnalysis ga=new GraphAnalysis(this);
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() {
}
void generateconjunctionnodes() {
@@
-82,6
+90,7
@@
public class Termination {
if (!conjunctionmap.containsKey(c))
conjunctionmap.put(c,new HashSet());
((Set)conjunctionmap.get(c)).add(gn);
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 */
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();
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);
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<r.numQuantifiers()) {
/* Remove quantifier */
Quantifier q=r.getQuantifier(j);
if (j<r.numQuantifiers()) {
/* Remove quantifier */
Quantifier q=r.getQuantifier(j);
@@
-375,9
+386,10
@@
public class Termination {
Rule r=(Rule)possiblerules.get(i);
UpdateNode un=new UpdateNode(r);
/* Construct bindings */
Rule r=(Rule)possiblerules.get(i);
UpdateNode un=new UpdateNode(r);
/* Construct bindings */
- Vector bindings=new Vector();
- constructbindings(bindings, r,true);
- un.addBindings(bindings);
+ /* No Need to construct bindings on remove
+ Vector bindings=new Vector();
+ constructbindings(bindings, r,true);
+ un.addBindings(bindings);*/
if (count[i]<r.numQuantifiers()) {
/* Remove quantifier */
Quantifier q=r.getQuantifier(count[i]);
if (count[i]<r.numQuantifiers()) {
/* Remove quantifier */
Quantifier q=r.getQuantifier(count[i]);