16template<
typename ModelType>
18 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
21 if (!formulas.empty() && graphPreserving) {
27 if (!graphPreserving &&
28 std::any_of(formulas.begin(), formulas.end(), [](
auto const& formula) { return formula->getReferencedRewardModels().size() > 0; })) {
29 options.setKeepRewards(
true);
31 options.setType(type);
38template<
typename ModelType>
40 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
43 if (!formulas.empty() && graphPreserving) {
49 if (!graphPreserving &&
50 std::any_of(formulas.begin(), formulas.end(), [](
auto const& formula) { return formula->getReferencedRewardModels().size() > 0; })) {
51 options.setKeepRewards(
true);
53 options.setType(type);
60template<
typename ValueType>
66 storm::exceptions::NotSupportedException,
"Bisimulation minimization is currently only available for DTMCs, CTMCs and MDPs.");
69 model->reduceToStateBasedRewards();
72 return performDeterministicSparseBisimulationMinimization<storm::models::sparse::Dtmc<ValueType>>(
73 model->template as<storm::models::sparse::Dtmc<ValueType>>(), formulas, type, graphPreserving);
75 return performDeterministicSparseBisimulationMinimization<storm::models::sparse::Ctmc<ValueType>>(
76 model->template as<storm::models::sparse::Ctmc<ValueType>>(), formulas, type, graphPreserving);
78 return performNondeterministicSparseBisimulationMinimization<storm::models::sparse::Mdp<ValueType>>(
79 model->template as<storm::models::sparse::Mdp<ValueType>>(), formulas, type, graphPreserving);
83template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
84typename std::enable_if<DdType == storm::dd::DdType::Sylvan || std::is_same<ValueType, double>::value,
85 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
87 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas,
93 storm::exceptions::NotSupportedException,
"Symbolic bisimulation minimization is currently only available for DTMCs, CTMCs, MDPs and MAs.");
95 "Currently only strong bisimulation is supported.");
97 std::shared_ptr<storm::models::Model<ExportValueType>> result;
98 model->getManager().execute([&]() {
100 model->reduceToStateBasedRewards();
104 result = decomposition.
getQuotient(quotientFormat);
109template<storm::dd::DdType DdType,
typename ValueType,
typename ExportValueType = ValueType>
110typename std::enable_if<DdType != storm::dd::DdType::Sylvan && !std::is_same<ValueType, double>::value,
111 std::shared_ptr<storm::models::Model<ExportValueType>>>::type
113 std::vector<std::shared_ptr<storm::logic::Formula const>>
const&,
118 "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)