20 if (deleteIdentifierMapping) {
21 delete this->identifiers;
27 if (this->createExpressions) {
36 return manager.boolean(
false);
42 if (this->createExpressions) {
44 switch (operatorType) {
57 return manager.boolean(
false);
63 if (this->createExpressions) {
65 switch (operatorType) {
76 return manager.boolean(
false);
82 if (this->createExpressions) {
84 switch (operatorType) {
97 }
catch (storm::exceptions::InvalidTypeException
const&) {
101 return manager.boolean(
false);
107 if (this->createExpressions) {
109 switch (operatorType) {
118 }
catch (storm::exceptions::InvalidTypeException
const&) {
122 return manager.boolean(
false);
128 if (this->createExpressions) {
130 switch (operatorType) {
139 }
catch (storm::exceptions::InvalidTypeException
const&) {
143 return manager.boolean(
false);
149 if (this->createExpressions) {
151 switch (operatorType) {
160 }
catch (storm::exceptions::InvalidTypeException
const&) {
164 return manager.boolean(
false);
170 if (this->createExpressions) {
172 switch (operatorType) {
183 }
catch (storm::exceptions::InvalidTypeException
const&) {
187 return manager.boolean(
false);
192 if (this->createExpressions) {
195 for (
auto const& op : operatorTypes) {
209 }
catch (storm::exceptions::InvalidTypeException
const&) {
213 return manager.boolean(
false);
218 if (!this->acceptDoubleLiterals) {
222 if (this->createExpressions) {
223 return manager.rational(value);
225 return manager.boolean(
false);
233 overflow = value < min || value > max;
236 << value <<
"' as a 64 bit integer. Consider appending '.0' to the number to parse it as an (arbitrary precision) float.");
238 return manager.boolean(
false);
239 }
else if (this->createExpressions) {
242 return manager.boolean(
false);
247 if (this->createExpressions) {
248 return manager.boolean(value);
250 return manager.boolean(
false);
257 if (this->createExpressions) {
259 switch (operatorType) {
268 }
catch (storm::exceptions::InvalidTypeException
const&) {
272 return manager.boolean(
false);
277 if (this->createExpressions) {
279 switch (operatorType) {
288 }
catch (storm::exceptions::InvalidTypeException
const&) {
292 return manager.boolean(
false);
296 if (this->createExpressions) {
299 }
catch (storm::exceptions::InvalidTypeException
const&) {
303 return manager.boolean(
false);
307 std::vector<storm::expressions::Expression>
const& operands,
bool& pass)
const {
308 if (this->createExpressions) {
318 STORM_LOG_THROW(
false, storm::exceptions::InvalidTypeException,
"Operator type " << opTyp <<
" invalid for predicate expression.");
320 }
catch (storm::exceptions::InvalidTypeException
const&) {
324 return manager.boolean(
false);
328 if (this->createExpressions) {
329 STORM_LOG_THROW(this->identifiers !=
nullptr, storm::exceptions::WrongFormatException,
330 "Unable to substitute identifier expressions without given mapping.");
332 if (expression ==
nullptr) {
334 return manager.boolean(
false);
338 return manager.boolean(
false);
343 if (identifiers_ !=
nullptr) {
344 createExpressions =
true;
345 identifiers = identifiers_;
347 createExpressions =
false;
348 identifiers =
nullptr;
355 createExpressions =
true;
356 identifiers =
new qi::symbols<char, storm::expressions::Expression>();
357 for (
auto const& identifierExpressionPair : identifierMapping) {
358 identifiers->add(identifierExpressionPair.first, identifierExpressionPair.second);
360 deleteIdentifierMapping =
true;
364 createExpressions =
false;
365 if (deleteIdentifierMapping) {
366 delete this->identifiers;
367 deleteIdentifierMapping =
false;
369 this->identifiers =
nullptr;
bool hasBooleanType() const
Retrieves whether the expression has a boolean return type.
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...
bool isNumericalType() const
Checks whether this type is a numerical type.
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)