Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Variable.cpp
Go to the documentation of this file.
1#include <map>
2
5
6namespace storm {
7namespace prism {
8Variable::Variable(storm::expressions::Variable const& variable, storm::expressions::Expression const& initialValueExpression, bool observable,
9 std::string const& filename, uint_fast64_t lineNumber)
10 : LocatedInformation(filename, lineNumber), variable(variable), initialValueExpression(initialValueExpression), observable(observable) {
11 // Nothing to do here.
12}
13
14Variable::Variable(storm::expressions::ExpressionManager& manager, Variable const& oldVariable, std::string const& newName,
15 std::map<storm::expressions::Variable, storm::expressions::Expression> const& renaming, bool observable, std::string const& filename,
16 uint_fast64_t lineNumber)
17 : LocatedInformation(filename, lineNumber),
18 variable(manager.declareVariable(newName, oldVariable.variable.getType())),
19 initialValueExpression(oldVariable.getInitialValueExpression().substitute(renaming)),
20 observable(observable) {
21 // Intentionally left empty.
22}
23
24std::string const& Variable::getName() const {
25 return this->variable.getName();
26}
27
29 return this->initialValueExpression.isInitialized();
30}
31
33 return this->initialValueExpression;
34}
35
37 this->initialValueExpression = initialValueExpression;
38}
39
41 return this->variable;
42}
43
47
49 return this->observable;
50}
51
52} // namespace prism
53} // namespace storm
bool isInitialized() const
Checks whether the object encapsulates a base-expression.
This class is responsible for managing a set of typed variables and all expressions using these varia...
storm::expressions::Expression getExpression() const
Retrieves an expression that represents the variable.
Definition Variable.cpp:34
std::string const & getName() const
Retrieves the name of the variable.
Definition Variable.cpp:46
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
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
LabParser.cpp.
Definition cli.cpp:18