24 auto variablesInRewardExpression = rewardModelExpression.
getVariables();
25 std::map<storm::expressions::Variable, storm::expressions::Expression> initialSubstitution;
26 bool containsNonTransientVariable =
false;
27 for (
auto const& v : variablesInRewardExpression) {
29 auto const& janiConst = model.
getConstant(v.getName());
30 if (janiConst.isDefined()) {
31 initialSubstitution.emplace(v, janiConst.getExpression());
36 if (janiVar.hasInitExpression()) {
37 initialSubstitution.emplace(v, janiVar.getInitExpression());
39 if (!janiVar.isTransient()) {
40 containsNonTransientVariable =
true;
45 if (containsNonTransientVariable || initExpr.containsVariables() || !
storm::utility::isZero(initExpr.evaluateAsRational())) {
50 traverse(model, &variablesInRewardExpression);
54 auto const& vars = *boost::any_cast<std::set<storm::expressions::Variable>*>(data);
67 auto const& vars = *boost::any_cast<std::set<storm::expressions::Variable>*>(data);
83 auto const& vars = *boost::any_cast<std::set<storm::expressions::Variable>*>(data);
Expression simplify() const
Simplifies the expression according to some basic rules.
std::set< storm::expressions::Variable > getVariables() const
Retrieves the set of all variables that appear in the expression.
OrderedAssignments const & getAssignments() const
Retrieves the assignments of this location.
Variable const & getGlobalVariable(std::string const &name) const
Retrieves the global variable with the given name if one exists.
bool hasConstant(std::string const &name) const
Retrieves whether the model has a constant with the given name.
Constant const & getConstant(std::string const &name) const
Retrieves the constant with the given name (if any).
bool hasGlobalVariable(std::string const &name) const
Retrieves whether this model has a global variable with the given name.
detail::ConstAssignments getTransientAssignments() const
Returns all transient assignments in this set of assignments.
OrderedAssignments const & getOrderedAssignments() const
std::vector< TemplateEdgeDestination > const & getDestinations() const
OrderedAssignments const & getAssignments() const
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the associated expression variable.
#define STORM_LOG_ASSERT(cond, message)
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
bool isZero(ValueType const &a)
The contract of a DD backend.