19template<
typename ModelType>
21 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
24 if (!formulas.empty() && graphPreserving) {
30 if (!graphPreserving &&
31 std::any_of(formulas.begin(), formulas.end(), [](
auto const& formula) { return formula->getReferencedRewardModels().size() > 0; })) {
32 options.setKeepRewards(
true);
34 options.setType(type);
41template<
typename ModelType>
43 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
46 if (!formulas.empty() && graphPreserving) {
52 if (!graphPreserving &&
53 std::any_of(formulas.begin(), formulas.end(), [](
auto const& formula) { return formula->getReferencedRewardModels().size() > 0; })) {
54 options.setKeepRewards(
true);
56 options.setType(type);
63template<
typename ValueType>
69 storm::exceptions::NotSupportedException,
"Bisimulation minimization is currently only available for DTMCs, CTMCs and MDPs.");
72 model->reduceToStateBasedRewards();
75 return performDeterministicSparseBisimulationMinimization<storm::models::sparse::Dtmc<ValueType>>(
76 model->template as<storm::models::sparse::Dtmc<ValueType>>(), formulas, type, graphPreserving);
78 return performDeterministicSparseBisimulationMinimization<storm::models::sparse::Ctmc<ValueType>>(
79 model->template as<storm::models::sparse::Ctmc<ValueType>>(), formulas, type, graphPreserving);
81 return performNondeterministicSparseBisimulationMinimization<storm::models::sparse::Mdp<ValueType>>(
82 model->template as<storm::models::sparse::Mdp<ValueType>>(), formulas, type, graphPreserving);
86template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
87typename std::enable_if<DdType == storm::dd::DdType::Sylvan || std::is_same<ValueType, double>::value,
88 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
90 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
96 storm::exceptions::NotSupportedException,
"Symbolic bisimulation minimization is currently only available for DTMCs, CTMCs, MDPs and MAs.");
98 "Currently only strong bisimulation is supported.");
100 std::shared_ptr<storm::models::Model<ExportValueType>> result;
101 model->getManager().execute([&]() {
103 model->reduceToStateBasedRewards();
107 result = decomposition.
getQuotient(quotientFormat);
112template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
113typename std::enable_if<DdType != storm::dd::DdType::Sylvan && !std::is_same<ValueType, double>::value,
114 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
116 std::vector<std::shared_ptr<storm::logic::Formula const>>
const&,
121 "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::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::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)