21 if (deleteIdentifierMapping) {
22 delete this->identifiers;
28 if (this->createExpressions) {
31 }
catch (storm::exceptions::InvalidTypeException
const& e) {
41 if (this->createExpressions) {
43 switch (operatorType) {
54 }
catch (storm::exceptions::InvalidTypeException
const& e) {
64 if (this->createExpressions) {
67 switch (operatorType) {
75 }
catch (storm::exceptions::InvalidTypeException
const& e) {
86 if (this->createExpressions) {
88 switch (operatorType) {
105 }
catch (storm::exceptions::InvalidTypeException
const& e) {
115 if (this->createExpressions) {
117 switch (operatorType) {
128 }
catch (storm::exceptions::InvalidTypeException
const& e) {
138 if (this->createExpressions) {
140 switch (operatorType) {
151 }
catch (storm::exceptions::InvalidTypeException
const& e) {
161 if (this->createExpressions) {
163 switch (operatorType) {
174 }
catch (storm::exceptions::InvalidTypeException
const& e) {
184 if (this->createExpressions) {
186 switch (operatorType) {
200 }
catch (storm::exceptions::InvalidTypeException
const& e) {
209 if (this->createExpressions) {
212 for (
auto const& op : operatorTypes) {
226 }
catch (storm::exceptions::InvalidTypeException
const& e) {
235 if (!this->acceptDoubleLiterals) {
239 if (this->createExpressions) {
247 if (this->createExpressions) {
255 if (this->createExpressions) {
265 if (this->createExpressions) {
267 switch (operatorType) {
278 }
catch (storm::exceptions::InvalidTypeException
const& e) {
287 if (this->createExpressions) {
289 switch (operatorType) {
300 }
catch (storm::exceptions::InvalidTypeException
const& e) {
308 if (this->createExpressions) {
311 }
catch (storm::exceptions::InvalidTypeException
const& e) {
319 std::vector<storm::expressions::Expression>
const& operands,
bool& pass)
const {
320 if (this->createExpressions) {
330 STORM_LOG_THROW(
false, storm::exceptions::InvalidTypeException,
"Operator type " << opTyp <<
" invalid for predicate expression.");
332 }
catch (storm::exceptions::InvalidTypeException
const& e) {
340 if (this->createExpressions) {
341 STORM_LOG_THROW(this->identifiers !=
nullptr, storm::exceptions::WrongFormatException,
342 "Unable to substitute identifier expressions without given mapping.");
344 if (expression ==
nullptr) {
355 if (identifiers_ !=
nullptr) {
356 createExpressions =
true;
357 identifiers = identifiers_;
359 createExpressions =
false;
360 identifiers =
nullptr;
367 createExpressions =
true;
368 identifiers =
new qi::symbols<char, storm::expressions::Expression>();
369 for (
auto const& identifierExpressionPair : identifierMapping) {
370 identifiers->add(identifierExpressionPair.first, identifierExpressionPair.second);
372 deleteIdentifierMapping =
true;
376 createExpressions =
false;
377 if (deleteIdentifierMapping) {
378 delete this->identifiers;
379 deleteIdentifierMapping =
false;
381 this->identifiers =
nullptr;
bool hasBooleanType() const
Retrieves whether the expression has a boolean return type.
This class is responsible for managing a set of typed variables and all expressions using these varia...
Expression integer(int_fast64_t value) const
Creates an expression that characterizes the given integer literal.
Expression rational(double value) const
Creates an expression that characterizes the given rational literal.
Expression boolean(bool value) const
Creates an expression that characterizes the given boolean literal.
storm::expressions::Expression getIdentifierExpression(std::string const &identifier, bool &pass) const
storm::expressions::Expression createRationalLiteralExpression(storm::RationalNumber const &value, bool &pass) const
storm::expressions::Expression createPredicateExpression(storm::expressions::OperatorType const &opTyp, std::vector< storm::expressions::Expression > const &operands, bool &pass) const
storm::expressions::Expression createIteExpression(storm::expressions::Expression const &e1, storm::expressions::Expression const &e2, storm::expressions::Expression const &e3, bool &pass) const
ExpressionCreator(storm::expressions::ExpressionManager const &manager)
void setIdentifierMapping(qi::symbols< char, storm::expressions::Expression > const *identifiers_)
Sets an identifier mapping that is used to determine valid variables in the expression.
storm::expressions::Expression createMultExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createPlusExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createEqualsExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createFloorCeilExpression(storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e1, bool &pass) const
void unsetIdentifierMapping()
Unsets a previously set identifier mapping.
storm::expressions::Expression createOrExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createIntegerLiteralExpression(int64_t value, bool &pass) const
storm::expressions::Expression createRelationalExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createRoundExpression(storm::expressions::Expression const &e1, bool &pass) const
storm::expressions::Expression createBooleanLiteralExpression(bool value, bool &pass) const
storm::expressions::Expression createUnaryExpression(std::vector< storm::expressions::OperatorType > const &operatorType, storm::expressions::Expression const &e1, bool &pass) const
storm::expressions::Expression createPowerModuloLogarithmExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createAndExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
storm::expressions::Expression createMinimumMaximumExpression(storm::expressions::Expression const &e1, storm::expressions::OperatorType const &operatorType, storm::expressions::Expression const &e2, bool &pass) const
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
Expression maximum(Expression const &first, Expression const &second)
Expression atLeastOneOf(std::vector< Expression > const &expressions)
Expression round(Expression const &first)
Expression ceil(Expression const &first)
Expression ite(Expression const &condition, Expression const &thenExpression, Expression const &elseExpression)
Expression iff(Expression const &first, Expression const &second)
Expression exactlyOneOf(std::vector< Expression > const &expressions)
Expression atMostOneOf(std::vector< Expression > const &expressions)
Expression minimum(Expression const &first, Expression const &second)
Expression floor(Expression const &first)
Expression pow(Expression const &base, Expression const &exponent, bool allowIntegerType)
The type of the resulting expression is.
Expression logarithm(Expression const &first, Expression const &second)
Expression implies(Expression const &first, Expression const &second)