Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
UnaryExpression.cpp
Go to the documentation of this file.
2
5
6namespace storm {
7namespace expressions {
8UnaryExpression::UnaryExpression(ExpressionManager const& manager, Type const& type, std::shared_ptr<BaseExpression const> const& operand)
9 : BaseExpression(manager, type), operand(operand) {
10 // Intentionally left empty.
11}
12
14 return true;
15}
16
18 return this->getOperand()->containsVariables();
19}
20
21void UnaryExpression::gatherVariables(std::set<storm::expressions::Variable>& variables) const {
22 this->getOperand()->gatherVariables(variables);
23}
24
25std::shared_ptr<BaseExpression const> const& UnaryExpression::getOperand() const {
26 return this->operand;
27}
28
29uint_fast64_t UnaryExpression::getArity() const {
30 return 1;
31}
32
33std::shared_ptr<BaseExpression const> UnaryExpression::getOperand(uint_fast64_t operandIndex) const {
34 STORM_LOG_THROW(operandIndex == 0, storm::exceptions::InvalidAccessException, "Unable to access operand " << operandIndex << " in expression of arity 2.");
35 return this->getOperand();
36}
37} // namespace expressions
38} // namespace storm
The base class of all expression classes.
virtual bool containsVariables() const
Retrieves whether the expression contains a variable.
This class is responsible for managing a set of typed variables and all expressions using these varia...
UnaryExpression(ExpressionManager const &manager, Type const &type, std::shared_ptr< BaseExpression const > const &operand)
Creates a unary expression with the given return type and operand.
virtual bool isFunctionApplication() const override
Checks if the expression is a function application (of any sort).
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
std::shared_ptr< BaseExpression const > const & getOperand() const
Retrieves the operand of the unary expression.
virtual bool containsVariables() const override
Retrieves whether the expression contains a variable.
virtual uint_fast64_t getArity() const override
Returns the arity of the expression.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
LabParser.cpp.
Definition cli.cpp:18