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.
 
 
 
 

49 lines
1.6 KiB

#include "src/storage/expressions/BooleanLiteralExpression.h"
namespace storm {
namespace expressions {
BooleanLiteralExpression::BooleanLiteralExpression(bool value) : BaseExpression(ExpressionReturnType::Bool), 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;
}
std::set<std::string> BooleanLiteralExpression::getVariables() const {
return std::set<std::string>();
}
std::map<std::string, ExpressionReturnType> BooleanLiteralExpression::getVariablesAndTypes() const {
return std::map<std::string, ExpressionReturnType>();
}
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");
}
}
}