Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
BooleanLiteralExpression.cpp
Go to the documentation of this file.
4
5namespace storm {
6namespace expressions {
8 : BaseExpression(manager, manager.getBooleanType()), value(value) {
9 // Intentionally left empty.
10}
11
13 return this->getValue();
14}
15
17 return true;
18}
19
21 return this->getValue() == true;
22}
23
25 return this->getValue() == false;
26}
27
28void BooleanLiteralExpression::gatherVariables(std::set<storm::expressions::Variable>&) const {
29 return;
30}
31
32std::shared_ptr<BaseExpression const> BooleanLiteralExpression::simplify() const {
33 return this->shared_from_this();
34}
35
36boost::any BooleanLiteralExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
37 return visitor.visit(*this, data);
38}
39
43
45 return this->value;
46}
47
48void BooleanLiteralExpression::printToStream(std::ostream& stream) const {
49 stream << (this->getValue() ? "true" : "false");
50}
51} // namespace expressions
52} // namespace storm
The base class of all expression classes.
virtual void printToStream(std::ostream &stream) const override
Prints the expression to the given stream.
bool getValue() const
Retrieves the value of the boolean literal.
virtual bool isLiteral() const override
Retrieves whether the expression is a literal.
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const override
Accepts the given visitor by calling its visit method.
virtual bool isTrue() const override
Checks if the expression is equal to the boolean literal true.
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
virtual std::shared_ptr< BaseExpression const > simplify() const override
Simplifies the expression according to some simple rules.
virtual bool evaluateAsBool(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
virtual bool isFalse() const override
Checks if the expression is equal to the boolean literal false.
BooleanLiteralExpression(ExpressionManager const &manager, bool value)
Creates a boolean literal expression with the given value.
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
The base class of all valuations of variables.
Definition Valuation.h:16
LabParser.cpp.
Definition cli.cpp:18