Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Constant.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
8
9namespace storm {
10namespace prism {
12 public:
21 Constant(storm::expressions::Variable const& variable, storm::expressions::Expression const& expression, std::string const& filename = "",
22 uint_fast64_t lineNumber = 0);
23
31 Constant(storm::expressions::Variable const& variable, std::string const& filename = "", uint_fast64_t lineNumber = 0);
32
33 // Create default implementations of constructors/assignment.
34 Constant() = default;
35 Constant(Constant const& other) = default;
36 Constant& operator=(Constant const& other) = default;
37 Constant(Constant&& other) = default;
38 Constant& operator=(Constant&& other) = default;
39
45 std::string const& getName() const;
46
52 storm::expressions::Type const& getType() const;
53
60
66 bool isDefined() const;
67
74
81 Constant substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const;
82
83 friend std::ostream& operator<<(std::ostream& stream, Constant const& constant);
84
85 private:
86 // The expression variable associated with the constant.
88
89 // The expression that defines the constant (in case it is defined).
91};
92
93bool operator==(Constant const& lhs, Constant const& rhs);
94
95} // namespace prism
96} // namespace storm
bool isDefined() const
Retrieves whether the constant is defined, i.e., whether there is an expression defining its value.
Definition Constant.cpp:30
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the expression variable associated with this constant.
Definition Constant.cpp:26
Constant(Constant const &other)=default
Constant & operator=(Constant const &other)=default
std::string const & getName() const
Retrieves the name of the constant.
Definition Constant.cpp:18
Constant substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution) const
Substitutes all identifiers in the constant according to the given map.
Definition Constant.cpp:38
Constant(Constant &&other)=default
friend std::ostream & operator<<(std::ostream &stream, Constant const &constant)
Definition Constant.cpp:46
storm::expressions::Type const & getType() const
Retrieves the type of the constant.
Definition Constant.cpp:22
Constant & operator=(Constant &&other)=default
storm::expressions::Expression const & getExpression() const
Retrieves the expression that defines the constant.
Definition Constant.cpp:34
bool operator==(Constant const &lhs, Constant const &rhs)
Definition Constant.cpp:61
LabParser.cpp.
Definition cli.cpp:18