Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Variable.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
8
9namespace storm {
10namespace prism {
12 public:
13 // Create default implementations of constructors/assignment.
14 Variable(Variable const& otherVariable) = default;
15 Variable& operator=(Variable const& otherVariable) = default;
16 Variable(Variable&& otherVariable) = default;
17 Variable& operator=(Variable&& otherVariable) = default;
18 virtual ~Variable() = default;
19
25 std::string const& getName() const;
26
32 bool hasInitialValue() const;
33
41
47 void setInitialValueExpression(storm::expressions::Expression const& initialValueExpression);
48
55
62
66 bool isObservable() const;
67
71 virtual void createMissingInitialValue() = 0;
72
73 // Make the constructors protected to forbid instantiation of this class.
74 protected:
75 Variable() = default;
76
86 Variable(storm::expressions::Variable const& variable, storm::expressions::Expression const& initialValueExpression, bool observable = false,
87 std::string const& filename = "", uint_fast64_t lineNumber = 0);
88
100 Variable(storm::expressions::ExpressionManager& manager, Variable const& oldVariable, std::string const& newName,
101 std::map<storm::expressions::Variable, storm::expressions::Expression> const& renaming, bool observable = false, std::string const& filename = "",
102 uint_fast64_t lineNumber = 0);
103
104 private:
105 // The expression variable associated with this variable.
107
108 // The constant expression defining the initial value of the variable.
109 storm::expressions::Expression initialValueExpression;
110
111 // Whether this variable is a so-called observable. If true, the variable is listed as observable
112 bool observable;
113};
114
115} // namespace prism
116} // namespace storm
This class is responsible for managing a set of typed variables and all expressions using these varia...
LocatedInformation(std::string const &filename, uint_fast64_t lineNumber)
Constructs a located information with the given filename and line number.
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.