1#ifndef STORM_UTILITY_PARAMETERLIFTING_H
2#define STORM_UTILITY_PARAMETERLIFTING_H
16namespace parameterlifting {
32template<
typename ValueType>
40 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition: '"
41 << entry.getValue() <<
"'. Can not validate that parameter lifting is sound on this model.");
49 STORM_LOG_ERROR(
"parameter lifting requires a closed Markov automaton.");
52 auto const& rateVector = ma.getExitRates();
53 auto const& markovianStates = ma.getMarkovianStates();
55 if (markovianStates.get(state)) {
56 auto const& exitRate = rateVector[state];
59 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition rate: '"
61 <<
"'. Can not validate that parameter lifting is sound on this model.");
68 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition: '"
69 << entry.getValue() <<
"'. Can not validate that parameter lifting is sound on this model.");
88 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as state reward: '"
89 << rew <<
"'. Can not validate that parameter lifting is sound on this model.");
96 std::set<typename storm::utility::parametric::VariableType<ValueType>::type> collectedRewardParameters;
101 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as action reward: '"
102 << rew <<
"'. Can not validate that parameter lifting is sound on this model.");
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.");
121 STORM_LOG_WARN(
"The input model contains a non-linear polynomial as transition reward: '"
122 << rewEntry.getValue() <<
"'. Can not validate that parameter lifting is sound on this model.");
129 if (!collectedRewardParameters.empty()) {
130 std::set<typename storm::utility::parametric::VariableType<ValueType>::type> transitionParameters =
132 auto rewParIt = collectedRewardParameters.begin();
133 auto trParIt = transitionParameters.begin();
134 while (rewParIt != collectedRewardParameters.end() && trParIt != transitionParameters.end()) {
135 if (*rewParIt == *trParIt) {
139 <<
" occurs in a transition probability/rate and in a transition/action reward. Parameter lifting might not be sound on this model.");
142 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)
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)
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)