44 lines
1.5 KiB
44 lines
1.5 KiB
#include "src/storage/expressions/IntegerLiteralExpression.h"
|
|
|
|
#include "ExpressionVisitor.h"
|
|
#include "src/storage/expressions/ExpressionManager.h"
|
|
|
|
namespace storm {
|
|
namespace expressions {
|
|
IntegerLiteralExpression::IntegerLiteralExpression(ExpressionManager const& manager, int_fast64_t value) : BaseExpression(manager, manager.getIntegerType()), value(value) {
|
|
// Intentionally left empty.
|
|
}
|
|
|
|
int_fast64_t IntegerLiteralExpression::evaluateAsInt(Valuation const* valuation) const {
|
|
return this->getValue();
|
|
}
|
|
|
|
double IntegerLiteralExpression::evaluateAsDouble(Valuation const* valuation) const {
|
|
return static_cast<double>(this->evaluateAsInt(valuation));
|
|
}
|
|
|
|
bool IntegerLiteralExpression::isLiteral() const {
|
|
return true;
|
|
}
|
|
|
|
void IntegerLiteralExpression::gatherVariables(std::set<storm::expressions::Variable>& variables) const {
|
|
return;
|
|
}
|
|
|
|
std::shared_ptr<BaseExpression const> IntegerLiteralExpression::simplify() const {
|
|
return this->shared_from_this();
|
|
}
|
|
|
|
boost::any IntegerLiteralExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
|
|
return visitor.visit(*this, data);
|
|
}
|
|
|
|
int_fast64_t IntegerLiteralExpression::getValue() const {
|
|
return this->value;
|
|
}
|
|
|
|
void IntegerLiteralExpression::printToStream(std::ostream& stream) const {
|
|
stream << this->getValue();
|
|
}
|
|
}
|
|
}
|