10namespace expressions {
13 std::vector<std::shared_ptr<BaseExpression const>>
const& arguments)
14 :
BaseExpression(manager, type), identifier(functionIdentifier), arguments(arguments) {
19 for (
auto const& a : arguments) {
25 for (
auto const& a : arguments) {
26 if (a->containsVariables()) {
34 std::vector<std::shared_ptr<BaseExpression const>> simplifiedArguments;
35 simplifiedArguments.reserve(arguments.size());
36 for (
auto const& a : arguments) {
37 simplifiedArguments.push_back(a->simplify());
44 STORM_LOG_THROW(janiVisitor !=
nullptr, storm::exceptions::UnexpectedException,
"Visitor of jani expression should be of type JaniVisitor.");
45 return janiVisitor->visit(*
this, data);
53 for (
auto const& a : arguments) {
69 return arguments.size();
73 STORM_LOG_THROW(i < arguments.size(), storm::exceptions::InvalidArgumentException,
74 "Tried to access the argument with index " << i <<
" of a function call with " << arguments.size() <<
" arguments.");
The base class of all expression classes.
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const =0
Retrieves the set of all variables that appear in the expression.
ExpressionManager const & getManager() const
Retrieves the manager responsible for this expression.
Type const & getType() const
Retrieves the type of the expression.
This class is responsible for managing a set of typed variables and all expressions using these varia...
Represents an array with a given list of elements.
FunctionCallExpression(ExpressionManager const &manager, Type const &type, std::string const &functionIdentifier, std::vector< std::shared_ptr< BaseExpression const > > const &arguments)
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
virtual bool containsVariables() const override
Retrieves whether the expression contains a variable.
uint64_t getNumberOfArguments() const
std::vector< std::shared_ptr< BaseExpression const > > const & getArguments() const
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const override
Accepts the given visitor by calling its visit method.
std::shared_ptr< BaseExpression const > getArgument(uint64_t i) const
std::string const & getFunctionIdentifier() const
virtual void printToStream(std::ostream &stream) const override
Prints the expression to the given stream.
virtual std::shared_ptr< BaseExpression const > simplify() const override
Simplifies the expression according to some simple rules.
#define STORM_LOG_THROW(cond, exception, message)