Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Variable.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_PRISM_VARIABLE_H_
2#define STORM_STORAGE_PRISM_VARIABLE_H_
3
4#include <map>
5
10
11namespace storm {
12namespace prism {
14 public:
15 // Create default implementations of constructors/assignment.
16 Variable(Variable const& otherVariable) = default;
17 Variable& operator=(Variable const& otherVariable) = default;
18 Variable(Variable&& otherVariable) = default;
19 Variable& operator=(Variable&& otherVariable) = default;
20 virtual ~Variable() = default;
21
27 std::string const& getName() const;
28
34 bool hasInitialValue() const;
35
43
49 void setInitialValueExpression(storm::expressions::Expression const& initialValueExpression);
50
57
64
68 bool isObservable() const;
69
73 virtual void createMissingInitialValue() = 0;
74
75 // Make the constructors protected to forbid instantiation of this class.
76 protected:
77 Variable() = default;
78
88 Variable(storm::expressions::Variable const& variable, storm::expressions::Expression const& initialValueExpression, bool observable = false,
89 std::string const& filename = "", uint_fast64_t lineNumber = 0);
90
102 Variable(storm::expressions::ExpressionManager& manager, Variable const& oldVariable, std::string const& newName,
103 std::map<storm::expressions::Variable, storm::expressions::Expression> const& renaming, bool observable = false, std::string const& filename = "",
104 uint_fast64_t lineNumber = 0);
105
106 private:
107 // The expression variable associated with this variable.
109
110 // The constant expression defining the initial value of the variable.
111 storm::expressions::Expression initialValueExpression;
112
113 // Whether this variable is a so-called observable. If true, the variable is listed as observable
114 bool observable;
115};
116
117} // namespace prism
118} // namespace storm
119
120#endif /* STORM_STORAGE_PRISM_VARIABLE_H_ */
This class is responsible for managing a set of typed variables and all expressions using these varia...
storm::expressions::Expression const & getInitialValueExpression() const
Retrieves the expression defining the initial value of the variable.
Definition Variable.cpp:32
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the expression variable associated with this variable.
Definition Variable.cpp:40
storm::expressions::Expression getExpression() const
Retrieves the expression associated with this variable.
Definition Variable.cpp:44
virtual ~Variable()=default
void setInitialValueExpression(storm::expressions::Expression const &initialValueExpression)
Sets the expression defining the initial value of the variable.
Definition Variable.cpp:36
std::string const & getName() const
Retrieves the name of the variable.
Definition Variable.cpp:24
bool hasInitialValue() const
Retrieves whether the variable has an initial value.
Definition Variable.cpp:28
bool isObservable() const
Retrieves whether the variable is observable.
Definition Variable.cpp:48
Variable(Variable &&otherVariable)=default
Variable(Variable const &otherVariable)=default
Variable & operator=(Variable const &otherVariable)=default
Variable & operator=(Variable &&otherVariable)=default
virtual void createMissingInitialValue()=0
Equips the variable with an initial value based on its type if not initial value is present.
LabParser.cpp.
Definition cli.cpp:18