1#ifndef STORM_UTILITY_PARAMETERLIFTING_H
2#define STORM_UTILITY_PARAMETERLIFTING_H
17namespace parameterlifting {
33template<
typename ValueType>
42 STORM_LOG_ERROR(
"Robust parameter lifting is only supported for DTMCs.");
48 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition: '"
49 << entry.getValue() <<
"'. Can not validate that parameter lifting is sound on this model.");
58 STORM_LOG_ERROR(
"parameter lifting requires a closed Markov automaton.");
61 auto const& rateVector = ma.getExitRates();
62 auto const& markovianStates = ma.getMarkovianStates();
64 if (markovianStates.get(state)) {
65 auto const& exitRate = rateVector[state];
68 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition rate: '"
70 <<
"'. Can not validate that parameter lifting is sound on this model.");
77 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition: '"
78 << entry.getValue() <<
"'. Can not validate that parameter lifting is sound on this model.");
97 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as state reward: '"
98 << rew <<
"'. Can not validate that parameter lifting is sound on this model.");
105 std::set<typename storm::utility::parametric::VariableType<ValueType>::type> collectedRewardParameters;
110 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as action reward: '"
111 << rew <<
"'. Can not validate that parameter lifting is sound on this model.");
119 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as action reward: '"
120 << rew <<
"'. Can not validate that parameter lifting is sound on this model.");
130 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition reward: '"
131 << rewEntry.getValue() <<
"'. Can not validate that parameter lifting is sound on this model.");
138 if (!collectedRewardParameters.empty()) {
139 std::set<typename storm::utility::parametric::VariableType<ValueType>::type> transitionParameters =
141 auto rewParIt = collectedRewardParameters.begin();
142 auto trParIt = transitionParameters.begin();
143 while (rewParIt != collectedRewardParameters.end() && trParIt != transitionParameters.end()) {
144 if (*rewParIt == *trParIt) {
148 <<
" occurs in a transition probability/rate and in a transition/action reward. Parameter lifting might not be sound on this model.");
151 if (*rewParIt < *trParIt) {
bool isOfType(storm::models::ModelType const &modelType) const
Checks whether the model is of the given type.
This class represents a Markov automaton.
Base class for all sparse models.
RewardModelType const & getUniqueRewardModel() const
Retrieves the unique reward model, if there exists exactly one.
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
virtual uint_fast64_t getNumberOfStates() const override
Returns the number of states of the model.
RewardModelType const & getRewardModel(std::string const &rewardModelName) const
Retrieves the reward model with the given name, if one exists.
storm::storage::SparseMatrix< ValueType > const & getTransitionRewardMatrix() const
Retrieves the transition rewards of the reward model.
bool hasTransitionRewards() const
Retrieves whether the reward model has transition rewards.
std::vector< ValueType > const & getStateActionRewardVector() const
Retrieves the state-action rewards of the reward model.
std::vector< ValueType > const & getStateRewardVector() const
Retrieves the state rewards of the reward model.
bool hasStateRewards() const
Retrieves whether the reward model has state rewards.
bool hasStateActionRewards() const
Retrieves whether the reward model has state-action rewards.
#define STORM_LOG_WARN(message)
#define STORM_LOG_ERROR(message)
RegionCheckEngine
The considered engine for region checking.
@ RobustParameterLifting
Parameter lifting approach based on robust markov models instead of generating nondeterminism.
std::set< storm::RationalFunctionVariable > getProbabilityParameters(Model< storm::RationalFunction > const &model)
Get all probability parameters occurring on transitions.
static bool validateParameterLiftingSound(storm::models::sparse::Model< ValueType > const &model, storm::logic::Formula const &formula, storm::modelchecker::RegionCheckEngine engine)
Checks whether the parameter lifting approach is sound on the given model with respect to the provide...
bool isMultiLinearPolynomial(FunctionType const &function)
Checks whether the function is a multilinear polynomial, i.e., a polynomial which only considers vari...
void gatherOccurringVariables(FunctionType const &function, std::set< typename VariableType< FunctionType >::type > &variableSet)
Add all variables that occur in the given function to the the given set.
ValueType simplify(ValueType value)