Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Assignment.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
7
8namespace storm {
9namespace jani {
10
12 public:
16 Assignment(storm::jani::LValue const& lValue, storm::expressions::Expression const& expression, int64_t level = 0);
17
21 Assignment(storm::jani::Variable const& lValue, storm::expressions::Expression const&, int64_t level = 0);
22
23 Assignment(Assignment const&) = default;
24 bool operator==(Assignment const& other) const;
25
29 bool lValueIsVariable() const;
30
34 bool lValueIsArrayAccess() const;
35
39 storm::jani::LValue const& getLValue() const;
40
45
51
57
62
67
71 void substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution, bool const substituteTranscendentalNumbers);
72
76 bool isTransient() const;
77
81 int64_t getLevel() const;
82
86 void setLevel(int64_t level);
87
91 bool isLinear() const;
92
93 friend std::ostream& operator<<(std::ostream& stream, Assignment const& assignment);
94
95 private:
96 // The lValue being assigned.
97 LValue lValue;
98
99 // The expression that is being assigned to the lValue.
101
102 // The level of the assignment.
103 int64_t level;
104};
105
111 bool operator()(Assignment const& left, Assignment const& right) const;
112 bool operator()(Assignment const& left, std::shared_ptr<Assignment> const& right) const;
113 bool operator()(std::shared_ptr<Assignment> const& left, std::shared_ptr<Assignment> const& right) const;
114 bool operator()(std::shared_ptr<Assignment> const& left, Assignment const& right) const;
115};
116
117} // namespace jani
118} // namespace storm
Assignment(Assignment const &)=default
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.
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
friend std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
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.
LabParser.cpp.
Definition cli.cpp:18
This functor enables ordering the assignments first by the assignment level and then by lValue.
Definition Assignment.h:110
bool operator()(Assignment const &left, Assignment const &right) const