16 expression->
accept(*
this, boost::none);
95 "Dice does not support modulo with nonconst rhs");
98 while (denominator % 2 == 0) {
99 denominator = denominator >> 1;
102 denominator = denominator >> 1;
103 if (denominator > 0) {
104 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Dice does not support division with non-powers of two");
109 stream <<
" >> " << shifts;
125 "Dice does not support modulo with nonconst rhs");
127 "Dice does not support modulo with rhs != 2");
129 stream <<
"( nth_bit(int(" << nrBits <<
"," << nrBits - 1 <<
"), ";
134 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Dice translation not supported for log expressions.");
241 "Only some predicate types are supported.");
245 for (uint64_t operandi = 0; operandi < expression.
getArity(); ++operandi) {
246 for (uint64_t operandj = operandi + 1; operandj < expression.
getArity(); ++operandj) {
248 expression.
getOperand(operandi)->accept(*
this, data);
250 expression.
getOperand(operandj)->accept(*
this, data);
261 for (uint64_t operandj = 0; operandj < expression.
getArity(); ++operandj) {
263 expression.
getOperand(operandj)->accept(*
this, data);
272 stream << (expression.
getValue() ?
" true " :
" false ");
277 stream <<
"int(" << nrBits <<
"," << expression.
getValue() <<
")";
282 stream << std::scientific << std::setprecision(std::numeric_limits<double>::max_digits10) <<
"(" << expression.
getValueAsDouble() <<
")";
The base class of all expression classes.
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const =0
Accepts the given visitor by calling its visit method.
OperatorType getOperatorType() const
Retrieves the operator associated with the expression.
std::shared_ptr< BaseExpression const > const & getSecondOperand() const
Retrieves the second operand of the expression.
std::shared_ptr< BaseExpression const > const & getFirstOperand() const
Retrieves the first operand of the expression.
OperatorType getOperatorType() const
Retrieves the operator associated with the expression.
RelationType getRelationType() const
Retrieves the relation associated with the expression.
bool getValue() const
Retrieves the value of the boolean literal.
std::shared_ptr< BaseExpression const > const & getBaseExpressionPointer() const
Retrieves a pointer to the base expression underlying this expression object.
std::shared_ptr< BaseExpression const > getElseExpression() const
Retrieves the else expression of the if-then-else expression.
std::shared_ptr< BaseExpression const > getCondition() const
Retrieves the condition expression of the if-then-else expression.
std::shared_ptr< BaseExpression const > getThenExpression() const
Retrieves the then expression of the if-then-else expression.
int_fast64_t getValue() const
Retrieves the value of the integer literal.
The base class of all binary expressions.
virtual std::shared_ptr< BaseExpression const > getOperand(uint_fast64_t operandIndex) const override
Retrieves the given operand from the expression.
PredicateType getPredicateType() const
Retrieves the relation associated with the expression.
virtual uint_fast64_t getArity() const override
Returns the arity of the expression.
double getValueAsDouble() const
Retrieves the value of the double literal.
ToDiceStringVisitor(uint64_t nrBits)
virtual boost::any visit(IfThenElseExpression const &expression, boost::any const &data) override
std::string toString(Expression const &expression)
OperatorType getOperatorType() const
Retrieves the operator associated with this expression.
virtual std::shared_ptr< BaseExpression const > getOperand(uint_fast64_t operandIndex) const override
Retrieves the given operand from the expression.
OperatorType getOperatorType() const
Retrieves the operator associated with this expression.
Variable const & getVariable() const
Retrieves the variable associated with this expression.
std::string const & getName() const
Retrieves the name of the variable.
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)