Browse Source

made cli output respect filters

tempestpy_adaptions
dehnert 8 years ago
parent
commit
6471bfdcea
  1. 8
      src/storm/cli/cli.cpp
  2. 18
      src/storm/modelchecker/results/CheckResult.cpp
  3. 10
      src/storm/modelchecker/results/CheckResult.h

8
src/storm/cli/cli.cpp

@ -615,9 +615,11 @@ namespace storm {
} }
template<typename ValueType> template<typename ValueType>
void printInitialStatesResult(std::unique_ptr<storm::modelchecker::CheckResult> const& result, storm::jani::Property const& property, storm::utility::Stopwatch* watch = nullptr) {
void printResult(std::unique_ptr<storm::modelchecker::CheckResult> const& result, storm::jani::Property const& property, storm::utility::Stopwatch* watch = nullptr) {
if (result) { 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<ValueType>(result, property.getFilter().getFilterType()); printFilteredResult<ValueType>(result, property.getFilter().getFilterType());
if (watch) { if (watch) {
STORM_PRINT_AND_LOG("Time for model checking: " << *watch << "." << std::endl); STORM_PRINT_AND_LOG("Time for model checking: " << *watch << "." << std::endl);
@ -640,8 +642,8 @@ namespace storm {
storm::utility::Stopwatch watch(true); storm::utility::Stopwatch watch(true);
std::unique_ptr<storm::modelchecker::CheckResult> result = verificationCallback(property.getRawFormula(), property.getFilter().getStatesFormula()); std::unique_ptr<storm::modelchecker::CheckResult> result = verificationCallback(property.getRawFormula(), property.getFilter().getStatesFormula());
watch.stop(); watch.stop();
printInitialStatesResult<ValueType>(result, property, &watch);
postprocessingCallback(result); postprocessingCallback(result);
printResult<ValueType>(result, property, &watch);
} }
} }

18
src/storm/modelchecker/results/CheckResult.cpp

@ -113,6 +113,15 @@ namespace storm {
return dynamic_cast<QualitativeCheckResult const&>(*this); return dynamic_cast<QualitativeCheckResult const&>(*this);
} }
template<typename ValueType>
QuantitativeCheckResult<ValueType>& CheckResult::asQuantitativeCheckResult() {
return static_cast<QuantitativeCheckResult<ValueType> &>(*this);
}
template<typename ValueType>
QuantitativeCheckResult<ValueType> const& CheckResult::asQuantitativeCheckResult() const {
return static_cast<QuantitativeCheckResult<ValueType> const&>(*this);
}
template <storm::dd::DdType Type> template <storm::dd::DdType Type>
SymbolicQualitativeCheckResult<Type>& CheckResult::asSymbolicQualitativeCheckResult() { SymbolicQualitativeCheckResult<Type>& CheckResult::asSymbolicQualitativeCheckResult() {
@ -155,6 +164,9 @@ namespace storm {
} }
// Explicitly instantiate the template functions. // Explicitly instantiate the template functions.
template QuantitativeCheckResult<double>& CheckResult::asQuantitativeCheckResult();
template QuantitativeCheckResult<double> const& CheckResult::asQuantitativeCheckResult() const;
template ExplicitQuantitativeCheckResult<double>& CheckResult::asExplicitQuantitativeCheckResult(); template ExplicitQuantitativeCheckResult<double>& CheckResult::asExplicitQuantitativeCheckResult();
template ExplicitQuantitativeCheckResult<double> const& CheckResult::asExplicitQuantitativeCheckResult() const; template ExplicitQuantitativeCheckResult<double> const& CheckResult::asExplicitQuantitativeCheckResult() const;
template ExplicitParetoCurveCheckResult<double>& CheckResult::asExplicitParetoCurveCheckResult(); template ExplicitParetoCurveCheckResult<double>& CheckResult::asExplicitParetoCurveCheckResult();
@ -184,9 +196,15 @@ namespace storm {
#ifdef STORM_HAVE_CARL #ifdef STORM_HAVE_CARL
template QuantitativeCheckResult<storm::RationalNumber>& CheckResult::asQuantitativeCheckResult();
template QuantitativeCheckResult<storm::RationalNumber> const& CheckResult::asQuantitativeCheckResult() const;
template ExplicitQuantitativeCheckResult<storm::RationalNumber>& CheckResult::asExplicitQuantitativeCheckResult(); template ExplicitQuantitativeCheckResult<storm::RationalNumber>& CheckResult::asExplicitQuantitativeCheckResult();
template ExplicitQuantitativeCheckResult<storm::RationalNumber> const& CheckResult::asExplicitQuantitativeCheckResult() const; template ExplicitQuantitativeCheckResult<storm::RationalNumber> const& CheckResult::asExplicitQuantitativeCheckResult() const;
template QuantitativeCheckResult<storm::RationalFunction>& CheckResult::asQuantitativeCheckResult();
template QuantitativeCheckResult<storm::RationalFunction> const& CheckResult::asQuantitativeCheckResult() const;
template ExplicitQuantitativeCheckResult<storm::RationalFunction>& CheckResult::asExplicitQuantitativeCheckResult(); template ExplicitQuantitativeCheckResult<storm::RationalFunction>& CheckResult::asExplicitQuantitativeCheckResult();
template ExplicitQuantitativeCheckResult<storm::RationalFunction> const& CheckResult::asExplicitQuantitativeCheckResult() const; template ExplicitQuantitativeCheckResult<storm::RationalFunction> const& CheckResult::asExplicitQuantitativeCheckResult() const;

10
src/storm/modelchecker/results/CheckResult.h

@ -66,14 +66,10 @@ namespace storm {
QualitativeCheckResult const& asQualitativeCheckResult() const; QualitativeCheckResult const& asQualitativeCheckResult() const;
template<typename ValueType> template<typename ValueType>
QuantitativeCheckResult<ValueType>& asQuantitativeCheckResult() {
return static_cast<QuantitativeCheckResult<ValueType> &>(*this);
}
QuantitativeCheckResult<ValueType>& asQuantitativeCheckResult();
template<typename ValueType> template<typename ValueType>
QuantitativeCheckResult<ValueType> const& asQuantitativeCheckResult() const {
return static_cast<QuantitativeCheckResult<ValueType> const&>(*this);
}
QuantitativeCheckResult<ValueType> const& asQuantitativeCheckResult() const;
ExplicitQualitativeCheckResult& asExplicitQualitativeCheckResult(); ExplicitQualitativeCheckResult& asExplicitQualitativeCheckResult();
ExplicitQualitativeCheckResult const& asExplicitQualitativeCheckResult() const; ExplicitQualitativeCheckResult const& asExplicitQualitativeCheckResult() const;

Loading…
Cancel
Save