You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
1.6 KiB

#include "src/storage/expressions/BooleanLiteralExpression.h"
#include "src/storage/expressions/ExpressionManager.h"
#include "src/storage/expressions/ExpressionVisitor.h"
namespace storm {
namespace expressions {
BooleanLiteralExpression::BooleanLiteralExpression(ExpressionManager const& manager, bool value) : BaseExpression(manager, manager.getBooleanType()), value(value) {
// Intentionally left empty.
}
bool BooleanLiteralExpression::evaluateAsBool(Valuation const* valuation) const {
return this->getValue();
}
bool BooleanLiteralExpression::isLiteral() const {
return true;
}
bool BooleanLiteralExpression::isTrue() const {
return this->getValue() == true;
}
bool BooleanLiteralExpression::isFalse() const {
return this->getValue() == false;
}
void BooleanLiteralExpression::gatherVariables(std::set<storm::expressions::Variable>& variables) const {
return;
}
std::shared_ptr<BaseExpression const> BooleanLiteralExpression::simplify() const {
return this->shared_from_this();
}
boost::any BooleanLiteralExpression::accept(ExpressionVisitor& visitor) const {
return visitor.visit(*this);
}
bool BooleanLiteralExpression::getValue() const {
return this->value;
}
void BooleanLiteralExpression::printToStream(std::ostream& stream) const {
stream << (this->getValue() ? "true" : "false");
}
}
}