15 : lValue(lValue), expression(expression), level(level) {
20 : lValue(lValue), expression(expression), level(level) {
30 return lValue.isVariable();
34 return lValue.isArrayAccess();
46 return lValue.getVariable();
58 this->expression = expression;
62 return lValue.isTransient();
65void Assignment::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression>
const& substitution,
66 bool const substituteTranscendentalNumbers) {
68 if (lValue.isArrayAccess()) {
69 std::vector<storm::expressions::Expression> substitutedExpressions;
70 for (
auto& index : lValue.getArrayIndexVector()) {
71 substitutedExpressions.push_back(
substituteJaniExpression(index, substitution, substituteTranscendentalNumbers).simplify());
74 lValue =
LValue(lValue.getVariable(), substitutedExpressions);
93 stream <<
"@" << assignment.
getLevel() <<
": ";
104 return left.
getLevel() < right->getLevel() || (left.
getLevel() == right->getLevel() && left.
getLValue() < right->getLValue());
108 return left->getLevel() < right->getLevel() || (left->getLevel() == right->getLevel() && left->getLValue() < right->getLValue());
112 return left->getLevel() < right.
getLevel() || (left->getLevel() == right.
getLevel() && left->getLValue() < right.
getLValue());
bool isSyntacticallyEqual(storm::expressions::Expression const &other) const
Checks whether the two expressions are syntatically the same.
bool check(Expression const &expression, bool booleanIsLinear=false)
Checks that the given expression is linear.
storm::expressions::Expression const & getAssignedExpression() const
Retrieves the expression whose value is assigned to the target variable.
storm::jani::LValue const & getLValue() const
Retrieves the lValue that is written in this assignment.
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the expression variable that is written in this assignment.
bool lValueIsArrayAccess() const
Returns true if the lValue is an array access.
Assignment(storm::jani::LValue const &lValue, storm::expressions::Expression const &expression, int64_t level=0)
Creates an assignment of the given expression to the given LValue.
void setAssignedExpression(storm::expressions::Expression const &expression)
Sets a new expression that is assigned to the target LValue.
bool lValueIsVariable() const
Returns true if the lValue is a variable.
bool isLinear() const
Checks the assignment for linearity.
storm::jani::Variable const & getVariable() const
Retrieves the Variable that is written in this assignment.
int64_t getLevel() const
Retrieves the level of the assignment.
bool operator==(Assignment const &other) const
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Substitutes all variables in all expressions according to the given substitution.
bool isTransient() const
Retrieves whether the assignment assigns to a transient variable.
void setLevel(int64_t level)
Sets the level.
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the associated expression variable.
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
bool operator()(Assignment const &left, Assignment const &right) const