From 0a65e4aa7bab828345d2eca7e6b10e921837e6dc Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Wed, 16 Dec 2020 11:42:54 +0100 Subject: [PATCH] verification now handles SMGs --- src/storm/api/verification.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/storm/api/verification.h b/src/storm/api/verification.h index 3e5f916a5..b878a6a7a 100644 --- a/src/storm/api/verification.h +++ b/src/storm/api/verification.h @@ -18,6 +18,7 @@ #include "storm/modelchecker/abstraction/BisimulationAbstractionRefinementModelChecker.h" #include "storm/modelchecker/exploration/SparseExplorationModelChecker.h" #include "storm/modelchecker/reachability/SparseDtmcEliminationModelChecker.h" +#include "storm/modelchecker/rpatl/SparseSmgRpatlModelChecker.h" #include "storm/models/symbolic/Dtmc.h" #include "storm/models/symbolic/Mdp.h" @@ -25,6 +26,7 @@ #include "storm/models/sparse/Dtmc.h" #include "storm/models/sparse/Mdp.h" +#include "storm/models/sparse/Smg.h" #include "storm/settings/SettingsManager.h" #include "storm/settings/modules/CoreSettings.h" @@ -251,6 +253,28 @@ namespace storm { return verifyWithSparseEngine(env, ma, task); } + template + typename std::enable_if::value, std::unique_ptr>::type verifyWithSparseEngine(storm::Environment const& env, std::shared_ptr> const& smg, storm::modelchecker::CheckTask const& task) { + std::unique_ptr result; + storm::modelchecker::SparseSmgRpatlModelChecker> modelchecker(*smg); + if (modelchecker.canHandle(task)) { + result = modelchecker.check(env, task); + } + return result; + } + + template + typename std::enable_if::value, std::unique_ptr>::type verifyWithSparseEngine(storm::Environment const& env, std::shared_ptr> const& mdp, storm::modelchecker::CheckTask const& task) { + STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Sparse engine cannot verify SMGs with this data type."); + } + + template + std::unique_ptr verifyWithSparseEngine(std::shared_ptr> const& smg, storm::modelchecker::CheckTask const& task) { + Environment env; + return verifyWithSparseEngine(env, smg, task); + } + + template std::unique_ptr verifyWithSparseEngine(storm::Environment const& env, std::shared_ptr> const& model, storm::modelchecker::CheckTask const& task) { std::unique_ptr result; @@ -262,6 +286,8 @@ namespace storm { result = verifyWithSparseEngine(env, model->template as>(), task); } else if (model->getType() == storm::models::ModelType::MarkovAutomaton) { result = verifyWithSparseEngine(env, model->template as>(), task); + } else if (model->getType() == storm::models::ModelType::Smg) { + result = verifyWithSparseEngine(env, model->template as>(), task); } else { STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "The model type " << model->getType() << " is not supported by the sparse engine."); }