20template<
typename ValueType>
21std::pair<std::shared_ptr<storm::models::sparse::Model<ValueType>>, std::vector<std::shared_ptr<storm::logic::Formula const>>>
eliminateNonMarkovianChains(
25 STORM_LOG_WARN_COND(newFormulas.size() == formulas.size(),
"The state elimination does not preserve all properties.");
27 "Labels are not preserved by the state elimination. This may cause incorrect results.");
35template<
typename ValueType>
36std::pair<std::shared_ptr<storm::models::sparse::Model<ValueType>>, std::vector<std::shared_ptr<storm::logic::Formula const>>>
38 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas) {
41 std::string timeRewardName =
"_time";
42 while (model->hasRewardModel(timeRewardName)) {
43 timeRewardName +=
"_";
47 "Transformation of a " << model->getType() <<
" to a discrete time model does not preserve all properties.");
55 "Transformation of a " << model->getType() <<
" to a discrete time model is not supported");
57 return std::make_pair(
nullptr, newFormulas);
66template<
typename ValueType>
67std::pair<std::shared_ptr<storm::models::sparse::Model<ValueType>>, std::vector<std::shared_ptr<storm::logic::Formula const>>>
69 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas) {
72 std::string timeRewardName =
"_time";
73 while (model.hasRewardModel(timeRewardName)) {
74 timeRewardName +=
"_";
78 "Transformation of a " << model.getType() <<
" to a discrete time model does not preserve all properties.");
87 "Transformation of a " << model.getType() <<
" to a discrete time model is not supported.");
89 return std::make_pair(
nullptr, newFormulas);
93template<
typename ValueType>
95 std::string
const& timeRewardName =
"_time") {
100 STORM_LOG_ERROR(
"Unable to transform formula " << formula <<
" to discrete time.");
108template<storm::dd::DdType Type,
typename ValueType>
111 std::vector<std::shared_ptr<storm::logic::Formula const>>
const& formulas = std::vector<std::shared_ptr<storm::logic::Formula const>>()) {
112 switch (symbolicModel->getType()) {
127 "Transformation of symbolic " << symbolicModel->getType() <<
" to sparse model is not supported.");
132template<
typename ValueType>
135 std::move(model.getRewardModels()));
136 components.
choiceLabeling = std::move(model.getOptionalChoiceLabeling());
137 components.
stateValuations = std::move(model.getOptionalStateValuations());
138 components.
choiceOrigins = std::move(model.getOptionalChoiceOrigins());
147 "Cannot transform model of type " << model.getType() <<
" to a nondeterministic model.");
156template<
typename ValueType>
159 std::optional<uint64_t> seed = std::nullopt) {
160 std::vector<storm::utility::permutation::index_type> permutation;
This class represents a continuous-time Markov chain.
This class represents a Markov automaton.
Base class for all sparse models.
This class represents a continuous-time Markov chain.
This class represents a discrete-time Markov chain.
This class represents a discrete-time Markov decision process.
This class represents a discrete-time Markov decision process.
Base class for all symbolic models.
A bit vector that is internally represented as a vector of 64-bit values.
#define STORM_LOG_ERROR(message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
std::shared_ptr< storm::models::sparse::Model< ValueType > > transformToNondeterministicModel(storm::models::sparse::Model< ValueType > &&model)
std::shared_ptr< storm::models::sparse::Model< ValueType > > permuteModelStates(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::utility::permutation::OrderKind order, std::optional< uint64_t > seed=std::nullopt)
Permutes the order of the states of the model according to the given order.
std::pair< std::shared_ptr< storm::models::sparse::Model< ValueType > >, std::vector< std::shared_ptr< storm::logic::Formula const > > > eliminateNonMarkovianChains(std::shared_ptr< storm::models::sparse::MarkovAutomaton< ValueType > > const &ma, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas, storm::transformer::EliminationLabelBehavior labelBehavior)
Eliminates chains of non-Markovian states from a given Markov Automaton.
std::shared_ptr< storm::models::sparse::Model< ValueType > > transformSymbolicToSparseModel(std::shared_ptr< storm::models::symbolic::Model< Type, ValueType > > const &symbolicModel, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas=std::vector< std::shared_ptr< storm::logic::Formula const > >())
Transforms the given symbolic model to a sparse model.
std::pair< std::shared_ptr< storm::models::sparse::Model< ValueType > >, std::vector< std::shared_ptr< storm::logic::Formula const > > > transformContinuousToDiscreteTimeSparseModel(std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, std::vector< std::shared_ptr< storm::logic::Formula const > > const &formulas)
Transforms the given continuous model to a discrete time model.
std::shared_ptr< storm::logic::Formula const > checkAndTransformContinuousToDiscreteTimeFormula(storm::logic::Formula const &formula, std::string const &timeRewardName="_time")
std::shared_ptr< storm::models::sparse::Model< ValueType, RewardModelType > > buildModelFromComponents(storm::models::ModelType modelType, storm::storage::sparse::ModelComponents< ValueType, RewardModelType > &&components)
OrderKind
The order in which the states of a matrix are visited in a depth-first search or breadth-first search...
std::vector< index_type > createRandomPermutation(index_type size)
Creates a random (uniformly distributed) permutation of the given size.
std::vector< index_type > createPermutation(OrderKind order, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &initialStates)
Creates a permutation that orders the states of the given matrix in the given exploration order.
std::optional< storm::storage::sparse::StateValuations > stateValuations
storm::storage::SparseMatrix< ValueType > transitionMatrix
boost::optional< storm::storage::BitVector > markovianStates
std::optional< std::shared_ptr< storm::storage::sparse::ChoiceOrigins > > choiceOrigins
std::optional< storm::models::sparse::ChoiceLabeling > choiceLabeling