Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
bisimulation.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4
12
13namespace storm {
14namespace api {
15
16template<typename ValueType>
17std::shared_ptr<storm::models::sparse::Model<ValueType>> performBisimulationMinimization(
18 std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model, std::vector<std::shared_ptr<storm::logic::Formula const>> const& formulas = {},
19 storm::bisimulation::Options const& options = {}) {
20 return storm::bisimulation::performBisimulationMinimization<ValueType>(*model, formulas, options).quotient;
21}
22
23template<storm::dd::DdType DdType, typename ValueType, typename ExportValueType = ValueType>
24typename std::enable_if<DdType == storm::dd::DdType::Sylvan || std::is_same<ValueType, double>::value,
25 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
27 std::vector<std::shared_ptr<storm::logic::Formula const>> const& formulas,
34 storm::exceptions::NotSupportedException, "Symbolic bisimulation minimization is currently only available for DTMCs, CTMCs, MDPs and MAs.");
35 STORM_LOG_THROW(bisimulationType == storm::bisimulation::BisimulationType::Strong, storm::exceptions::NotSupportedException,
36 "Currently only strong bisimulation is supported.");
37
38 std::shared_ptr<storm::models::Model<ExportValueType>> result;
39 model->getManager().execute([&]() {
40 // Try to get rid of non state-rewards to easy bisimulation computation.
41 model->reduceToStateBasedRewards();
42
43 storm::dd::BisimulationDecomposition<DdType, ValueType, ExportValueType> decomposition(*model, formulas, bisimulationType, bisimulationOptions);
44 decomposition.compute(mode);
45 result = decomposition.getQuotient(quotientFormat);
46 });
47 return result;
48}
49
50template<storm::dd::DdType DdType, typename ValueType, typename ExportValueType = ValueType>
51typename std::enable_if<DdType != storm::dd::DdType::Sylvan && !std::is_same<ValueType, double>::value,
52 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
54 std::vector<std::shared_ptr<storm::logic::Formula const>> const&,
59 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException,
60 "Symbolic bisimulation minimization is not supported for this combination of DD library and value type.");
61 return nullptr;
62}
63
64} // namespace api
65} // namespace storm
void compute(bisimulation::SignatureMode const &mode=bisimulation::SignatureMode::Eager)
Performs partition refinement until a fixpoint has been reached.
std::shared_ptr< storm::models::Model< ExportValueType > > getQuotient(storm::dd::bisimulation::QuotientFormat const &quotientFormat) const
Retrieves the quotient model after the bisimulation decomposition was computed.
Base class for all sparse models.
Definition Model.h:34
Base class for all symbolic models.
Definition Model.h:42
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:39
std::shared_ptr< storm::models::sparse::Model< ValueType > > performBisimulationMinimization(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas={}, storm::bisimulation::Options const &options={})
ReturnType< ValueType > performBisimulationMinimization(storm::models::sparse::Model< ValueType > const &model, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas, Options options)
Computes the bisimulation quotient of the given model.
BisimulationType
The kind of bisimulation.