#pragma once #include #include #include "storm/storage/dd/DdType.h" #include "storm/storage/bisimulation/BisimulationType.h" #include "storm/storage/dd/bisimulation/SignatureMode.h" #include "storm/storage/dd/bisimulation/PreservationInformation.h" #include "storm/storage/dd/bisimulation/QuotientFormat.h" #include "storm/logic/Formula.h" namespace storm { namespace models { template class Model; namespace symbolic { template class Model; } } namespace dd { namespace bisimulation { template class Partition; template class PartitionRefiner; template class PartialQuotientExtractor; } template class BisimulationDecomposition { public: BisimulationDecomposition(storm::models::symbolic::Model const& model, storm::storage::BisimulationType const& bisimulationType); BisimulationDecomposition(storm::models::symbolic::Model const& model, storm::storage::BisimulationType const& bisimulationType, bisimulation::PreservationInformation const& preservationInformation); BisimulationDecomposition(storm::models::symbolic::Model const& model, std::vector> const& formulas, storm::storage::BisimulationType const& bisimulationType); BisimulationDecomposition(storm::models::symbolic::Model const& model, bisimulation::Partition const& initialPartition, bisimulation::PreservationInformation const& preservationInformation); ~BisimulationDecomposition(); /*! * Performs partition refinement until a fixpoint has been reached. */ void compute(bisimulation::SignatureMode const& mode = bisimulation::SignatureMode::Eager); /*! * Performs the given number of refinement steps. * * @return True iff the computation arrived at a fixpoint. */ bool compute(uint64_t steps, bisimulation::SignatureMode const& mode = bisimulation::SignatureMode::Eager); /*! * Retrieves whether a fixed point has been reached. Depending on this, extracting a quotient will either * give a full quotient or a partial one. */ bool getReachedFixedPoint() const; /*! * Retrieves the quotient model after the bisimulation decomposition was computed. */ std::shared_ptr> getQuotient(storm::dd::bisimulation::QuotientFormat const& quotientFormat) const; private: void initialize(); void refineWrtRewardModels(); // The model for which to compute the bisimulation decomposition. storm::models::symbolic::Model const& model; // The object capturing what is preserved. bisimulation::PreservationInformation preservationInformation; // The refiner to use. std::unique_ptr> refiner; // A quotient extractor that is used when the fixpoint has not been reached yet. mutable std::unique_ptr> partialQuotientExtractor; // A flag indicating whether progress is reported. bool verboseProgress; // The delay between progress reports. uint64_t showProgressDelay; }; } }