From 6471bfdcea68e60831008fbd1f806358e4a328c8 Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 4 Jul 2017 11:17:01 +0200 Subject: [PATCH] made cli output respect filters --- src/storm/cli/cli.cpp | 8 +++++--- src/storm/modelchecker/results/CheckResult.cpp | 18 ++++++++++++++++++ src/storm/modelchecker/results/CheckResult.h | 10 +++------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/storm/cli/cli.cpp b/src/storm/cli/cli.cpp index 8fea01e61..10f992d96 100644 --- a/src/storm/cli/cli.cpp +++ b/src/storm/cli/cli.cpp @@ -615,9 +615,11 @@ namespace storm { } template - void printInitialStatesResult(std::unique_ptr const& result, storm::jani::Property const& property, storm::utility::Stopwatch* watch = nullptr) { + void printResult(std::unique_ptr const& result, storm::jani::Property const& property, storm::utility::Stopwatch* watch = nullptr) { if (result) { - STORM_PRINT_AND_LOG("Result (initial states): "); + std::stringstream ss; + ss << "'" << *property.getFilter().getStatesFormula() << "'"; + STORM_PRINT_AND_LOG("Result (for " << (property.getFilter().getStatesFormula()->isInitialFormula() ? "initial" : ss.str()) << " states): "); printFilteredResult(result, property.getFilter().getFilterType()); if (watch) { STORM_PRINT_AND_LOG("Time for model checking: " << *watch << "." << std::endl); @@ -640,8 +642,8 @@ namespace storm { storm::utility::Stopwatch watch(true); std::unique_ptr result = verificationCallback(property.getRawFormula(), property.getFilter().getStatesFormula()); watch.stop(); - printInitialStatesResult(result, property, &watch); postprocessingCallback(result); + printResult(result, property, &watch); } } diff --git a/src/storm/modelchecker/results/CheckResult.cpp b/src/storm/modelchecker/results/CheckResult.cpp index bdcf68c8f..9155057d3 100644 --- a/src/storm/modelchecker/results/CheckResult.cpp +++ b/src/storm/modelchecker/results/CheckResult.cpp @@ -113,6 +113,15 @@ namespace storm { return dynamic_cast(*this); } + template + QuantitativeCheckResult& CheckResult::asQuantitativeCheckResult() { + return static_cast &>(*this); + } + + template + QuantitativeCheckResult const& CheckResult::asQuantitativeCheckResult() const { + return static_cast const&>(*this); + } template SymbolicQualitativeCheckResult& CheckResult::asSymbolicQualitativeCheckResult() { @@ -155,6 +164,9 @@ namespace storm { } // Explicitly instantiate the template functions. + template QuantitativeCheckResult& CheckResult::asQuantitativeCheckResult(); + template QuantitativeCheckResult const& CheckResult::asQuantitativeCheckResult() const; + template ExplicitQuantitativeCheckResult& CheckResult::asExplicitQuantitativeCheckResult(); template ExplicitQuantitativeCheckResult const& CheckResult::asExplicitQuantitativeCheckResult() const; template ExplicitParetoCurveCheckResult& CheckResult::asExplicitParetoCurveCheckResult(); @@ -184,9 +196,15 @@ namespace storm { #ifdef STORM_HAVE_CARL + template QuantitativeCheckResult& CheckResult::asQuantitativeCheckResult(); + template QuantitativeCheckResult const& CheckResult::asQuantitativeCheckResult() const; + template ExplicitQuantitativeCheckResult& CheckResult::asExplicitQuantitativeCheckResult(); template ExplicitQuantitativeCheckResult const& CheckResult::asExplicitQuantitativeCheckResult() const; + template QuantitativeCheckResult& CheckResult::asQuantitativeCheckResult(); + template QuantitativeCheckResult const& CheckResult::asQuantitativeCheckResult() const; + template ExplicitQuantitativeCheckResult& CheckResult::asExplicitQuantitativeCheckResult(); template ExplicitQuantitativeCheckResult const& CheckResult::asExplicitQuantitativeCheckResult() const; diff --git a/src/storm/modelchecker/results/CheckResult.h b/src/storm/modelchecker/results/CheckResult.h index 2cff249c9..43954a220 100644 --- a/src/storm/modelchecker/results/CheckResult.h +++ b/src/storm/modelchecker/results/CheckResult.h @@ -66,14 +66,10 @@ namespace storm { QualitativeCheckResult const& asQualitativeCheckResult() const; template - QuantitativeCheckResult& asQuantitativeCheckResult() { - return static_cast &>(*this); - } + QuantitativeCheckResult& asQuantitativeCheckResult(); + template - QuantitativeCheckResult const& asQuantitativeCheckResult() const { - return static_cast const&>(*this); - } - + QuantitativeCheckResult const& asQuantitativeCheckResult() const; ExplicitQualitativeCheckResult& asExplicitQualitativeCheckResult(); ExplicitQualitativeCheckResult const& asExplicitQualitativeCheckResult() const;