Small changes to allow:
authorbdemsky <bdemsky>
Fri, 30 Sep 2005 06:18:48 +0000 (06:18 +0000)
committerbdemsky <bdemsky>
Fri, 30 Sep 2005 06:18:48 +0000 (06:18 +0000)
empty structure definitions
better debugging support

Repair/RepairCompiler/MCC/CLI.java
Repair/RepairCompiler/MCC/Compiler.java
Repair/RepairCompiler/MCC/IR/ConcreteInterferes.java
Repair/RepairCompiler/MCC/IR/GraphNode.java
Repair/RepairCompiler/MCC/IR/RepairGenerator.java
Repair/RepairCompiler/MCC/IR/SemanticChecker.java
Repair/RepairCompiler/MCC/IR/Termination.java
Repair/RepairCompiler/MCC/TDL.cup

index bd64dd30e3a2d992d2c6d621d857945978bfb0b4..afd51e6a386a02c05789ef14052ef7330fe05699 100755 (executable)
@@ -11,7 +11,7 @@ import MCC.IR.DebugItem;
  * files.
  *
  * @author  le01, 6.035 Staff (<tt>6.035-staff@mit.edu</tt>)
- * @version <tt>$Id: CLI.java,v 1.14 2005/02/20 20:31:28 bdemsky Exp $</tt>
+ * @version <tt>$Id: CLI.java,v 1.15 2005/09/30 06:18:11 bdemsky Exp $</tt>
  */
 public class CLI {
     /**
@@ -109,6 +109,7 @@ public class CLI {
            System.out.println("-time");
            System.out.println("-omitcomp");
            System.out.println("-mergenodes");
+           System.out.println("-debuggraph");
            System.exit(-1);
        }
 
@@ -120,6 +121,8 @@ public class CLI {
                 Compiler.REPAIR=false;
            } else if (args[i].equals("-omitcomp")) {
                 Compiler.OMITCOMP=true;
+           } else if (args[i].equals("-debuggraph")) {
+                Compiler.DEBUGGRAPH=true;
            } else if (args[i].equals("-mergenodes")) {
                 Compiler.MERGENODES=true;
            } else if (args[i].equals("-depth")) {
index 6fad5086b8eb5ab02dc3d5fa200eac4905444c23..213abddf6060bf7def18410c0e532ccf8bed60e9 100755 (executable)
@@ -28,6 +28,7 @@ public class Compiler {
     public static boolean OMITCOMP=false;
     public static boolean MERGENODES=false;
     public static boolean TIME=false;
+    public static boolean DEBUGGRAPH=false;
 
     public static Vector debuggraphs=new Vector();
 
@@ -80,13 +81,8 @@ public class Compiler {
            nodes.addAll(state.rulenodes.values());
 
            FileOutputStream dotfile;
-           dotfile = new FileOutputStream(cli.infile + ".dependencies.edgelabels.dot");
-           GraphNode.useEdgeLabels = true;
-           GraphNode.DOTVisitor.visit(dotfile, nodes);
-           dotfile.close();
 
            dotfile = new FileOutputStream(cli.infile + ".dependencies.dot");
-           GraphNode.useEdgeLabels = false;
            GraphNode.DOTVisitor.visit(dotfile, nodes);
            dotfile.close();
        } catch (Exception e) {
index 2e657ef323d83019da8fc960abb86f43d7790e51..ddc2e0d465df61fa70406d070a091b2ef50f4dde 100755 (executable)
@@ -1,5 +1,6 @@
 package MCC.IR;
 import java.util.*;
+import MCC.Compiler;
 
 public class ConcreteInterferes {
     Termination termination;
@@ -13,10 +14,10 @@ public class ConcreteInterferes {
      * model definition rule r. */
 
     public boolean interferes(MultUpdateNode mun, Rule r, boolean satisfy) {
-       
+
        // A rule that adds something to a set can't be falsified by
        // an update that is only performed if the set is empty
-       if (!initialinterferes(mun,r,satisfy)) 
+        if (!initialinterferes(mun,r,satisfy))
            return false;
 
        for(int i=0;i<mun.numUpdates();i++) {
@@ -24,7 +25,7 @@ public class ConcreteInterferes {
            for (int j=0;j<un.numUpdates();j++) {
                Updates update=un.getUpdate(j);
                //Abstract updates don't have concrete interference1
-               if (update.isAbstract()) 
+               if (update.isAbstract())
                    continue;
 
                DNFRule drule=satisfy?r.getDNFNegGuardExpr():r.getDNFGuardExpr();
@@ -34,7 +35,7 @@ public class ConcreteInterferes {
                /* 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;
 
@@ -50,7 +51,7 @@ public class ConcreteInterferes {
                        node already models the action of this
                        update. */
 
-                   if ((un.getRule()==r)&& 
+                   if ((un.getRule()==r)&&
                        (((mun.op==MultUpdateNode.ADD)&&satisfy)
                         ||((mun.op==MultUpdateNode.REMOVE)&&!satisfy)
                         ||(mun.op==MultUpdateNode.MODIFY))) {
@@ -87,13 +88,20 @@ public class ConcreteInterferes {
                        if (satisfy) {
                            /** Check to see if the update definitely falsifies r, thus
                             * can't accidentally satisfy it r. */
-                           if (interferesinclusion(un, update, r)) 
+                           if (interferesinclusion(un, update, r)) {
+                                if (Compiler.DEBUGGRAPH)
+                                    System.out.println("CASE 1");
                                return true;
-                       } else
-                           return true; /* Interferes with inclusion condition */
+                            }
+                       } else {
+                            if (Compiler.DEBUGGRAPH)
+                                System.out.println("CASE 2");
+
+                            return true; /* Interferes with inclusion condition */
+                        }
                    }
                }
-               
+
                for(int k=0;k<drule.size();k++) {
                    RuleConjunction rconj=drule.get(k);
                    for(int l=0;l<rconj.size();l++) {
@@ -122,10 +130,14 @@ public class ConcreteInterferes {
                                              doesn't exist.*/
                        }
 
-                       if (interferes(update,dexpr))
-                           return true;
+                       if (interferes(update,dexpr)) {
+                            if (Compiler.DEBUGGRAPH)
+                                System.out.println("CASE 3");
+
+                            return true;
+                        }
                    }
-               }           
+               }
            }
        }
        return false;
@@ -150,7 +162,7 @@ public class ConcreteInterferes {
            return false;
        return true;
     }
-    
+
     static private boolean updateonlytonewobject(MultUpdateNode mun, UpdateNode un, Updates updates) {
        AbstractRepair ar=mun.getRepair();
        if ((ar!=null)&&(ar.getType()==AbstractRepair.ADDTOSET||ar.getType()==AbstractRepair.ADDTORELATION))
@@ -182,14 +194,14 @@ public class ConcreteInterferes {
                    }
                }
            }
-       
+
        return false;
     }
 
     /** This method tries to show that if the Update update from the
      *  UpdateNode un changes the value of the inclusion constraint
      * that it falsifies the guard of model definition rule. */
-    
+
     static private boolean interferesinclusion(UpdateNode un, Updates update, Rule r) {
        Descriptor updated_des=update.getDescriptor();
        Inclusion inclusion=r.getInclusion();
@@ -219,7 +231,7 @@ public class ConcreteInterferes {
            /* Build variable correspondance */
            HashSet set=new HashSet();
            inclusionexpr.findmatch(updated_des,set);
-           
+
            for(Iterator matchit=set.iterator();matchit.hasNext();) {
                DotExpr dotexpr=(DotExpr)matchit.next();
                DotExpr updateexpr=(DotExpr)update.getLeftExpr();
@@ -271,7 +283,7 @@ public class ConcreteInterferes {
 
                    boolean varok=true;
                    Set vars=rexpr.freeVars();
-                   if (vars!=null) 
+                   if (vars!=null)
                        for(Iterator it=vars.iterator();it.hasNext();) {
                            VarDescriptor vd=(VarDescriptor) it.next();
                            if (!vd.isGlobal()) {
@@ -282,7 +294,7 @@ public class ConcreteInterferes {
                                }
                            }
                        }
-                   
+
                    if (!varok)
                        continue;
 
@@ -319,9 +331,9 @@ public class ConcreteInterferes {
                                    rexpr.equals(remap,update.getRightExpr())) {
                                    match=true;
                                    break;
-                               }                                   
+                               }
                            }
-                       } 
+                       }
                    }
                    if (!match) {
                        good=false;
@@ -367,7 +379,7 @@ public class ConcreteInterferes {
            return false; /* Can't accidentally interfere with other bindings if there aren't any! */
 
        boolean firstfield=true;
-       
+
 
        while(true) {
            if (update_e instanceof CastExpr)
@@ -433,7 +445,7 @@ public class ConcreteInterferes {
        }
        return null;
     }
-    
+
     /** This function checks to see if an update is only performed if
      * a given set (or image set produced by a relation) is empty, and
      * the algorithm is computing whether the update may falsify a
@@ -452,7 +464,7 @@ public class ConcreteInterferes {
            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)
@@ -486,7 +498,7 @@ public class ConcreteInterferes {
                for (int j=0;j<un.numUpdates();j++) {
                    Updates update=un.getUpdate(j);
                    //Abstract updates don't have concrete interference1
-                   if (update.isAbstract()) 
+                   if (update.isAbstract())
                        continue;
                    if (testdisjoint(update, r, r.getGuardExpr()))
                        return true;
@@ -503,7 +515,7 @@ public class ConcreteInterferes {
           there is no interference. */
        if (!dexpr.getExpr().usesDescriptor(descriptor))
            return false;
-           
+
        if (update.isExpr()) {
            /* We need to pair the variables */
            Set vars=update.getRightExpr().freeVars();
index 424a8459852d4190620fecae79d20ff301e2bf92..a450745bd132d11f9b3183b84f5fa2b841c8e791 100755 (executable)
@@ -2,13 +2,12 @@ package MCC.IR;
 
 import java.util.*;
 import java.io.*;
+import MCC.Compiler;
 
 public class GraphNode {
 
-    public static boolean useEdgeLabels;
-
     /* NodeStatus enumeration pattern ***********/
-    
+
     public static final NodeStatus UNVISITED = new NodeStatus("UNVISITED");
     public static final NodeStatus PROCESSING = new NodeStatus("PROCESSING");
     public static final NodeStatus FINISHED = new NodeStatus("FINISHED");
@@ -22,7 +21,7 @@ public class GraphNode {
     /* Edge *****************/
 
     public static class Edge {
-        
+
         private String label;
         private GraphNode target;
        private GraphNode source;
@@ -65,11 +64,11 @@ public class GraphNode {
     int discoverytime = -1;
     int finishingtime = -1; /* used for searches */
 
-    Vector edges = new Vector();  
+    Vector edges = new Vector();
     Vector inedges = new Vector();
     String nodelabel;
     String textlabel;
-    NodeStatus status = UNVISITED;    
+    NodeStatus status = UNVISITED;
     String dotnodeparams = new String();
     Object owner = null;
     boolean merge=false;
@@ -157,7 +156,7 @@ public class GraphNode {
             dotnodeparams = new String();
         }
     }
-    
+
     public void setStatus(NodeStatus status) {
         if (status == null) {
             throw new NullPointerException();
@@ -172,7 +171,7 @@ public class GraphNode {
     public String getTextLabel() {
         return textlabel;
     }
-    
+
     public NodeStatus getStatus() {
         return this.status;
     }
@@ -221,17 +220,17 @@ public class GraphNode {
 
 
     public static class DOTVisitor {
-        
+
         java.io.PrintWriter output;
         int tokennumber;
         int color;
-      
+
         private DOTVisitor(java.io.OutputStream output) {
             tokennumber = 0;
             color = 0;
             this.output = new java.io.PrintWriter(output, true);
         }
-        
+
         private String getNewID(String name) {
             tokennumber = tokennumber + 1;
             return new String (name+tokennumber);
@@ -239,7 +238,7 @@ public class GraphNode {
 
         Collection nodes;
        Collection special;
-        
+
         public static void visit(java.io.OutputStream output, Collection nodes) {
            visit(output,nodes,null);
        }
@@ -250,7 +249,7 @@ public class GraphNode {
             visitor.nodes = nodes;
             visitor.make();
         }
-        
+
         private void make() {
             output.println("digraph dotvisitor {");
             output.println("\trotate=90;");
@@ -264,8 +263,8 @@ public class GraphNode {
             traverse();
             output.println("}\n");
         }
-                
-        private void traverse() {            
+
+        private void traverse() {
            Set cycleset=GraphNode.findcycles(nodes);
 
             Iterator i = nodes.iterator();
@@ -286,7 +285,7 @@ public class GraphNode {
                    if (nodes.contains(node)) {
                        for(Iterator nodeit=nonmerge(node).iterator();nodeit.hasNext();) {
                            GraphNode node2=(GraphNode)nodeit.next();
-                           String edgelabel = useEdgeLabels ? "label=\"" + edge.getLabel() + "\"" : "label=\"\"";
+                           String edgelabel = Compiler.DEBUGGRAPH ? "label=\"" + edge.getLabel() + "\"" : "label=\"\"";
                            output.println("\t" + gn.getLabel() + " -> " + node2.getLabel() + " [" + edgelabel + edge.dotnodeparams + "];");
                        }
                    }
@@ -318,7 +317,7 @@ public class GraphNode {
 
     }
 
-    /** This function returns the set of nodes involved in cycles. 
+    /** This function returns the set of nodes involved in cycles.
      * It only considers cycles containing nodes in the set 'nodes'.
     */
     public static Set findcycles(Collection nodes) {
@@ -383,7 +382,7 @@ public class GraphNode {
     }
 
     /**
-     * DFS encapsulates the depth first search algorithm 
+     * DFS encapsulates the depth first search algorithm
      */
     public static class DFS {
 
@@ -394,7 +393,7 @@ public class GraphNode {
        HashMap sccmap;
        HashMap sccmaprev;
 
-        private DFS(Collection nodes) { 
+        private DFS(Collection nodes) {
             this.nodes = nodes;
         }
        /** Calculates the strong connected components for the graph composed
@@ -442,29 +441,29 @@ public class GraphNode {
             if (nodes == null) {
                 throw new NullPointerException();
             }
-            
+
             DFS dfs = new DFS(nodes);
             return dfs.go();
         }
 
-        private boolean go() {           
+        private boolean go() {
             Iterator i;
             time = 0;
             boolean acyclic=true;
             i = nodes.iterator();
             while (i.hasNext()) {
                 GraphNode gn = (GraphNode) i.next();
-                gn.reset();            
-            }            
+                gn.reset();
+            }
 
             i = nodes.iterator();
             while (i.hasNext()) {
                 GraphNode gn = (GraphNode) i.next();
-               assert gn.getStatus() != PROCESSING;                    
+               assert gn.getStatus() != PROCESSING;
                 if (gn.getStatus() == UNVISITED) {
                     if (!dfs(gn))
                        acyclic=false;
-                } 
+                }
             }
            return acyclic;
         }
index cc07b7e342108a8df208fe2a6af6f7be26d9edb4..cf2b98d22604ef4cc0a10b788470315a9e9dca97 100755 (executable)
@@ -57,7 +57,6 @@ public class RepairGenerator {
        }
     }
 
-
     private void name_updates() {
        int count=0;
        for(Iterator it=termination.updatenodes.iterator();it.hasNext();) {
index 108a88379b46e48f20e31bdcb3351b849073004a..af4aa96f735965afc163e8f8476aea5e86be3ff8 100755 (executable)
@@ -1099,7 +1099,7 @@ public class SemanticChecker {
         dCurrentType = type;
 
         // parse the labels and fields
-        if (!parse_labelsandfields(pn.getChild("lf"))) {
+        if (pn.getChild("lf")!=null && !parse_labelsandfields(pn.getChild("lf"))) {
             ok = false;
         }
 
index 0a0859c18b0a787fe8f43b39f538f9fbe8dc0785..046e06062ba0481f9f21aa9a4d270f8475c9dc02 100755 (executable)
@@ -73,20 +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");
+        debugmsg("*****Generating compensation nodes*****");
        if (!Compiler.OMITCOMP)
            generatecompensationnodes();
-        debugmsg("Generating abstract edges");
+        debugmsg("*****Generating abstract edges*****");
        generateabstractedges();
-        debugmsg("Generating scope edges");
+        debugmsg("*****Generating scope edges*****");
        generatescopeedges();
-        debugmsg("Generating update edges");
+        debugmsg("*****Generating update edges*****");
        generateupdateedges();
 
 
@@ -243,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");
@@ -268,14 +268,20 @@ public class Termination {
            /* Cycle through the rules to look for possible conflicts */
            for(int i=0;i<state.vRules.size();i++) {
                Rule r=(Rule) state.vRules.get(i);
+                if (Compiler.DEBUGGRAPH) {
+                    System.out.println(gn.getLabel()+"--->"+((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);
                }
            }
@@ -298,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<conj.size();i++) {
@@ -308,7 +314,7 @@ public class Termination {
                             continue;
                         if (getConstraint(gn)==null||
                             !abstractinterferes.interferemodifies(ar,getConstraint(gn),dp,cons)) {
-                            GraphNode.Edge e=new GraphNode.Edge("interferes",gn2);
+                            GraphNode.Edge e=new GraphNode.Edge("interferesmodify",gn2);
                             gn.addEdge(e);
                             break;
                         }
@@ -320,7 +326,7 @@ public class Termination {
                TermNode tn2=(TermNode)gn2.getOwner();
                ScopeNode sn2=tn2.getScope();
                if (AbstractInterferes.interfereswithrule(ar,sn2.getRule(),sn2.getSatisfy())) {
-                   GraphNode.Edge e=new GraphNode.Edge("interferes",gn2);
+                   GraphNode.Edge e=new GraphNode.Edge("interfereswithrule",gn2);
                    gn.addEdge(e);
                }
            }
@@ -394,7 +400,7 @@ public class Termination {
                    DNFPredicate dp=conj.get(i);
                    if (abstractinterferes.scopeinterfereswithpredicate(sn,dp)||
                        AbstractInterferes.interfereswithquantifier(sn.getDescriptor(),sn.getSatisfy(),constr)) {
-                       GraphNode.Edge e=new GraphNode.Edge("interferes",gn2);
+                       GraphNode.Edge e=new GraphNode.Edge("interferesconjunction",gn2);
                        GraphNode gnconseq=(GraphNode)consequence.get(sn);
                        gnconseq.addEdge(e);
                        break;
@@ -407,13 +413,13 @@ public class Termination {
                Rule r=(Rule) state.vRules.get(i);
                if (AbstractInterferes.interfereswithrule(sn.getDescriptor(),sn.getSatisfy(),r,true)) {
                    GraphNode scopenode=(GraphNode)scopesatisfy.get(r);
-                   GraphNode.Edge e=new GraphNode.Edge("interferes",scopenode);
+                   GraphNode.Edge e=new GraphNode.Edge("interferesscopesatisfy2",scopenode);
                    GraphNode gnconseq=(GraphNode)consequence.get(sn);
                    gnconseq.addEdge(e);
                }
                if (AbstractInterferes.interfereswithrule(sn.getDescriptor(),sn.getSatisfy(),r,false)) {
                    GraphNode scopenode=(GraphNode)scopefalsify.get(r);
-                   GraphNode.Edge e=new GraphNode.Edge("interferes",scopenode);
+                   GraphNode.Edge e=new GraphNode.Edge("interferesscopefalsify2",scopenode);
                    GraphNode gnconseq=(GraphNode)consequence.get(sn);
                    gnconseq.addEdge(e);
                }
@@ -463,7 +469,7 @@ public class Termination {
                    //              GraphNode gn2=new GraphNode(gn.getLabel()+"A"+i+"B"+ar.type(),gn.getTextLabel()+" #"+i+" "+ar.type(),tn2);
                    GraphNode gn2=new GraphNode(gn.getLabel()+"A"+i+"B"+ar.type(),dp.name()+" "+ar.type(),tn2);
                    gn2.setOption(absrepoption);
-                   GraphNode.Edge e=new GraphNode.Edge("abstract",gn2);
+                   GraphNode.Edge e=new GraphNode.Edge("abstractedge1",gn2);
                    gn.addEdge(e);
                    if (!predtoabstractmap.containsKey(dp))
                        predtoabstractmap.put(dp,new HashSet());
@@ -565,7 +571,7 @@ public class Termination {
                        un.addUpdate(u);
                        if (abstractremove.containsKey(rq.relation)) {
                            GraphNode agn=(GraphNode)abstractremove.get(rq.relation);
-                           GraphNode.Edge e=new GraphNode.Edge("requires",agn);
+                           GraphNode.Edge e=new GraphNode.Edge("requiresremove1",agn);
                            gn2.addEdge(e);
                        } else {
                            continue; /* Abstract repair doesn't exist */
@@ -578,7 +584,7 @@ public class Termination {
                        un.addUpdate(u);
                        if (abstractremove.containsKey(sq.set)) {
                            GraphNode agn=(GraphNode)abstractremove.get(sq.set);
-                           GraphNode.Edge e=new GraphNode.Edge("requires",agn);
+                           GraphNode.Edge e=new GraphNode.Edge("requiresremove2",agn);
                            gn2.addEdge(e);
                        } else {
                            continue; /* Abstract repair doesn't exist */
@@ -597,7 +603,7 @@ public class Termination {
                    continue;
 
                mun.addUpdate(un);
-               GraphNode.Edge e=new GraphNode.Edge("abstract"+compensationcount,gn2);
+               GraphNode.Edge e=new GraphNode.Edge("abstractcomp"+compensationcount,gn2);
                compensationcount++;
                gn.addEdge(e);
                updatenodes.add(gn2);
@@ -675,7 +681,7 @@ public class Termination {
                        un.addUpdate(u);
                        if (abstractremove.containsKey(rq.relation)) {
                            GraphNode agn=(GraphNode)abstractremove.get(rq.relation);
-                           GraphNode.Edge e=new GraphNode.Edge("requires",agn);
+                           GraphNode.Edge e=new GraphNode.Edge("requiresremove3",agn);
                            gn2.addEdge(e);
                        } else {
                            goodflag=false;break; /* Abstract repair doesn't exist */
@@ -688,7 +694,7 @@ public class Termination {
                        un.addUpdate(u);
                        if (abstractremove.containsKey(sq.set)) {
                            GraphNode agn=(GraphNode)abstractremove.get(sq.set);
-                           GraphNode.Edge e=new GraphNode.Edge("requires",agn);
+                           GraphNode.Edge e=new GraphNode.Edge("requiresremove4",agn);
                            gn2.addEdge(e);
                        } else {
                            goodflag=false;break; /* Abstract repair doesn't exist */
@@ -707,7 +713,7 @@ public class Termination {
                mun.addUpdate(un);
            }
            if (goodflag) {
-               GraphNode.Edge e=new GraphNode.Edge("abstract"+(removefromcount++),gn2);
+               GraphNode.Edge e=new GraphNode.Edge("abstract3"+(removefromcount++),gn2);
                gn.addEdge(e);
                updatenodes.add(gn2);
            }
@@ -828,7 +834,7 @@ public class Termination {
                mun.addUpdate(un);
            }
            if (goodflag) {
-               GraphNode.Edge e=new GraphNode.Edge("abstract"+modifycount,gn2);
+               GraphNode.Edge e=new GraphNode.Edge("abstract4"+modifycount,gn2);
                modifycount++;
                gn.addEdge(e);
                updatenodes.add(gn2);
@@ -1012,7 +1018,7 @@ public class Termination {
                        un.checkupdates()&&
                        debugmsg("Updates checked")) {
                        mun.addUpdate(un);
-                       GraphNode.Edge e=new GraphNode.Edge("abstract"+addtocount,gn2);
+                       GraphNode.Edge e=new GraphNode.Edge("abstract5"+addtocount,gn2);
                        addtocount++;
                        gn.addEdge(e);
                        updatenodes.add(gn2);
@@ -1266,7 +1272,7 @@ public class Termination {
                un.addUpdate(u);
                if (abstractadd.containsKey(rq.relation)) {
                    GraphNode agn=(GraphNode)abstractadd.get(rq.relation);
-                   GraphNode.Edge e=new GraphNode.Edge("requires",agn);
+                   GraphNode.Edge e=new GraphNode.Edge("requiresadd5",agn);
                    gn.addEdge(e);
                } else {
                    return false;
@@ -1290,7 +1296,7 @@ public class Termination {
                un.addUpdate(u);
                if (abstractadd.containsKey(sq.set)) {
                    GraphNode agn=(GraphNode)abstractadd.get(sq.set);
-                   GraphNode.Edge e=new GraphNode.Edge("requires",agn);
+                   GraphNode.Edge e=new GraphNode.Edge("requiresadd6",agn);
                    gn.addEdge(e);
                } else {
                    return false;
index c905958facbef2b5e6538b65a9098587e489728d..6436236423a89f9b77e46b6021cc4c1314fcdbc4 100755 (executable)
@@ -247,6 +247,17 @@ structure ::=
        structure.addChild(lf);
        RESULT = structure;
        :}
+       |
+       STRUCTURE ID:typename optsubtype:subtype OPENBRACE CLOSEBRACE
+       {:
+       debugMessage(PRODSTRING);
+       ParseNode structure = new ParseNode("structure", parser.curLine(6));
+       structure.addChild("name", parser.curLine(5)).addChild(typename);
+       if (subtype != null) {
+        structure.addChild(subtype);
+       }
+       RESULT = structure;
+       :}
 
        | ID:type MULT ID:name SEMICOLON
        {: