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) {
248 auto const min = storm::utility::convertNumber<storm::RationalNumber>(std::numeric_limits<int64_t>::min());
249 auto const max = storm::utility::convertNumber<storm::RationalNumber>(std::numeric_limits<int64_t>::max());
250 overflow = value < min || value > max;
253 << value <<
"' as a 64 bit integer. Consider appending '.0' to the number to parse it as an (arbitrary precision) float.");
256 }
else if (this->createExpressions) {
257 return manager.
integer(storm::utility::convertNumber<int64_t>(value));
264 if (this->createExpressions) {
274 if (this->createExpressions) {
276 switch (operatorType) {
287 }
catch (storm::exceptions::InvalidTypeException
const& e) {
296 if (this->createExpressions) {
298 switch (operatorType) {
309 }
catch (storm::exceptions::InvalidTypeException
const& e) {
317 if (this->createExpressions) {
320 }
catch (storm::exceptions::InvalidTypeException
const& e) {
328 std::vector<storm::expressions::Expression>
const& operands,
bool& pass)
const {
329 if (this->createExpressions) {
339 STORM_LOG_THROW(
false, storm::exceptions::InvalidTypeException,
"Operator type " << opTyp <<
" invalid for predicate expression.");
341 }
catch (storm::exceptions::InvalidTypeException
const& e) {
349 if (this->createExpressions) {
350 STORM_LOG_THROW(this->identifiers !=
nullptr, storm::exceptions::WrongFormatException,
351 "Unable to substitute identifier expressions without given mapping.");
353 if (expression ==
nullptr) {
364 if (identifiers_ !=
nullptr) {
365 createExpressions =
true;
366 identifiers = identifiers_;
368 createExpressions =
false;
369 identifiers =
nullptr;
376 createExpressions =
true;
377 identifiers =
new qi::symbols<char, storm::expressions::Expression>();
378 for (
auto const& identifierExpressionPair : identifierMapping) {
379 identifiers->add(identifierExpressionPair.first, identifierExpressionPair.second);
381 deleteIdentifierMapping =
true;
385 createExpressions =
false;
386 if (deleteIdentifierMapping) {
387 delete this->identifiers;
388 deleteIdentifierMapping =
false;
390 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 createIntegerLiteralExpression(storm::RationalNumber const &value, bool &pass, bool &overflow) const
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 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_ERROR(message)
#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)
bool isInteger(ValueType const &number)