have a debug flag
authoryeom <yeom>
Tue, 12 Feb 2013 22:27:15 +0000 (22:27 +0000)
committeryeom <yeom>
Tue, 12 Feb 2013 22:27:15 +0000 (22:27 +0000)
Robust/src/Analysis/SSJava/BuildLattice.java
Robust/src/Analysis/SSJava/LocationInference.java
Robust/src/Benchmarks/SSJava/EyeTrackingInfer/makefile
Robust/src/Benchmarks/SSJava/JavaNatorInfer/makefile
Robust/src/Benchmarks/SSJava/MP3DecoderInfer/makefile
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/buildscript

index f8b5e14..754db08 100644 (file)
@@ -64,17 +64,20 @@ public class BuildLattice {
 
     // /////////////////////////////////////////////////////////////////////////////////////
     // lattice generation for the native approach
-    BasisSet naiveBasisSet = naiveGraph.computeBasisSet(nodeSetWithCompositeLocation);
-    // debug_print(inputGraph);
 
-    Family naiveFamily = generateFamily(naiveBasisSet);
-    Map<Set<Integer>, Set<Set<Integer>>> naive_mapImSucc =
-        coveringGraph(naiveBasisSet, naiveFamily);
+    if (infer.state.SSJAVA_INFER_NAIVE_WRITEDOTS) {
+      BasisSet naiveBasisSet = naiveGraph.computeBasisSet(nodeSetWithCompositeLocation);
+
+      Family naiveFamily = generateFamily(naiveBasisSet);
+      Map<Set<Integer>, Set<Set<Integer>>> naive_mapImSucc =
+          coveringGraph(naiveBasisSet, naiveFamily);
+
+      SSJavaLattice<String> naive_lattice =
+          buildLattice(desc, naiveBasisSet, naiveGraph, null, naive_mapImSucc);
+      LocationInference.numLocationsNaive += naive_lattice.getKeySet().size();
+      infer.addNaiveLattice(desc, naive_lattice);
+    }
 
-    SSJavaLattice<String> naive_lattice =
-        buildLattice(desc, naiveBasisSet, naiveGraph, null, naive_mapImSucc);
-    LocationInference.numLocationsNaive += naive_lattice.getKeySet().size();
-    infer.addNaiveLattice(desc, naive_lattice);
     // /////////////////////////////////////////////////////////////////////////////////////
 
     // lattice generation for the proposed approach
index 61c61b1..b2bd43f 100644 (file)
@@ -366,8 +366,10 @@ public class LocationInference {
       // + locOrder.getKeySet().size() + "\t" + hg.getNodeSet().size());
     }
 
-    System.out.println("The number of elements: Naive=" + numLocationsNaive + " SInfer="
-        + numLocationsSInfer);
+    if (state.SSJAVA_INFER_NAIVE_WRITEDOTS) {
+      System.out.println("The number of elements: Naive=" + numLocationsNaive);
+    }
+    System.out.println("The number of elements: SInfer=" + numLocationsSInfer);
 
     System.exit(0);
 
index f42b8fb..060fb6e 100644 (file)
@@ -3,39 +3,15 @@ BUILDSCRIPT=../../../buildscript
 PROGRAM=LEA
 SOURCE_FILES=LEA.java
 
-ifndef INV_ERROR_PROB
-INV_ERROR_PROB=1000
-endif
-
-ifndef RANDOMSEED
-RANDOMSEED=12345
-endif
-
 SSJAVA= -ssjava -ssjavainfer -ssjavadebug
-BSFLAGS= -32bit -mainclass $(PROGRAM)  -heapsize-mb 1350  -nooptimize -debug -garbagestats #-printlinenum #-joptimize
-NORMAL= -ssjava-inject-error 0 0
-INJECT_ERROR= -ssjava-inject-error $(INV_ERROR_PROB) $(RANDOMSEED)
+BSFLAGS= -32bit -mainclass $(PROGRAM)  -heapsize-mb 1350 -nooptimize -debug -garbagestats #-printlinenum #-joptimize
 
+#NAIVEFLAG= -ssjava-infer-naive-writedots
 
 default: $(PROGRAM)s.bin
 
-normal: $(PROGRAM)n.bin
-
-error: $(PROGRAM)e.bin
-
-
 $(PROGRAM)s.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) 
-
-$(PROGRAM)n.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(NORMAL) $(BSFLAGS) -o $(PROGRAM)n -builddir norm $(SOURCE_FILES) 
-
-$(PROGRAM)e.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(SSJAVA) $(INJECT_ERROR) $(BSFLAGS) -o $(PROGRAM)e -builddir injerr $(SOURCE_FILES) 
-
-cleanerror:
-       rm -f $(PROGRAM)e.bin
-       rm -rf injerr
+       $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) $(NAIVEFLAG)
 
 clean:
        rm -f  $(PROGRAM)s.bin $(PROGRAM)n.bin $(PROGRAM)e.bin
@@ -47,6 +23,4 @@ clean:
        rm -f  *.pdf
        rm -f  aliases.txt
        rm -f  results*txt
-       rm -f  output.txt
-       rm -f *log
-
+       rm -f *log
\ No newline at end of file
index 99d8177..dbca7b5 100644 (file)
@@ -3,39 +3,15 @@ BUILDSCRIPT=../../../buildscript
 PROGRAM=RobotMain
 SOURCE_FILES=RobotMain.java
 
-ifndef INV_ERROR_PROB
-INV_ERROR_PROB=1000
-endif
-
-ifndef RANDOMSEED
-RANDOMSEED=12345
-endif
-
 SSJAVA= -ssjava -ssjavainfer -ssjavadebug
-BSFLAGS= -32bit -mainclass $(PROGRAM)  -heapsize-mb 1350  -nooptimize -debug -garbagestats #-printlinenum #-joptimize
-NORMAL= -ssjava-inject-error 0 0
-INJECT_ERROR= -ssjava-inject-error $(INV_ERROR_PROB) $(RANDOMSEED)
+BSFLAGS= -32bit -mainclass $(PROGRAM)  -heapsize-mb 1350 -nooptimize -debug -garbagestats #-printlinenum #-joptimize
 
+#NAIVEFLAG= -ssjava-infer-naive-writedots
 
 default: $(PROGRAM)s.bin
 
-normal: $(PROGRAM)n.bin
-
-error: $(PROGRAM)e.bin
-
-
 $(PROGRAM)s.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) 
-
-$(PROGRAM)n.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(NORMAL) $(BSFLAGS) -o $(PROGRAM)n -builddir norm $(SOURCE_FILES) 
-
-$(PROGRAM)e.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(SSJAVA) $(INJECT_ERROR) $(BSFLAGS) -o $(PROGRAM)e -builddir injerr $(SOURCE_FILES) 
-
-cleanerror:
-       rm -f $(PROGRAM)e.bin
-       rm -rf injerr
+       $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) $(NAIVEFLAG)
 
 clean:
        rm -f  $(PROGRAM)s.bin $(PROGRAM)n.bin $(PROGRAM)e.bin
@@ -47,6 +23,4 @@ clean:
        rm -f  *.pdf
        rm -f  aliases.txt
        rm -f  results*txt
-       rm -f  output.txt
-       rm -f *log
-
+       rm -f *log
\ No newline at end of file
index 3619a32..ea1ad43 100644 (file)
@@ -3,39 +3,15 @@ BUILDSCRIPT=../../../buildscript
 PROGRAM=MP3Player
 SOURCE_FILES=MP3Player.java Player.java
 
-ifndef INV_ERROR_PROB
-INV_ERROR_PROB=1000
-endif
-
-ifndef RANDOMSEED
-RANDOMSEED=12345
-endif
-
 SSJAVA= -ssjava -ssjavainfer -ssjavadebug
-BSFLAGS= -32bit -mainclass $(PROGRAM)  -heapsize-mb 1350  -nooptimize -debug -garbagestats #-printlinenum #-joptimize
-NORMAL= -ssjava-inject-error 0 0
-INJECT_ERROR= -ssjava-inject-error $(INV_ERROR_PROB) $(RANDOMSEED)
+BSFLAGS= -32bit -mainclass $(PROGRAM)  -heapsize-mb 1350 -nooptimize -debug -garbagestats #-printlinenum #-joptimize
 
+#NAIVELAG= -ssjava-infer-naive-writedots
 
 default: $(PROGRAM)s.bin
 
-normal: $(PROGRAM)n.bin
-
-error: $(PROGRAM)e.bin
-
-
 $(PROGRAM)s.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) 
-
-$(PROGRAM)n.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(NORMAL) $(BSFLAGS) -o $(PROGRAM)n -builddir norm $(SOURCE_FILES) 
-
-$(PROGRAM)e.bin: $(SOURCE_FILES) makefile
-       $(BUILDSCRIPT) $(SSJAVA) $(INJECT_ERROR) $(BSFLAGS) -o $(PROGRAM)e -builddir injerr $(SOURCE_FILES) 
-
-cleanerror:
-       rm -f $(PROGRAM)e.bin
-       rm -rf injerr
+       $(BUILDSCRIPT) $(SSJAVA) $(BSFLAGS) -o $(PROGRAM)s -builddir ssj $(SOURCE_FILES) $(NAIVEFLAG)
 
 clean:
        rm -f  $(PROGRAM)s.bin $(PROGRAM)n.bin $(PROGRAM)e.bin
@@ -44,6 +20,7 @@ clean:
        rm -f  *~
        rm -f  *.dot
        rm -f  *.png
+       rm -f  *.pdf
        rm -f  aliases.txt
        rm -f  results*txt
        rm -f *log
index 67b4ff8..0067976 100644 (file)
@@ -151,6 +151,7 @@ public class State {
   public boolean SSJAVAINFER=false;
   public boolean SSJAVA_GENCODE_PREVENT_CRASHES=false;
   public boolean SSJAVA_INJECT_ERROR=false;
+  public boolean SSJAVA_INFER_NAIVE_WRITEDOTS=false;
   public int     SSJAVA_INV_ERROR_PROB=0;
   public int     SSJAVA_ERROR_SEED=0;
   public Set<MethodDescriptor> annotationRequireSet;
index 2ec01a6..1d6f210 100644 (file)
@@ -393,6 +393,8 @@ public class Main {
         state.SSJAVADEBUG = true;
       } else if (option.equals("-ssjavainfer")) {
         state.SSJAVAINFER= true;
+      } else if (option.equals("-ssjava-infer-naive-writedots")){
+        state.SSJAVA_INFER_NAIVE_WRITEDOTS=true;
       } else if( option.equals( "-ssjava-inject-error" ) ) {
         state.SSJAVA_GENCODE_PREVENT_CRASHES = true;
         state.SSJAVA_INJECT_ERROR   = true;
index 8a7b7a9..54eec4b 100755 (executable)
@@ -129,6 +129,7 @@ echo -ssjava enables SSJava
 echo -ssjavadebug reports interim results
 echo -ssjavainfer location type inference
 echo -ssjava-induce-error N S where 1/N is the probability to error at any deref or divide and S is a random seed
+echo -ssjava-infer-naive-writedots write lattice dots generated by the naive approach
 echo
 echo Other options
 echo -jni enable jni
@@ -707,6 +708,11 @@ then
 USE_SSJAVA_INFER_CLASSPATH=true
 JAVAOPTS="$JAVAOPTS -ssjavainfer"
 
+elif [[ $1 = '-ssjava-infer-naive-writedots' ]]
+then
+USE_SSJAVA_INFER_CLASSPATH=true
+JAVAOPTS="$JAVAOPTS -ssjava-infer-naive-writedots"
+
 elif [[ $1 = '-ssjava-inject-error' ]]
 then
 USE_SSJAVA_CLASSPATH=true
@@ -916,7 +922,7 @@ elif $USE_SSJAVA_CLASSPATH
   if $USE_SSJAVA_INFER_CLASSPATH
     then
     JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/SSJavaInfer"
-  elif ! $USE_SSJAVA_INFER_NOCLASSPATH
+  elif ! $USE_SSJAVA_NOCLASSPATH
     then
     JAVAOPTS="$JAVAOPTS -classlibrary $ROBUSTROOT/ClassLibrary/SSJava"  
   fi