11namespace expressions {
18 uint64_t size = expression.
size()->evaluateAsInt();
19 std::vector<std::shared_ptr<BaseExpression const>> newElements;
20 newElements.reserve(size);
22 for (uint64_t i = 0; i < size; ++i) {
23 newElements.push_back(boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
at(i)->accept(*
this, data)));
24 changed = changed || expression.
at(i).get() != newElements.back().get();
28 return std::const_pointer_cast<BaseExpression const>(
36 std::shared_ptr<BaseExpression const> newSize = boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
size()->accept(*
this, data));
37 std::shared_ptr<BaseExpression const> elementExpression =
38 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getElementExpression()->accept(*
this, data));
41 if (newSize.get() == expression.
size().get() && elementExpression.get() == expression.
getElementExpression().get()) {
44 return std::const_pointer_cast<BaseExpression const>(std::shared_ptr<BaseExpression>(
50 std::shared_ptr<BaseExpression const> firstExpression =
51 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getFirstOperand()->accept(*
this, data));
52 std::shared_ptr<BaseExpression const> secondExpression =
53 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getSecondOperand()->accept(*
this, data));
59 return std::const_pointer_cast<BaseExpression const>(
65 std::vector<std::shared_ptr<BaseExpression const>> newArguments;
68 newArguments.push_back(boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getArgument(i)->accept(*
this, data)));
70 return std::const_pointer_cast<BaseExpression const>(std::shared_ptr<BaseExpression>(
Represents an access to an array.
ExpressionManager const & getManager() const
Retrieves the manager responsible for this expression.
Type const & getType() const
Retrieves the type of the expression.
std::shared_ptr< BaseExpression const > getSharedPointer() const
Retrieves a shared pointer to this 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.
Represents an array of the given size, where the i'th entry is determined by the elementExpression,...
virtual std::shared_ptr< BaseExpression const > size() const override
std::shared_ptr< BaseExpression const > const & getElementExpression() const
storm::expressions::Variable const & getIndexVar() const
Represents an array with a given list of elements.
uint64_t getNumberOfArguments() const
std::shared_ptr< BaseExpression const > getArgument(uint64_t i) const
std::string const & getFunctionIdentifier() const
JaniReduceNestingExpressionVisitor()
virtual boost::any visit(ValueArrayExpression const &expression, boost::any const &data) override
Expression reduceNesting(Expression const &expression)
Reduces the nesting in the given expression.
Represents an array with a given list of elements.
virtual std::shared_ptr< BaseExpression const > size() const override
virtual std::shared_ptr< BaseExpression const > at(uint64_t i) const override
storm::expressions::Expression reduceNestingInJaniExpression(storm::expressions::Expression const &expression)