Browse Source

Added copy-constructors for all IR classes. TODO: make tests run again...

main
dehnert 12 years ago
parent
commit
9505f553dd
  1. 4
      src/ir/expressions/BaseExpression.cpp
  2. 5
      src/ir/expressions/BinaryBooleanFunctionExpression.cpp
  3. 7
      src/ir/expressions/BinaryBooleanFunctionExpression.h
  4. 4
      src/ir/expressions/BinaryExpression.cpp
  5. 7
      src/ir/expressions/BinaryExpression.h
  6. 5
      src/ir/expressions/BinaryNumericalFunctionExpression.cpp
  7. 7
      src/ir/expressions/BinaryNumericalFunctionExpression.h
  8. 7
      src/ir/expressions/BinaryRelationExpression.cpp
  9. 7
      src/ir/expressions/BinaryRelationExpression.h
  10. 6
      src/ir/expressions/BooleanConstantExpression.cpp
  11. 7
      src/ir/expressions/BooleanConstantExpression.h
  12. 5
      src/ir/expressions/BooleanLiteralExpression.cpp
  13. 7
      src/ir/expressions/BooleanLiteralExpression.h
  14. 2
      src/ir/expressions/ConstantExpression.cpp
  15. 4
      src/ir/expressions/ConstantExpression.h
  16. 5
      src/ir/expressions/DoubleConstantExpression.cpp
  17. 7
      src/ir/expressions/DoubleConstantExpression.h
  18. 5
      src/ir/expressions/DoubleLiteralExpression.cpp
  19. 7
      src/ir/expressions/DoubleLiteralExpression.h
  20. 5
      src/ir/expressions/IntegerConstantExpression.cpp
  21. 7
      src/ir/expressions/IntegerConstantExpression.h
  22. 5
      src/ir/expressions/IntegerLiteralExpression.cpp
  23. 7
      src/ir/expressions/IntegerLiteralExpression.h
  24. 4
      src/ir/expressions/UnaryBooleanFunctionExpression.cpp
  25. 7
      src/ir/expressions/UnaryBooleanFunctionExpression.h
  26. 4
      src/ir/expressions/UnaryExpression.cpp
  27. 7
      src/ir/expressions/UnaryExpression.h
  28. 4
      src/ir/expressions/UnaryNumericalFunctionExpression.cpp
  29. 7
      src/ir/expressions/UnaryNumericalFunctionExpression.h
  30. 4
      src/ir/expressions/VariableExpression.cpp
  31. 7
      src/ir/expressions/VariableExpression.h

4
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.
}

5
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<BaseExpression> BinaryBooleanFunctionExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new BinaryBooleanFunctionExpression(this->getLeft()->clone(renaming, variableState), this->getRight()->clone(renaming, variableState), this->functionType));
}

7
src/ir/expressions/BinaryBooleanFunctionExpression.h

@ -33,6 +33,13 @@ namespace storm {
*/
BinaryBooleanFunctionExpression(std::shared_ptr<BaseExpression> const& left, std::shared_ptr<BaseExpression> const& right, FunctionType functionType);
/*!
* Copy-constructs from the given expression.
*
* @param binaryBooleanFunctionExpression The expression to copy.
*/
BinaryBooleanFunctionExpression(BinaryBooleanFunctionExpression const& binaryBooleanFunctionExpression);
virtual std::shared_ptr<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual bool getValueAsBool(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

4
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<BaseExpression> const& BinaryExpression::getLeft() const {
return left;
}

7
src/ir/expressions/BinaryExpression.h

@ -27,6 +27,13 @@ namespace storm {
*/
BinaryExpression(ReturnType type, std::shared_ptr<BaseExpression> const& left, std::shared_ptr<BaseExpression> 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.
*

5
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<BaseExpression> BinaryNumericalFunctionExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new BinaryNumericalFunctionExpression(this->getType(), this->getLeft()->clone(renaming, variableState), this->getRight()->clone(renaming, variableState), this->functionType));
}

7
src/ir/expressions/BinaryNumericalFunctionExpression.h

@ -34,6 +34,13 @@ namespace storm {
*/
BinaryNumericalFunctionExpression(ReturnType type, std::shared_ptr<BaseExpression> const& left, std::shared_ptr<BaseExpression> const& right, FunctionType functionType);
/*!
* Copy-constructs from the given expression.
*
* @param binaryNumericalFunctionExpression The expression to copy.
*/
BinaryNumericalFunctionExpression(BinaryNumericalFunctionExpression const& binaryNumericalFunctionExpression);
virtual std::shared_ptr<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
/*!

7
src/ir/expressions/BinaryRelationExpression.cpp

@ -15,7 +15,12 @@ namespace storm {
BinaryRelationExpression::BinaryRelationExpression(std::shared_ptr<BaseExpression> const& left, std::shared_ptr<BaseExpression> 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<BaseExpression> BinaryRelationExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {

7
src/ir/expressions/BinaryRelationExpression.h

@ -33,6 +33,13 @@ namespace storm {
*/
BinaryRelationExpression(std::shared_ptr<BaseExpression> const& left, std::shared_ptr<BaseExpression> const& right, RelationType relationType);
/*!
* Copy-constructs from the given expression.
*
* @param binaryRelationExpression The expression to copy.
*/
BinaryRelationExpression(BinaryRelationExpression const& binaryRelationExpression);
virtual std::shared_ptr<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual bool getValueAsBool(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

6
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<BaseExpression> BooleanConstantExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new BooleanConstantExpression(*this));
}

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual bool getValueAsBool(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

5
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<BaseExpression> BooleanLiteralExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new BooleanLiteralExpression(this->value));
}

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual bool getValueAsBool(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

2
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
}

4
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);

5
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<BaseExpression> DoubleConstantExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new DoubleConstantExpression(*this));
}

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual double getValueAsDouble(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

5
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<BaseExpression> DoubleLiteralExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new DoubleLiteralExpression(this->value));
}

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual double getValueAsDouble(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

5
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<BaseExpression> IntegerConstantExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new IntegerConstantExpression(*this));
}

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual int_fast64_t getValueAsInt(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

5
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<BaseExpression> IntegerLiteralExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new IntegerLiteralExpression(this->value));
}

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual int_fast64_t getValueAsInt(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

4
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<BaseExpression> UnaryBooleanFunctionExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new UnaryBooleanFunctionExpression(this->getChild()->clone(renaming, variableState), this->functionType));
}

7
src/ir/expressions/UnaryBooleanFunctionExpression.h

@ -32,6 +32,13 @@ namespace storm {
*/
UnaryBooleanFunctionExpression(std::shared_ptr<BaseExpression> child, FunctionType functionType);
/*!
* Copy-constructs from the given expression.
*
* @param unaryBooleanFunctionExpression The expression to copy.
*/
UnaryBooleanFunctionExpression(UnaryBooleanFunctionExpression const& unaryBooleanFunctionExpression);
virtual std::shared_ptr<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
/*!

4
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<BaseExpression> const& UnaryExpression::getChild() const {
return child;
}

7
src/ir/expressions/UnaryExpression.h

@ -26,6 +26,13 @@ namespace storm {
*/
UnaryExpression(ReturnType type, std::shared_ptr<BaseExpression> child);
/*!
* Copy-constructs from the given expression.
*
* @param unaryExpression The expression to copy.
*/
UnaryExpression(UnaryExpression const& unaryExpression);
/*!
* Retrieves the child of the expression node.
*

4
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<BaseExpression> UnaryNumericalFunctionExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
return std::shared_ptr<BaseExpression>(new UnaryNumericalFunctionExpression(this->getType(), this->getChild()->clone(renaming, variableState), this->functionType));
}

7
src/ir/expressions/UnaryNumericalFunctionExpression.h

@ -32,6 +32,13 @@ namespace storm {
*/
UnaryNumericalFunctionExpression(ReturnType type, std::shared_ptr<BaseExpression> child, FunctionType functionType);
/*!
* Copy-constructs from the given expression.
*
* @param unaryNumericalFunctionExpression The expression to copy.
*/
UnaryNumericalFunctionExpression(UnaryNumericalFunctionExpression const& unaryNumericalFunctionExpression);
virtual std::shared_ptr<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual int_fast64_t getValueAsInt(std::pair<std::vector<bool>, std::vector<int_fast64_t>> const* variableValues) const override;

4
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<BaseExpression> VariableExpression::clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const {
// Perform the proper cloning.
auto renamingPair = renaming.find(this->variableName);

7
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<BaseExpression> clone(std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState) const override;
virtual void accept(ExpressionVisitor* visitor) override;

Loading…
Cancel
Save