Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
RationalLiteralExpression.h
Go to the documentation of this file.
1#ifndef STORM_STORAGE_EXPRESSIONS_RationalLiteralExpression_H_
2#define STORM_STORAGE_EXPRESSIONS_RationalLiteralExpression_H_
3
6
8
9namespace storm {
10namespace expressions {
12 public:
19 RationalLiteralExpression(ExpressionManager const& manager, double value);
20
27 RationalLiteralExpression(ExpressionManager const& manager, std::string const& valueAsString);
28
35 RationalLiteralExpression(ExpressionManager const& manager, storm::RationalNumber const& value);
36
37 // Instantiate constructors and assignments with their default implementations.
42
43 virtual ~RationalLiteralExpression() = default;
44
45 // Override base class methods.
46 virtual double evaluateAsDouble(Valuation const* valuation = nullptr) const override;
47 virtual bool isLiteral() const override;
48 virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
49 virtual std::shared_ptr<BaseExpression const> simplify() const override;
50 virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
51 virtual bool isRationalLiteralExpression() const override;
52
58 double getValueAsDouble() const;
59
65 storm::RationalNumber getValue() const;
66
67 protected:
68 // Override base class method.
69 virtual void printToStream(std::ostream& stream) const override;
70
71 private:
72 // The value of the literal.
73 storm::RationalNumber value;
74};
75} // namespace expressions
76} // namespace storm
77
78#endif /* STORM_STORAGE_EXPRESSIONS_RationalLiteralExpression_H_ */
The base class of all expression classes.
This class is responsible for managing a set of typed variables and all expressions using these varia...
double getValueAsDouble() const
Retrieves the value of the double literal.
RationalLiteralExpression & operator=(RationalLiteralExpression &&)=delete
storm::RationalNumber getValue() const
Retrieves the value of the double literal.
RationalLiteralExpression & operator=(RationalLiteralExpression const &other)=delete
virtual double evaluateAsDouble(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
RationalLiteralExpression(RationalLiteralExpression &&)=default
virtual void printToStream(std::ostream &stream) const override
Prints the expression to the given stream.
RationalLiteralExpression(RationalLiteralExpression const &other)=default
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const override
Accepts the given visitor by calling its visit method.
virtual bool isLiteral() const override
Retrieves whether the expression is a literal.
virtual std::shared_ptr< BaseExpression const > simplify() const override
Simplifies the expression according to some simple rules.
The base class of all valuations of variables.
Definition Valuation.h:16
LabParser.cpp.
Definition cli.cpp:18