diff --git a/src/cli/entrypoints.h b/src/cli/entrypoints.h index ccd48e42b..b41a0f07f 100644 --- a/src/cli/entrypoints.h +++ b/src/cli/entrypoints.h @@ -55,27 +55,44 @@ namespace storm { template void verifySymbolicModelWithExplorationEngine(storm::prism::Program const& program, std::vector> const& formulas, bool onlyInitialStatesRelevant = false) { - + STORM_LOG_THROW(program.getModelType() == storm::prism::Program::ModelType::DTMC || program.getModelType() == storm::prism::Program::ModelType::MDP, storm::exceptions::InvalidSettingsException, "Currently exploration-based verification is only available for DTMCs and MDPs."); + for (auto const& formula : formulas) { - STORM_LOG_THROW(program.getModelType() == storm::prism::Program::ModelType::DTMC || program.getModelType() == storm::prism::Program::ModelType::MDP, storm::exceptions::InvalidSettingsException, "Currently exploration-based verification is only available for DTMCs and MDPs."); std::cout << std::endl << "Model checking property: " << *formula << " ..."; - - storm::modelchecker::SparseExplorationModelChecker checker(program); - - storm::modelchecker::CheckTask task(*formula, onlyInitialStatesRelevant); + bool supportFormula; std::unique_ptr result; - if (checker.canHandle(task)) { - result = checker.check(task); - if (result) { - std::cout << " done." << std::endl; - std::cout << "Result (initial states): "; - std::cout << *result << std::endl; - } else { - std::cout << " skipped, because the modelling formalism is currently unsupported." << std::endl; + + if(program.getModelType() == storm::prism::Program::ModelType::DTMC) { + storm::modelchecker::SparseExplorationModelChecker> checker(program); + storm::modelchecker::CheckTask task(*formula, onlyInitialStatesRelevant); + + supportFormula = checker.canHandle(task); + if (supportFormula) { + result = checker.check(task); + } + } else if(program.getModelType() == storm::prism::Program::ModelType::MDP) { + storm::modelchecker::SparseExplorationModelChecker> checker(program); + storm::modelchecker::CheckTask task(*formula, onlyInitialStatesRelevant); + + supportFormula = checker.canHandle(task); + if (supportFormula) { + result = checker.check(task); } } else { + // Should be catched before. + assert(false); + } + if(!supportFormula) { std::cout << " skipped, because the formula cannot be handled by the selected engine/method." << std::endl; } + + if (result) { + std::cout << " done." << std::endl; + std::cout << "Result (initial states): "; + std::cout << *result << std::endl; + } else { + std::cout << " skipped, because the modelling formalism is currently unsupported." << std::endl; + } } } diff --git a/src/logic/Bound.h b/src/logic/Bound.h index 7c9769f8a..e56a2c04f 100644 --- a/src/logic/Bound.h +++ b/src/logic/Bound.h @@ -12,10 +12,10 @@ namespace storm { // Intentionally left empty. } - //template - //Bound convertToOtherValueType() const { - // return Bound(comparisonType, storm::utility::convertNumber(threshold)); - //} + template + Bound convertToOtherValueType() const { + return Bound(comparisonType, storm::utility::convertNumber(threshold)); + } ComparisonType comparisonType; ValueType threshold; diff --git a/src/utility/constants.cpp b/src/utility/constants.cpp index aa89e521f..d4e1d8f33 100644 --- a/src/utility/constants.cpp +++ b/src/utility/constants.cpp @@ -165,6 +165,11 @@ namespace storm { RationalFunction convertNumber(double const& number){ return RationalFunction(carl::rationalize(number)); } + + template<> + RationalFunction convertNumber(RationalNumber const& number) { + return RationalFunction(number); + } template<> storm::RationalNumber abs(storm::RationalNumber const& number) { diff --git a/src/utility/storm.h b/src/utility/storm.h index a3cfc608a..bc56585ee 100644 --- a/src/utility/storm.h +++ b/src/utility/storm.h @@ -370,7 +370,7 @@ namespace storm { template<> inline std::unique_ptr verifySparseModel(std::shared_ptr> model, std::shared_ptr const& formula, bool onlyInitialStatesRelevant) { - storm::modelchecker::CheckTask task(*formula, onlyInitialStatesRelevant); + storm::modelchecker::CheckTask task(*formula, onlyInitialStatesRelevant); std::unique_ptr result; if (model->getType() == storm::models::ModelType::Dtmc) {