20 if (deleteIdentifierMapping) {
21 delete this->identifiers;
27 if (this->createExpressions) {
30 }
catch (storm::exceptions::InvalidTypeException
const&) {
34 return manager.boolean(
false);
40 if (this->createExpressions) {
42 switch (operatorType) {
53 }
catch (storm::exceptions::InvalidTypeException
const&) {
57 return manager.boolean(
false);
63 if (this->createExpressions) {
66 switch (operatorType) {
74 }
catch (storm::exceptions::InvalidTypeException
const&) {
79 return manager.boolean(
false);
85 if (this->createExpressions) {
87 switch (operatorType) {
104 }
catch (storm::exceptions::InvalidTypeException
const&) {
108 return manager.boolean(
false);
114 if (this->createExpressions) {
116 switch (operatorType) {
127 }
catch (storm::exceptions::InvalidTypeException
const&) {
131 return manager.boolean(
false);
137 if (this->createExpressions) {
139 switch (operatorType) {
150 }
catch (storm::exceptions::InvalidTypeException
const&) {
154 return manager.boolean(
false);
160 if (this->createExpressions) {
162 switch (operatorType) {
173 }
catch (storm::exceptions::InvalidTypeException
const&) {
177 return manager.boolean(
false);
183 if (this->createExpressions) {
185 switch (operatorType) {
199 }
catch (storm::exceptions::InvalidTypeException
const&) {
203 return manager.boolean(
false);
208 if (this->createExpressions) {
211 for (
auto const& op : operatorTypes) {
225 }
catch (storm::exceptions::InvalidTypeException
const&) {
229 return manager.boolean(
false);
234 if (!this->acceptDoubleLiterals) {
238 if (this->createExpressions) {
239 return manager.rational(value);
241 return manager.boolean(
false);
249 overflow = value < min || value > max;
252 << value <<
"' as a 64 bit integer. Consider appending '.0' to the number to parse it as an (arbitrary precision) float.");
254 return manager.boolean(
false);
255 }
else if (this->createExpressions) {
258 return manager.boolean(
false);
263 if (this->createExpressions) {
264 return manager.boolean(value);
266 return manager.boolean(
false);
273 if (this->createExpressions) {
275 switch (operatorType) {
286 }
catch (storm::exceptions::InvalidTypeException
const&) {
290 return manager.boolean(
false);
295 if (this->createExpressions) {
297 switch (operatorType) {
308 }
catch (storm::exceptions::InvalidTypeException
const&) {
312 return manager.boolean(
false);
316 if (this->createExpressions) {
319 }
catch (storm::exceptions::InvalidTypeException
const&) {
323 return manager.boolean(
false);
327 std::vector<storm::expressions::Expression>
const& operands,
bool& pass)
const {
328 if (this->createExpressions) {
338 STORM_LOG_THROW(
false, storm::exceptions::InvalidTypeException,
"Operator type " << opTyp <<
" invalid for predicate expression.");
340 }
catch (storm::exceptions::InvalidTypeException
const&) {
344 return manager.boolean(
false);
348 if (this->createExpressions) {
349 STORM_LOG_THROW(this->identifiers !=
nullptr, storm::exceptions::WrongFormatException,
350 "Unable to substitute identifier expressions without given mapping.");
352 if (expression ==
nullptr) {
354 return manager.boolean(
false);
358 return manager.boolean(
false);
363 if (identifiers_ !=
nullptr) {
364 createExpressions =
true;
365 identifiers = identifiers_;
367 createExpressions =
false;
368 identifiers =
nullptr;
375 createExpressions =
true;
376 identifiers =
new qi::symbols<char, storm::expressions::Expression>();
377 for (
auto const& identifierExpressionPair : identifierMapping) {
378 identifiers->add(identifierExpressionPair.first, identifierExpressionPair.second);
380 deleteIdentifierMapping =
true;
384 createExpressions =
false;
385 if (deleteIdentifierMapping) {
386 delete this->identifiers;
387 deleteIdentifierMapping =
false;
389 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...
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 pow(Expression const &base, Expression const &exponent, bool allowIntegerType)
The type of the resulting expression is.
Expression minimum(Expression const &first, Expression const &second)
Expression floor(Expression const &first)
Expression logarithm(Expression const &first, Expression const &second)
Expression implies(Expression const &first, Expression const &second)
Contains all file parsers and helper classes.
bool isInteger(ValueType const &number)
TargetType convertNumber(SourceType const &number)