Browse Source

fixed is*Expression() methods as they have not been implemented in the corresponding subclasses before.

tempestpy_adaptions
TimQu 8 years ago
parent
commit
a8b8ef27a3
  1. 6
      src/storm/storage/expressions/BinaryBooleanFunctionExpression.cpp
  2. 1
      src/storm/storage/expressions/BinaryBooleanFunctionExpression.h
  3. 6
      src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp
  4. 1
      src/storm/storage/expressions/BinaryNumericalFunctionExpression.h
  5. 6
      src/storm/storage/expressions/BinaryRelationExpression.cpp
  6. 1
      src/storm/storage/expressions/BinaryRelationExpression.h
  7. 6
      src/storm/storage/expressions/BooleanLiteralExpression.cpp
  8. 2
      src/storm/storage/expressions/BooleanLiteralExpression.h
  9. 4
      src/storm/storage/expressions/IfThenElseExpression.cpp
  10. 3
      src/storm/storage/expressions/IfThenElseExpression.h
  11. 7
      src/storm/storage/expressions/IntegerLiteralExpression.cpp
  12. 3
      src/storm/storage/expressions/IntegerLiteralExpression.h
  13. 4
      src/storm/storage/expressions/RationalLiteralExpression.cpp
  14. 1
      src/storm/storage/expressions/RationalLiteralExpression.h
  15. 6
      src/storm/storage/expressions/UnaryBooleanFunctionExpression.cpp
  16. 1
      src/storm/storage/expressions/UnaryBooleanFunctionExpression.h
  17. 6
      src/storm/storage/expressions/UnaryNumericalFunctionExpression.cpp
  18. 3
      src/storm/storage/expressions/UnaryNumericalFunctionExpression.h
  19. 6
      src/storm/storage/expressions/VariableExpression.cpp
  20. 1
      src/storm/storage/expressions/VariableExpression.h

6
src/storm/storage/expressions/BinaryBooleanFunctionExpression.cpp

@ -122,7 +122,11 @@ namespace storm {
boost::any BinaryBooleanFunctionExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool BinaryBooleanFunctionExpression::isBinaryBooleanFunctionExpression() const {
return true;
}
void BinaryBooleanFunctionExpression::printToStream(std::ostream& stream) const {
stream << "(" << *this->getFirstOperand();
switch (this->getOperatorType()) {

1
src/storm/storage/expressions/BinaryBooleanFunctionExpression.h

@ -38,6 +38,7 @@ namespace storm {
virtual bool evaluateAsBool(Valuation const* valuation = nullptr) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isBinaryBooleanFunctionExpression() const override;
/*!
* Retrieves the operator associated with the expression.

6
src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp

@ -122,7 +122,11 @@ namespace storm {
boost::any BinaryNumericalFunctionExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool BinaryNumericalFunctionExpression::isBinaryNumericalFunctionExpression() const {
return true;
}
void BinaryNumericalFunctionExpression::printToStream(std::ostream& stream) const {
stream << "(";
switch (this->getOperatorType()) {

1
src/storm/storage/expressions/BinaryNumericalFunctionExpression.h

@ -39,6 +39,7 @@ namespace storm {
virtual double evaluateAsDouble(Valuation const* valuation = nullptr) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isBinaryNumericalFunctionExpression() const override;
/*!
* Retrieves the operator associated with the expression.

6
src/storm/storage/expressions/BinaryRelationExpression.cpp

@ -85,7 +85,11 @@ namespace storm {
boost::any BinaryRelationExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool BinaryRelationExpression::isBinaryRelationExpression() const {
return true;
}
BinaryRelationExpression::RelationType BinaryRelationExpression::getRelationType() const {
return this->relationType;
}

1
src/storm/storage/expressions/BinaryRelationExpression.h

@ -38,6 +38,7 @@ namespace storm {
virtual bool evaluateAsBool(Valuation const* valuation = nullptr) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isBinaryRelationExpression() const override;
/*!
* Retrieves the relation associated with the expression.

6
src/storm/storage/expressions/BooleanLiteralExpression.cpp

@ -35,7 +35,11 @@ namespace storm {
boost::any BooleanLiteralExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool BooleanLiteralExpression::isBooleanLiteralExpression() const {
return true;
}
bool BooleanLiteralExpression::getValue() const {
return this->value;
}

2
src/storm/storage/expressions/BooleanLiteralExpression.h

@ -33,7 +33,7 @@ namespace storm {
virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isBooleanLiteralExpression() const override;
/*!
* Retrieves the value of the boolean literal.
*

4
src/storm/storage/expressions/IfThenElseExpression.cpp

@ -91,6 +91,10 @@ namespace storm {
boost::any IfThenElseExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool IfThenElseExpression::isIfThenElseExpression() const {
return true;
}
std::shared_ptr<BaseExpression const> IfThenElseExpression::getCondition() const {
return this->condition;

3
src/storm/storage/expressions/IfThenElseExpression.h

@ -39,7 +39,8 @@ namespace storm {
virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isIfThenElseExpression() const override;
/*!
* Retrieves the condition expression of the if-then-else expression.
*

7
src/storm/storage/expressions/IntegerLiteralExpression.cpp

@ -32,7 +32,12 @@ namespace storm {
boost::any IntegerLiteralExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool IntegerLiteralExpression::isIntegerLiteralExpression() const {
return true;
}
int_fast64_t IntegerLiteralExpression::getValue() const {
return this->value;
}

3
src/storm/storage/expressions/IntegerLiteralExpression.h

@ -32,7 +32,8 @@ namespace storm {
virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isIntegerLiteralExpression() const override;
/*!
* Retrieves the value of the integer literal.
*

4
src/storm/storage/expressions/RationalLiteralExpression.cpp

@ -37,6 +37,10 @@ namespace storm {
boost::any RationalLiteralExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool RationalLiteralExpression::isRationalLiteralExpression() const {
return true;
}
double RationalLiteralExpression::getValueAsDouble() const {
return storm::utility::convertNumber<double>(this->value);

1
src/storm/storage/expressions/RationalLiteralExpression.h

@ -49,6 +49,7 @@ namespace storm {
virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isRationalLiteralExpression() const override;
/*!
* Retrieves the value of the double literal.

6
src/storm/storage/expressions/UnaryBooleanFunctionExpression.cpp

@ -52,7 +52,11 @@ namespace storm {
boost::any UnaryBooleanFunctionExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool UnaryBooleanFunctionExpression::isUnaryBooleanFunctionExpression() const {
return true;
}
void UnaryBooleanFunctionExpression::printToStream(std::ostream& stream) const {
stream << "!(" << *this->getOperand() << ")";
}

1
src/storm/storage/expressions/UnaryBooleanFunctionExpression.h

@ -37,6 +37,7 @@ namespace storm {
virtual bool evaluateAsBool(Valuation const* valuation = nullptr) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isUnaryBooleanFunctionExpression() const override;
/*!
* Retrieves the operator associated with this expression.

6
src/storm/storage/expressions/UnaryNumericalFunctionExpression.cpp

@ -103,7 +103,11 @@ namespace storm {
boost::any UnaryNumericalFunctionExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool UnaryNumericalFunctionExpression::isUnaryNumericalFunctionExpression() const {
return true;
}
void UnaryNumericalFunctionExpression::printToStream(std::ostream& stream) const {
switch (this->getOperatorType()) {
case OperatorType::Minus: stream << "-("; break;

3
src/storm/storage/expressions/UnaryNumericalFunctionExpression.h

@ -38,7 +38,8 @@ namespace storm {
virtual double evaluateAsDouble(Valuation const* valuation = nullptr) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isUnaryNumericalFunctionExpression() const override;
/*!
* Retrieves the operator associated with this expression.
*

6
src/storm/storage/expressions/VariableExpression.cpp

@ -66,7 +66,11 @@ namespace storm {
boost::any VariableExpression::accept(ExpressionVisitor& visitor, boost::any const& data) const {
return visitor.visit(*this, data);
}
bool VariableExpression::isVariableExpression() const {
return true;
}
void VariableExpression::printToStream(std::ostream& stream) const {
stream << this->getVariableName();
}

1
src/storm/storage/expressions/VariableExpression.h

@ -36,6 +36,7 @@ namespace storm {
virtual void gatherVariables(std::set<storm::expressions::Variable>& variables) const override;
virtual std::shared_ptr<BaseExpression const> simplify() const override;
virtual boost::any accept(ExpressionVisitor& visitor, boost::any const& data) const override;
virtual bool isVariableExpression() const override;
/*!
* Retrieves the name of the variable associated with this expression.

Loading…
Cancel
Save