diff --git a/src/main/scala/leon/Analysis.scala b/src/main/scala/leon/Analysis.scala index 25d3ac1fd5c3f0c4669564d12114df3fa4eddf5c..8c950fd87215da16ebdebc1b13c88dbb78ba66e3 100644 --- a/src/main/scala/leon/Analysis.scala +++ b/src/main/scala/leon/Analysis.scala @@ -151,6 +151,14 @@ class Analysis(val program : Program, val reporter: Reporter = Settings.reporter ) reporter.info(summaryString) + if(Settings.simpleOutput) { + val outStr = + if(vcs.forall(_.status == "valid")) "valid" + else if(vcs.exists(_.status == "invalid")) "invalid" + else "unknown" + println(outStr) + } + // Printing summary for the evaluation section of paper: val writeSummary = false if (writeSummary) { diff --git a/src/main/scala/leon/Reporter.scala b/src/main/scala/leon/Reporter.scala index 71f22363a9cc7f62848971617625ac8ee7f7704f..2cdea3d02f99f63c7de31a7f86ca5f4815056c08 100644 --- a/src/main/scala/leon/Reporter.scala +++ b/src/main/scala/leon/Reporter.scala @@ -28,7 +28,8 @@ class DefaultReporter extends Reporter { protected val fatalPfx = "[ Fatal ] " def output(msg: String) : Unit = { - /*Console.err.*/println(msg) + if(!Settings.simpleOutput) + println(msg) } protected def reline(pfx: String, msg: String) : String = { diff --git a/src/main/scala/leon/Settings.scala b/src/main/scala/leon/Settings.scala index b47a794655a2940ce306e1f1ece1acd46a16ee53..dc88a7cb365f1942aa5bfa5ebdf6841057cb30bd 100644 --- a/src/main/scala/leon/Settings.scala +++ b/src/main/scala/leon/Settings.scala @@ -26,4 +26,5 @@ object Settings { var bitvectorBitwidth : Option[Int] = None var debugLevel: Int = 0 var debugTags: Set[String] = Set.empty + var simpleOutput: Boolean = false } diff --git a/src/main/scala/leon/plugin/LeonPlugin.scala b/src/main/scala/leon/plugin/LeonPlugin.scala index f007510cf2495b8691b852b559b969dacb6b42a3..e37b5b1a8c047cc5b7af6ab26d5cdabb03731287 100644 --- a/src/main/scala/leon/plugin/LeonPlugin.scala +++ b/src/main/scala/leon/plugin/LeonPlugin.scala @@ -42,7 +42,8 @@ class LeonPlugin(val global: Global, val actionAfterExtraction : Option[Program= " --noLuckyTests Do not perform additional tests to potentially find models early" + "\n" + " --noverifymodel Do not verify the correctness of models returned by Z3" + "\n" + " --debug=[1-5] Debug level" + "\n" + - " --tags=t1:... Filter out debug information that are not of one of the given tags" + " --tags=t1:... Filter out debug information that are not of one of the given tags" + "\n" + + " --oneline Reduce the output to a single line: valid if all properties were valid, invalid if at least one is invalid, unknown else" ) /** Processes the command-line options. */ @@ -50,22 +51,24 @@ class LeonPlugin(val global: Global, val actionAfterExtraction : Option[Program= override def processOptions(options: List[String], error: String => Unit) { for(option <- options) { option match { - case "with-code" => stopAfterAnalysis = false - case "uniqid" => leon.Settings.showIDs = true - case "parse" => stopAfterExtraction = true - case "tolerant" => silentlyTolerateNonPureBodies = true - case "nodefaults" => leon.Settings.runDefaultExtensions = false - case "axioms" => leon.Settings.noForallAxioms = false - case "bapa" => leon.Settings.useBAPA = true - case "impure" => leon.Settings.impureTestcases = true - case "XP" => leon.Settings.experimental = true - case "BV" => leon.Settings.bitvectorBitwidth = Some(32) - case "prune" => leon.Settings.pruneBranches = true - case "cores" => leon.Settings.useCores = true - case "quickcheck" => leon.Settings.useQuickCheck = true - case "parallel" => leon.Settings.useParallel = true - case "noLuckyTests" => leon.Settings.luckyTest = false - case "noverifymodel" => leon.Settings.verifyModel = false + case "with-code" => stopAfterAnalysis = false + case "uniqid" => leon.Settings.showIDs = true + case "parse" => stopAfterExtraction = true + case "tolerant" => silentlyTolerateNonPureBodies = true + case "nodefaults" => leon.Settings.runDefaultExtensions = false + case "axioms" => leon.Settings.noForallAxioms = false + case "bapa" => leon.Settings.useBAPA = true + case "impure" => leon.Settings.impureTestcases = true + case "XP" => leon.Settings.experimental = true + case "BV" => leon.Settings.bitvectorBitwidth = Some(32) + case "prune" => leon.Settings.pruneBranches = true + case "cores" => leon.Settings.useCores = true + case "quickcheck" => leon.Settings.useQuickCheck = true + case "parallel" => leon.Settings.useParallel = true + case "oneline" => leon.Settings.simpleOutput = true + case "noLuckyTests" => leon.Settings.luckyTest = false + case "noverifymodel" => leon.Settings.verifyModel = false + case s if s.startsWith("debug=") => leon.Settings.debugLevel = try { s.substring("debug=".length, s.length).toInt } catch { case _ => 0 } case s if s.startsWith("tags=") => leon.Settings.debugTags = Set(splitList(s.substring("tags=".length, s.length)): _*) case s if s.startsWith("unrolling=") => leon.Settings.unrollingLevel = try { s.substring("unrolling=".length, s.length).toInt } catch { case _ => 0 }