Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
IntegerLiteralExpression.cpp
Go to the documentation of this file.
2
3#include "ExpressionVisitor.h"
5
6namespace storm {
7namespace expressions {
9 : BaseExpression(manager, manager.getIntegerType()), value(value) {
10 // Intentionally left empty.
11}
12
14 return this->getValue();
15}
16
18 return static_cast<double>(this->evaluateAsInt(valuation));
19}
20
22 return true;
23}
24
25void IntegerLiteralExpression::gatherVariables(std::set<storm::expressions::Variable>&) const {
26 return;
27}
28
29std::shared_ptr<BaseExpression const> IntegerLiteralExpression::simplify() const {
30 return this->shared_from_this();
31}
32
33boost::any IntegerLiteralExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
34 return visitor.visit(*this, data);
35}
36
40
42 return this->value;
43}
44
45void IntegerLiteralExpression::printToStream(std::ostream& stream) const {
46 stream << this->getValue();
47}
48} // namespace expressions
49} // namespace storm
The base class of all expression classes.
This class is responsible for managing a set of typed variables and all expressions using these varia...
virtual boost::any visit(IfThenElseExpression const &expression, boost::any const &data)=0
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
virtual int_fast64_t evaluateAsInt(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
virtual std::shared_ptr< BaseExpression const > simplify() const override
Simplifies the expression according to some simple rules.
int_fast64_t getValue() const
Retrieves the value of the integer literal.
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const override
Accepts the given visitor by calling its visit method.
IntegerLiteralExpression(ExpressionManager const &manager, int_fast64_t value)
Creates an integer literal expression with the given value.
virtual void printToStream(std::ostream &stream) const override
Prints the expression to the given stream.
virtual bool isLiteral() const override
Retrieves whether the expression is a literal.
virtual double evaluateAsDouble(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
The base class of all valuations of variables.
Definition Valuation.h:16
LabParser.cpp.
Definition cli.cpp:18