From 9505f553dd603681d288393906cac4b247a1be8a Mon Sep 17 00:00:00 2001 From: dehnert Date: Mon, 10 Jun 2013 23:28:49 +0200 Subject: [PATCH] Added copy-constructors for all IR classes. TODO: make tests run again... --- src/ir/expressions/BaseExpression.cpp | 4 ++++ src/ir/expressions/BinaryBooleanFunctionExpression.cpp | 5 +++++ src/ir/expressions/BinaryBooleanFunctionExpression.h | 7 +++++++ src/ir/expressions/BinaryExpression.cpp | 4 ++++ src/ir/expressions/BinaryExpression.h | 7 +++++++ src/ir/expressions/BinaryNumericalFunctionExpression.cpp | 5 +++++ src/ir/expressions/BinaryNumericalFunctionExpression.h | 7 +++++++ src/ir/expressions/BinaryRelationExpression.cpp | 7 ++++++- src/ir/expressions/BinaryRelationExpression.h | 7 +++++++ src/ir/expressions/BooleanConstantExpression.cpp | 6 ++++++ src/ir/expressions/BooleanConstantExpression.h | 7 +++++++ src/ir/expressions/BooleanLiteralExpression.cpp | 5 +++++ src/ir/expressions/BooleanLiteralExpression.h | 7 +++++++ src/ir/expressions/ConstantExpression.cpp | 2 +- src/ir/expressions/ConstantExpression.h | 4 ++-- src/ir/expressions/DoubleConstantExpression.cpp | 5 +++++ src/ir/expressions/DoubleConstantExpression.h | 7 +++++++ src/ir/expressions/DoubleLiteralExpression.cpp | 5 +++++ src/ir/expressions/DoubleLiteralExpression.h | 7 +++++++ src/ir/expressions/IntegerConstantExpression.cpp | 5 +++++ src/ir/expressions/IntegerConstantExpression.h | 7 +++++++ src/ir/expressions/IntegerLiteralExpression.cpp | 5 +++++ src/ir/expressions/IntegerLiteralExpression.h | 7 +++++++ src/ir/expressions/UnaryBooleanFunctionExpression.cpp | 4 ++++ src/ir/expressions/UnaryBooleanFunctionExpression.h | 7 +++++++ src/ir/expressions/UnaryExpression.cpp | 4 ++++ src/ir/expressions/UnaryExpression.h | 7 +++++++ src/ir/expressions/UnaryNumericalFunctionExpression.cpp | 4 ++++ src/ir/expressions/UnaryNumericalFunctionExpression.h | 7 +++++++ src/ir/expressions/VariableExpression.cpp | 4 ++++ src/ir/expressions/VariableExpression.h | 7 +++++++ 31 files changed, 172 insertions(+), 4 deletions(-) diff --git a/src/ir/expressions/BaseExpression.cpp b/src/ir/expressions/BaseExpression.cpp index 7ffc6ee9f..18b70d392 100644 --- a/src/ir/expressions/BaseExpression.cpp +++ b/src/ir/expressions/BaseExpression.cpp @@ -18,6 +18,10 @@ namespace storm { // Nothing to do here. } + BaseExpression::BaseExpression(BaseExpression const& baseExpression) : type(baseExpression.type) { + // Nothing to do here. + } + BaseExpression::~BaseExpression() { // Nothing to do here. } diff --git a/src/ir/expressions/BinaryBooleanFunctionExpression.cpp b/src/ir/expressions/BinaryBooleanFunctionExpression.cpp index d5c67ed4e..acfc392fd 100644 --- a/src/ir/expressions/BinaryBooleanFunctionExpression.cpp +++ b/src/ir/expressions/BinaryBooleanFunctionExpression.cpp @@ -18,6 +18,11 @@ namespace storm { // Nothing to do here. } + BinaryBooleanFunctionExpression::BinaryBooleanFunctionExpression(BinaryBooleanFunctionExpression const& binaryBooleanFunctionExpression) + : BinaryExpression(binaryBooleanFunctionExpression), functionType(binaryBooleanFunctionExpression.functionType) { + // Nothing to do here. + } + std::shared_ptr BinaryBooleanFunctionExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new BinaryBooleanFunctionExpression(this->getLeft()->clone(renaming, variableState), this->getRight()->clone(renaming, variableState), this->functionType)); } diff --git a/src/ir/expressions/BinaryBooleanFunctionExpression.h b/src/ir/expressions/BinaryBooleanFunctionExpression.h index f8a3313df..1b40cd25b 100644 --- a/src/ir/expressions/BinaryBooleanFunctionExpression.h +++ b/src/ir/expressions/BinaryBooleanFunctionExpression.h @@ -33,6 +33,13 @@ namespace storm { */ BinaryBooleanFunctionExpression(std::shared_ptr const& left, std::shared_ptr const& right, FunctionType functionType); + /*! + * Copy-constructs from the given expression. + * + * @param binaryBooleanFunctionExpression The expression to copy. + */ + BinaryBooleanFunctionExpression(BinaryBooleanFunctionExpression const& binaryBooleanFunctionExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual bool getValueAsBool(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/BinaryExpression.cpp b/src/ir/expressions/BinaryExpression.cpp index 4008c9de8..10c623757 100644 --- a/src/ir/expressions/BinaryExpression.cpp +++ b/src/ir/expressions/BinaryExpression.cpp @@ -16,6 +16,10 @@ namespace storm { // Nothing to do here. } + BinaryExpression::BinaryExpression(BinaryExpression const& binaryExpression) : BaseExpression(binaryExpression.getType()), left(binaryExpression.left), right(binaryExpression.right) { + // Nothing to do here. + } + std::shared_ptr const& BinaryExpression::getLeft() const { return left; } diff --git a/src/ir/expressions/BinaryExpression.h b/src/ir/expressions/BinaryExpression.h index 85b0d18e4..655d597b6 100644 --- a/src/ir/expressions/BinaryExpression.h +++ b/src/ir/expressions/BinaryExpression.h @@ -27,6 +27,13 @@ namespace storm { */ BinaryExpression(ReturnType type, std::shared_ptr const& left, std::shared_ptr const& right); + /*! + * Copy-constructs from the given expression. + * + * @param binaryExpression The expression to copy. + */ + BinaryExpression(BinaryExpression const& binaryExpression); + /*! * Retrieves the left child of the expression node. * diff --git a/src/ir/expressions/BinaryNumericalFunctionExpression.cpp b/src/ir/expressions/BinaryNumericalFunctionExpression.cpp index 16765428f..920c72126 100644 --- a/src/ir/expressions/BinaryNumericalFunctionExpression.cpp +++ b/src/ir/expressions/BinaryNumericalFunctionExpression.cpp @@ -18,6 +18,11 @@ namespace storm { // Nothing to do here. } + BinaryNumericalFunctionExpression::BinaryNumericalFunctionExpression(BinaryNumericalFunctionExpression const& binaryNumericalFunctionExpression) + : BinaryExpression(binaryNumericalFunctionExpression), functionType(binaryNumericalFunctionExpression.functionType) { + // Nothing to do here. + } + std::shared_ptr BinaryNumericalFunctionExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new BinaryNumericalFunctionExpression(this->getType(), this->getLeft()->clone(renaming, variableState), this->getRight()->clone(renaming, variableState), this->functionType)); } diff --git a/src/ir/expressions/BinaryNumericalFunctionExpression.h b/src/ir/expressions/BinaryNumericalFunctionExpression.h index e1b62b346..34cfd4772 100644 --- a/src/ir/expressions/BinaryNumericalFunctionExpression.h +++ b/src/ir/expressions/BinaryNumericalFunctionExpression.h @@ -34,6 +34,13 @@ namespace storm { */ BinaryNumericalFunctionExpression(ReturnType type, std::shared_ptr const& left, std::shared_ptr const& right, FunctionType functionType); + /*! + * Copy-constructs from the given expression. + * + * @param binaryNumericalFunctionExpression The expression to copy. + */ + BinaryNumericalFunctionExpression(BinaryNumericalFunctionExpression const& binaryNumericalFunctionExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; /*! diff --git a/src/ir/expressions/BinaryRelationExpression.cpp b/src/ir/expressions/BinaryRelationExpression.cpp index c5aa0fe34..bdd5cf596 100644 --- a/src/ir/expressions/BinaryRelationExpression.cpp +++ b/src/ir/expressions/BinaryRelationExpression.cpp @@ -15,7 +15,12 @@ namespace storm { BinaryRelationExpression::BinaryRelationExpression(std::shared_ptr const& left, std::shared_ptr const& right, RelationType relationType) : BinaryExpression(bool_, left, right), relationType(relationType) { - // Nothing to do here + // Nothing to do here. + } + + BinaryRelationExpression::BinaryRelationExpression(BinaryRelationExpression const& binaryRelationExpression) + : BinaryExpression(binaryRelationExpression), relationType(binaryRelationExpression.relationType) { + // Nothing to do here. } std::shared_ptr BinaryRelationExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { diff --git a/src/ir/expressions/BinaryRelationExpression.h b/src/ir/expressions/BinaryRelationExpression.h index d2e07f437..1f0479eae 100644 --- a/src/ir/expressions/BinaryRelationExpression.h +++ b/src/ir/expressions/BinaryRelationExpression.h @@ -33,6 +33,13 @@ namespace storm { */ BinaryRelationExpression(std::shared_ptr const& left, std::shared_ptr const& right, RelationType relationType); + /*! + * Copy-constructs from the given expression. + * + * @param binaryRelationExpression The expression to copy. + */ + BinaryRelationExpression(BinaryRelationExpression const& binaryRelationExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual bool getValueAsBool(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/BooleanConstantExpression.cpp b/src/ir/expressions/BooleanConstantExpression.cpp index 24d22b7db..65859db50 100644 --- a/src/ir/expressions/BooleanConstantExpression.cpp +++ b/src/ir/expressions/BooleanConstantExpression.cpp @@ -17,6 +17,12 @@ namespace storm { // Nothing to do here. } + BooleanConstantExpression::BooleanConstantExpression(BooleanConstantExpression const& booleanConstantExpression) + : ConstantExpression(booleanConstantExpression), value(booleanConstantExpression.value), defined(booleanConstantExpression.defined) { + // Nothing to do here. + } + + std::shared_ptr BooleanConstantExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new BooleanConstantExpression(*this)); } diff --git a/src/ir/expressions/BooleanConstantExpression.h b/src/ir/expressions/BooleanConstantExpression.h index c72ad34cb..14736b51c 100644 --- a/src/ir/expressions/BooleanConstantExpression.h +++ b/src/ir/expressions/BooleanConstantExpression.h @@ -26,6 +26,13 @@ namespace storm { */ BooleanConstantExpression(std::string const& constantName); + /*! + * Copy-constructs from the given expression. + * + * @param booleanConstantExpression The expression to copy. + */ + BooleanConstantExpression(BooleanConstantExpression const& booleanConstantExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual bool getValueAsBool(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/BooleanLiteralExpression.cpp b/src/ir/expressions/BooleanLiteralExpression.cpp index c984e803f..ca01f4f7e 100644 --- a/src/ir/expressions/BooleanLiteralExpression.cpp +++ b/src/ir/expressions/BooleanLiteralExpression.cpp @@ -15,6 +15,11 @@ namespace storm { // Nothing to do here. } + BooleanLiteralExpression::BooleanLiteralExpression(BooleanLiteralExpression const& booleanLiteralExpression) + : BaseExpression(booleanLiteralExpression), value(booleanLiteralExpression.value) { + // Nothing to do here. + } + std::shared_ptr BooleanLiteralExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new BooleanLiteralExpression(this->value)); } diff --git a/src/ir/expressions/BooleanLiteralExpression.h b/src/ir/expressions/BooleanLiteralExpression.h index 5ce5a180e..6c7d989f4 100644 --- a/src/ir/expressions/BooleanLiteralExpression.h +++ b/src/ir/expressions/BooleanLiteralExpression.h @@ -26,6 +26,13 @@ namespace storm { */ BooleanLiteralExpression(bool value); + /*! + * Copy-constructs from the given expression. + * + * @param booleanLiteralExpression The expression to copy. + */ + BooleanLiteralExpression(BooleanLiteralExpression const& booleanLiteralExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual bool getValueAsBool(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/ConstantExpression.cpp b/src/ir/expressions/ConstantExpression.cpp index 95784b7eb..1eda8a9ab 100644 --- a/src/ir/expressions/ConstantExpression.cpp +++ b/src/ir/expressions/ConstantExpression.cpp @@ -15,7 +15,7 @@ namespace storm { // Nothing to do here. } - ConstantExpression::ConstantExpression(ConstantExpression const& constantExpression) : BaseExpression(constantExpression.getType()), constantName(constantExpression.constantName) { + ConstantExpression::ConstantExpression(ConstantExpression const& constantExpression) : BaseExpression(constantExpression), constantName(constantExpression.constantName) { // Nothing to do here } diff --git a/src/ir/expressions/ConstantExpression.h b/src/ir/expressions/ConstantExpression.h index 24f82db32..968d757bf 100644 --- a/src/ir/expressions/ConstantExpression.h +++ b/src/ir/expressions/ConstantExpression.h @@ -29,9 +29,9 @@ namespace storm { ConstantExpression(ReturnType type, std::string const& constantName); /*! - * Copy-constructs a constant expression from the given constant expression. + * Copy-constructs from the given expression. * - * @param constantExpression The constant expression to copy. + * @param constantExpression The expression to copy. */ ConstantExpression(ConstantExpression const& constantExpression); diff --git a/src/ir/expressions/DoubleConstantExpression.cpp b/src/ir/expressions/DoubleConstantExpression.cpp index 85ac47f78..d7482d31b 100644 --- a/src/ir/expressions/DoubleConstantExpression.cpp +++ b/src/ir/expressions/DoubleConstantExpression.cpp @@ -17,6 +17,11 @@ namespace storm { // Nothing to do here. } + DoubleConstantExpression::DoubleConstantExpression(DoubleConstantExpression const& doubleConstantExpression) + : ConstantExpression(doubleConstantExpression), value(doubleConstantExpression.value), defined(doubleConstantExpression.defined) { + // Nothing to do here. + } + std::shared_ptr DoubleConstantExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new DoubleConstantExpression(*this)); } diff --git a/src/ir/expressions/DoubleConstantExpression.h b/src/ir/expressions/DoubleConstantExpression.h index 6a996ff45..fb8e07977 100644 --- a/src/ir/expressions/DoubleConstantExpression.h +++ b/src/ir/expressions/DoubleConstantExpression.h @@ -26,6 +26,13 @@ namespace storm { */ DoubleConstantExpression(std::string const& constantName); + /*! + * Copy-constructs from the given expression. + * + * @param doubleConstantExpression The expression to copy. + */ + DoubleConstantExpression(DoubleConstantExpression const& doubleConstantExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual double getValueAsDouble(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/DoubleLiteralExpression.cpp b/src/ir/expressions/DoubleLiteralExpression.cpp index 9508767ff..954af88d2 100644 --- a/src/ir/expressions/DoubleLiteralExpression.cpp +++ b/src/ir/expressions/DoubleLiteralExpression.cpp @@ -17,6 +17,11 @@ namespace storm { // Nothing to do here. } + DoubleLiteralExpression::DoubleLiteralExpression(DoubleLiteralExpression const& doubleLiteralExpression) + : BaseExpression(doubleLiteralExpression), value(doubleLiteralExpression.value) { + // Nothing to do here. + } + std::shared_ptr DoubleLiteralExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new DoubleLiteralExpression(this->value)); } diff --git a/src/ir/expressions/DoubleLiteralExpression.h b/src/ir/expressions/DoubleLiteralExpression.h index fd020485a..f2ff55c19 100644 --- a/src/ir/expressions/DoubleLiteralExpression.h +++ b/src/ir/expressions/DoubleLiteralExpression.h @@ -26,6 +26,13 @@ namespace storm { */ DoubleLiteralExpression(double value); + /*! + * Copy-constructs from the given expression. + * + * @param doubleLiteralExpression The expression to copy. + */ + DoubleLiteralExpression(DoubleLiteralExpression const& doubleLiteralExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual double getValueAsDouble(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/IntegerConstantExpression.cpp b/src/ir/expressions/IntegerConstantExpression.cpp index cabb2e45b..29cc3f1eb 100644 --- a/src/ir/expressions/IntegerConstantExpression.cpp +++ b/src/ir/expressions/IntegerConstantExpression.cpp @@ -17,6 +17,11 @@ namespace storm { // Nothing to do here. } + IntegerConstantExpression::IntegerConstantExpression(IntegerConstantExpression const& integerConstantExpression) + : ConstantExpression(integerConstantExpression), value(integerConstantExpression.value), defined(integerConstantExpression.defined) { + // Nothing to do here. + } + std::shared_ptr IntegerConstantExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new IntegerConstantExpression(*this)); } diff --git a/src/ir/expressions/IntegerConstantExpression.h b/src/ir/expressions/IntegerConstantExpression.h index 80676f246..dd77cce2a 100644 --- a/src/ir/expressions/IntegerConstantExpression.h +++ b/src/ir/expressions/IntegerConstantExpression.h @@ -26,6 +26,13 @@ namespace storm { */ IntegerConstantExpression(std::string const& constantName); + /*! + * Copy-constructs from the given expression. + * + * @param integerConstantExpression The expression to copy. + */ + IntegerConstantExpression(IntegerConstantExpression const& integerConstantExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual int_fast64_t getValueAsInt(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/IntegerLiteralExpression.cpp b/src/ir/expressions/IntegerLiteralExpression.cpp index 24c4bed21..8cb799376 100644 --- a/src/ir/expressions/IntegerLiteralExpression.cpp +++ b/src/ir/expressions/IntegerLiteralExpression.cpp @@ -17,6 +17,11 @@ namespace storm { // Nothing to do here. } + IntegerLiteralExpression::IntegerLiteralExpression(IntegerLiteralExpression const& integerLiteralExpression) + : BaseExpression(integerLiteralExpression), value(integerLiteralExpression.value) { + // Nothing to do here. + } + std::shared_ptr IntegerLiteralExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new IntegerLiteralExpression(this->value)); } diff --git a/src/ir/expressions/IntegerLiteralExpression.h b/src/ir/expressions/IntegerLiteralExpression.h index c824ef022..488456a3c 100644 --- a/src/ir/expressions/IntegerLiteralExpression.h +++ b/src/ir/expressions/IntegerLiteralExpression.h @@ -26,6 +26,13 @@ namespace storm { */ IntegerLiteralExpression(int_fast64_t value); + /*! + * Copy-constructs from the given expression. + * + * @param integerLiteralExpression The expression to copy. + */ + IntegerLiteralExpression(IntegerLiteralExpression const& integerLiteralExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual int_fast64_t getValueAsInt(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/UnaryBooleanFunctionExpression.cpp b/src/ir/expressions/UnaryBooleanFunctionExpression.cpp index 1558e7500..c3d57238a 100644 --- a/src/ir/expressions/UnaryBooleanFunctionExpression.cpp +++ b/src/ir/expressions/UnaryBooleanFunctionExpression.cpp @@ -17,6 +17,10 @@ namespace storm { // Nothing to do here. } + UnaryBooleanFunctionExpression::UnaryBooleanFunctionExpression(UnaryBooleanFunctionExpression const& unaryBooleanFunctionExpression) : UnaryExpression(unaryBooleanFunctionExpression), functionType(unaryBooleanFunctionExpression.functionType) { + // Nothing to do here. + } + std::shared_ptr UnaryBooleanFunctionExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new UnaryBooleanFunctionExpression(this->getChild()->clone(renaming, variableState), this->functionType)); } diff --git a/src/ir/expressions/UnaryBooleanFunctionExpression.h b/src/ir/expressions/UnaryBooleanFunctionExpression.h index a59658040..36e8dcafd 100644 --- a/src/ir/expressions/UnaryBooleanFunctionExpression.h +++ b/src/ir/expressions/UnaryBooleanFunctionExpression.h @@ -32,6 +32,13 @@ namespace storm { */ UnaryBooleanFunctionExpression(std::shared_ptr child, FunctionType functionType); + /*! + * Copy-constructs from the given expression. + * + * @param unaryBooleanFunctionExpression The expression to copy. + */ + UnaryBooleanFunctionExpression(UnaryBooleanFunctionExpression const& unaryBooleanFunctionExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; /*! diff --git a/src/ir/expressions/UnaryExpression.cpp b/src/ir/expressions/UnaryExpression.cpp index 0198cf295..c49227cd6 100644 --- a/src/ir/expressions/UnaryExpression.cpp +++ b/src/ir/expressions/UnaryExpression.cpp @@ -15,6 +15,10 @@ namespace storm { // Nothing to do here. } + UnaryExpression::UnaryExpression(UnaryExpression const& unaryExpression) : BaseExpression(unaryExpression), child(unaryExpression.child) { + // Nothing to do here. + } + std::shared_ptr const& UnaryExpression::getChild() const { return child; } diff --git a/src/ir/expressions/UnaryExpression.h b/src/ir/expressions/UnaryExpression.h index 492c43faf..e33d48568 100644 --- a/src/ir/expressions/UnaryExpression.h +++ b/src/ir/expressions/UnaryExpression.h @@ -26,6 +26,13 @@ namespace storm { */ UnaryExpression(ReturnType type, std::shared_ptr child); + /*! + * Copy-constructs from the given expression. + * + * @param unaryExpression The expression to copy. + */ + UnaryExpression(UnaryExpression const& unaryExpression); + /*! * Retrieves the child of the expression node. * diff --git a/src/ir/expressions/UnaryNumericalFunctionExpression.cpp b/src/ir/expressions/UnaryNumericalFunctionExpression.cpp index 943e7f89b..6aa0f380b 100644 --- a/src/ir/expressions/UnaryNumericalFunctionExpression.cpp +++ b/src/ir/expressions/UnaryNumericalFunctionExpression.cpp @@ -15,6 +15,10 @@ namespace storm { // Nothing to do here. } + UnaryNumericalFunctionExpression::UnaryNumericalFunctionExpression(UnaryNumericalFunctionExpression const& unaryNumericalFunctionExpression) : UnaryExpression(unaryNumericalFunctionExpression), functionType(unaryNumericalFunctionExpression.functionType) { + // Nothing to do here. + } + std::shared_ptr UnaryNumericalFunctionExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { return std::shared_ptr(new UnaryNumericalFunctionExpression(this->getType(), this->getChild()->clone(renaming, variableState), this->functionType)); } diff --git a/src/ir/expressions/UnaryNumericalFunctionExpression.h b/src/ir/expressions/UnaryNumericalFunctionExpression.h index b5fda8e59..59c94c7d0 100644 --- a/src/ir/expressions/UnaryNumericalFunctionExpression.h +++ b/src/ir/expressions/UnaryNumericalFunctionExpression.h @@ -32,6 +32,13 @@ namespace storm { */ UnaryNumericalFunctionExpression(ReturnType type, std::shared_ptr child, FunctionType functionType); + /*! + * Copy-constructs from the given expression. + * + * @param unaryNumericalFunctionExpression The expression to copy. + */ + UnaryNumericalFunctionExpression(UnaryNumericalFunctionExpression const& unaryNumericalFunctionExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual int_fast64_t getValueAsInt(std::pair, std::vector> const* variableValues) const override; diff --git a/src/ir/expressions/VariableExpression.cpp b/src/ir/expressions/VariableExpression.cpp index 245c9f50d..5bf0884fb 100644 --- a/src/ir/expressions/VariableExpression.cpp +++ b/src/ir/expressions/VariableExpression.cpp @@ -22,6 +22,10 @@ namespace storm { // Nothing to do here. } + VariableExpression::VariableExpression(VariableExpression const& variableExpression) : BaseExpression(variableExpression), globalIndex(variableExpression.globalIndex), variableName(variableExpression.variableName) { + // Nothing to do here. + } + std::shared_ptr VariableExpression::clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const { // Perform the proper cloning. auto renamingPair = renaming.find(this->variableName); diff --git a/src/ir/expressions/VariableExpression.h b/src/ir/expressions/VariableExpression.h index 9a8d47172..a66dbb573 100644 --- a/src/ir/expressions/VariableExpression.h +++ b/src/ir/expressions/VariableExpression.h @@ -45,6 +45,13 @@ namespace storm { */ VariableExpression(ReturnType type, uint_fast64_t globalIndex, std::string const& variableName); + /*! + * Copy-constructs from the given expression. + * + * @param variableExpression The expression to copy. + */ + VariableExpression(VariableExpression const& variableExpression); + virtual std::shared_ptr clone(std::map const& renaming, storm::parser::prism::VariableState const& variableState) const override; virtual void accept(ExpressionVisitor* visitor) override;