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
ec9486e8cf
  1. 4
      src/storm/storage/expressions/BinaryBooleanFunctionExpression.cpp
  2. 1
      src/storm/storage/expressions/BinaryBooleanFunctionExpression.h
  3. 4
      src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp
  4. 1
      src/storm/storage/expressions/BinaryNumericalFunctionExpression.h
  5. 4
      src/storm/storage/expressions/BinaryRelationExpression.cpp
  6. 1
      src/storm/storage/expressions/BinaryRelationExpression.h
  7. 4
      src/storm/storage/expressions/BooleanLiteralExpression.cpp
  8. 2
      src/storm/storage/expressions/BooleanLiteralExpression.h
  9. 4
      src/storm/storage/expressions/IfThenElseExpression.cpp
  10. 1
      src/storm/storage/expressions/IfThenElseExpression.h
  11. 5
      src/storm/storage/expressions/IntegerLiteralExpression.cpp
  12. 1
      src/storm/storage/expressions/IntegerLiteralExpression.h
  13. 4
      src/storm/storage/expressions/RationalLiteralExpression.cpp
  14. 1
      src/storm/storage/expressions/RationalLiteralExpression.h
  15. 4
      src/storm/storage/expressions/UnaryBooleanFunctionExpression.cpp
  16. 1
      src/storm/storage/expressions/UnaryBooleanFunctionExpression.h
  17. 4
      src/storm/storage/expressions/UnaryNumericalFunctionExpression.cpp
  18. 1
      src/storm/storage/expressions/UnaryNumericalFunctionExpression.h
  19. 4
      src/storm/storage/expressions/VariableExpression.cpp
  20. 1
      src/storm/storage/expressions/VariableExpression.h

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

@ -123,6 +123,10 @@ namespace storm {
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.

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

@ -123,6 +123,10 @@ namespace storm {
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.

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

@ -86,6 +86,10 @@ namespace storm {
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.

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

@ -36,6 +36,10 @@ namespace storm {
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

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

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

@ -39,6 +39,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 isIfThenElseExpression() const override;
/*!
* Retrieves the condition expression of the if-then-else expression.

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

@ -33,6 +33,11 @@ namespace storm {
return visitor.visit(*this, data);
}
bool IntegerLiteralExpression::isIntegerLiteralExpression() const {
return true;
}
int_fast64_t IntegerLiteralExpression::getValue() const {
return this->value;
}

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

@ -32,6 +32,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 isIntegerLiteralExpression() const override;
/*!
* Retrieves the value of the integer literal.

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

@ -38,6 +38,10 @@ namespace storm {
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.

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

@ -53,6 +53,10 @@ namespace storm {
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.

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

@ -104,6 +104,10 @@ namespace storm {
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;

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

@ -38,6 +38,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 isUnaryNumericalFunctionExpression() const override;
/*!
* Retrieves the operator associated with this expression.

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

@ -67,6 +67,10 @@ namespace storm {
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