Add option to remove conjunctions.
authorbdemsky <bdemsky>
Wed, 9 Nov 2005 21:07:04 +0000 (21:07 +0000)
committerbdemsky <bdemsky>
Wed, 9 Nov 2005 21:07:04 +0000 (21:07 +0000)
Repair/RepairCompiler/MCC/CLI.java
Repair/RepairCompiler/MCC/Compiler.java
Repair/RepairCompiler/MCC/IR/Termination.java
Repair/RepairCompiler/MCC/IR/UpdateNode.java

index b8cce23e2c2b62857c1e25ab22ac50ac2be1c935..39b64ef3b2a6320475219f48e5aa1407fea1e1df 100755 (executable)
@@ -12,7 +12,7 @@ import MCC.IR.RepairGenerator;
  * files.
  *
  * @author  le01, 6.035 Staff (<tt>6.035-staff@mit.edu</tt>)
- * @version <tt>$Id: CLI.java,v 1.20 2005/11/09 16:47:42 bdemsky Exp $</tt>
+ * @version <tt>$Id: CLI.java,v 1.21 2005/11/09 21:06:29 bdemsky Exp $</tt>
  */
 public class CLI {
     /**
@@ -104,6 +104,7 @@ public class CLI {
            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("-removeconj constr,conj");
            System.out.println("-aggressivesearch -- search for one repair per constraint");
            System.out.println("-prunequantifiernodes -- prune nodes that satisfy constraint by decreasing scope");
            System.out.println("-cplusplus -- properly set up c++ classes");
@@ -125,6 +126,12 @@ public class CLI {
                 debug = true;
            } else if (args[i].equals("-checkonly")) {
                 Compiler.REPAIR=false;
+           } else if (args[i].equals("-removeconj")) {
+               if ((i+1)==args.length) {
+                   throw new Error("No fieldname");
+               }
+               Compiler.removeconj.add(args[i+1]);
+               i++;
            } else if (args[i].equals("-exactallocation")) {
                 Compiler.EXACTALLOCATION=true;
            } else if (args[i].equals("-omitcomp")) {
index a53acc721a85219c8e47d309aca06170d926b2de..f0b13cd9712ebc89312fb79755479bdb998ad6ac 100755 (executable)
@@ -28,11 +28,14 @@ public class Compiler {
     public static boolean OMITCOMP=false;
     public static boolean MERGENODES=false;
     public static boolean TIME=false;
+
+    public static HashSet removeconj=new HashSet();
     public static boolean DEBUGGRAPH=false;
     public static boolean REJECTLENGTH=false;
     public static boolean PRINTREPAIRS=false;
     public static boolean EXACTALLOCATION=false;
 
+
     public static Vector debuggraphs=new Vector();
 
     public static void main(String[] args) {
index 8585655710d9b7362f79815640074d404bfb38f4..32facba550d7cde1abc9663b8e0021e97d22b34d 100755 (executable)
@@ -173,6 +173,9 @@ public class Termination {
            Constraint c=(Constraint)constraints.get(i);
            DNFConstraint dnf=c.dnfconstraint;
            for(int j=0;j<dnf.size();j++) {
+               if (Compiler.removeconj.contains(new String(i+","+j)))
+                   continue;
+
                TermNode tn=new TermNode(c,dnf.get(j));
                GraphNode gn=new GraphNode("Conj"+i+"A"+j,
                                           "Conj ("+i+","+j+") "+dnf.get(j).name()
@@ -186,6 +189,8 @@ public class Termination {
            }
            // Construct quantifier "conjunction" nodes
            for(int j=0;j<c.numQuantifiers();j++) {
+               if (Compiler.removeconj.contains(new String(i+","+(j+constraints.size()))))
+                   continue;
                Quantifier q=c.getQuantifier(j);
                if (q instanceof SetQuantifier) {
                    SetQuantifier sq=(SetQuantifier)q;
@@ -195,8 +200,8 @@ public class Termination {
                    dconst=dconst.not();
                    TermNode tn=new TermNode(c,dconst.get(0));
                    tn.setquantifiernode();
-                   GraphNode gn=new GraphNode("Conj"+i+"AQ"+j,
-                                              "Conj ("+i+","+j+") "+dconst.get(0).name()
+                   GraphNode gn=new GraphNode("Conj"+i+"AQ"+(j+constraints.size()),
+                                              "Conj ("+i+","+(j+constraints.size())+") "+dconst.get(0).name()
                                               ,tn);
                    gn.setOption(conjoption);
                    conjunctions.add(gn);
@@ -213,8 +218,8 @@ public class Termination {
                    dconst=dconst.not();
                    TermNode tn=new TermNode(c,dconst.get(0));
                    tn.setquantifiernode();
-                   GraphNode gn=new GraphNode("Conj"+i+"AQ"+j,
-                                              "Conj ("+i+","+j+") "+dconst.get(0).name()
+                   GraphNode gn=new GraphNode("Conj"+i+"AQ"+(j+constraints.size()),
+                                              "Conj ("+i+","+(j+constraints.size())+") "+dconst.get(0).name()
                                               ,tn);
                    gn.setOption(conjoption);
                    conjunctions.add(gn);
index 0f472875ed2f966d5c61f7abc18f3b2f6e1fb30d..9892ad2e2c17376dc1887225a4412fe5fe1a107e 100755 (executable)
@@ -52,6 +52,7 @@ class UpdateNode {
             return false;
        if (computeordering()) /* Ordering exists */
            return true;
+       
        return false;
     }