23template<
typename ModelType>
25 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
27 std::optional<double>
const& tolerance = std::nullopt) {
28 using OptionsType =
typename storm::storage::DeterministicModelBisimulationDecomposition<ModelType>::Options;
36 (!formulas.empty() && graphPreserving) ? OptionsType(*model, formulas, resolvedTolerance) : OptionsType::preservingAllLabels(resolvedTolerance);
40 if (!graphPreserving &&
41 std::any_of(formulas.begin(), formulas.end(), [](
auto const& formula) { return formula->getReferencedRewardModels().size() > 0; })) {
42 options.setKeepRewards(
true);
44 options.setType(type);
51template<
typename ModelType>
53 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
55 std::optional<double>
const& tolerance = std::nullopt) {
56 using OptionsType =
typename storm::storage::NondeterministicModelBisimulationDecomposition<ModelType>::Options;
64 (!formulas.empty() && graphPreserving) ? OptionsType(*model, formulas, resolvedTolerance) : OptionsType::preservingAllLabels(resolvedTolerance);
68 if (!graphPreserving &&
69 std::any_of(formulas.begin(), formulas.end(), [](
auto const& formula) { return formula->getReferencedRewardModels().size() > 0; })) {
70 options.setKeepRewards(
true);
72 options.setType(type);
79template<
typename ValueType>
83 std::optional<double>
const& tolerance = std::nullopt) {
86 storm::exceptions::NotSupportedException,
"Bisimulation minimization is currently only available for DTMCs, CTMCs and MDPs.");
89 model->reduceToStateBasedRewards();
93 model->template as<storm::models::sparse::Dtmc<ValueType>>(), formulas, type, graphPreserving, tolerance);
96 model->template as<storm::models::sparse::Ctmc<ValueType>>(), formulas, type, graphPreserving, tolerance);
99 model->template as<storm::models::sparse::Mdp<ValueType>>(), formulas, type, graphPreserving, tolerance);
103template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
104typename std::enable_if<DdType == storm::dd::DdType::Sylvan || std::is_same<ValueType, double>::value,
105 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
107 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
114 storm::exceptions::NotSupportedException,
"Symbolic bisimulation minimization is currently only available for DTMCs, CTMCs, MDPs and MAs.");
116 "Currently only strong bisimulation is supported.");
118 std::shared_ptr<storm::models::Model<ExportValueType>> result;
119 model->getManager().execute([&]() {
121 model->reduceToStateBasedRewards();
125 result = decomposition.
getQuotient(quotientFormat);
130template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
131typename std::enable_if<DdType != storm::dd::DdType::Sylvan && !std::is_same<ValueType, double>::value,
132 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
134 std::vector<std::shared_ptr<storm::logic::Formula const>>
const&,
140 "Symbolic bisimulation minimization is not supported for this combination of DD library and value type.");
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 "ientFormat) const
Retrieves the quotient model after the bisimulation decomposition was computed.
Base class for all sparse models.
Base class for all symbolic models.
std::shared_ptr< ModelType > getQuotient() const
Retrieves the quotient of the model under the computed bisimulation.
void computeBisimulationDecomposition()
Computes the decomposition of the model into bisimulation equivalence classes.
This class represents the decomposition of a deterministic model into its bisimulation quotient.
This class represents the decomposition of a nondeterministic model into its bisimulation quotient.
#define STORM_LOG_THROW(cond, exception, message)
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::storage::BisimulationType type=storm::storage::BisimulationType::Strong, bool graphPreserving=true, std::optional< double > const &tolerance=std::nullopt)
std::shared_ptr< ModelType > performNondeterministicSparseBisimulationMinimization(std::shared_ptr< ModelType > model, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas, storm::storage::BisimulationType type, bool graphPreserving=true, std::optional< double > const &tolerance=std::nullopt)
std::shared_ptr< ModelType > performDeterministicSparseBisimulationMinimization(std::shared_ptr< ModelType > model, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas, storm::storage::BisimulationType type, bool graphPreserving=true, std::optional< double > const &tolerance=std::nullopt)
SettingsType const & getModule()
Get module.
TargetType convertNumber(SourceType const &number)
static const bool IsExact