You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.0 KiB

  1. /*
  2. * IntegerVariable.h
  3. *
  4. * Created on: 08.01.2013
  5. * Author: Christian Dehnert
  6. */
  7. #ifndef STORM_IR_INTEGERVARIABLE_H_
  8. #define STORM_IR_INTEGERVARIABLE_H_
  9. #include <memory>
  10. #include "src/ir/Variable.h"
  11. #include "expressions/BaseExpression.h"
  12. namespace storm {
  13. namespace parser {
  14. namespace prism {
  15. class VariableState;
  16. } // namespace prismparser
  17. } // namespace parser
  18. namespace ir {
  19. /*!
  20. * A class representing an integer variable.
  21. */
  22. class IntegerVariable : public Variable {
  23. public:
  24. /*!
  25. * Default constructor. Creates an integer variable without a name and lower and upper bounds.
  26. */
  27. IntegerVariable();
  28. /*!
  29. * Creates a boolean variable with the given name and the given initial value.
  30. *
  31. * @param localIndex A module-local unique index for the variable.
  32. * @param globalIndex A globally unique index for the variable.
  33. * @param variableName The name of the variable.
  34. * @param lowerBound the lower bound of the domain of the variable.
  35. * @param upperBound the upper bound of the domain of the variable.
  36. * @param initialValue the expression that defines the initial value of the variable.
  37. */
  38. IntegerVariable(uint_fast64_t localIndex, uint_fast64_t globalIndex, std::string const& variableName, std::unique_ptr<storm::ir::expressions::BaseExpression>&& lowerBound, std::unique_ptr<storm::ir::expressions::BaseExpression>&& upperBound, std::unique_ptr<storm::ir::expressions::BaseExpression>&& initialValue = nullptr);
  39. /*!
  40. * Creates a copy of the given integer variable and performs the provided renaming.
  41. *
  42. * @param oldVariable The variable to copy.
  43. * @param newName New name of this variable.
  44. * @param newGlobalIndex The new global index of the variable.
  45. * @param renaming A mapping from names that are to be renamed to the names they are to be
  46. * replaced with.
  47. * @param variableState An object knowing about the variables in the system.
  48. */
  49. IntegerVariable(IntegerVariable const& oldVariable, std::string const& newName, uint_fast64_t newGlobalIndex, std::map<std::string, std::string> const& renaming, storm::parser::prism::VariableState const& variableState);
  50. /*!
  51. * Performs a deep-copy of the given variable.
  52. *
  53. * @param otherVariable The variable to copy.
  54. */
  55. IntegerVariable(IntegerVariable const& otherVariable);
  56. IntegerVariable& operator=(IntegerVariable const& otherVariable);
  57. /*!
  58. * Retrieves the lower bound for this integer variable.
  59. * @returns the lower bound for this integer variable.
  60. */
  61. std::unique_ptr<storm::ir::expressions::BaseExpression> const& getLowerBound() const;
  62. /*!
  63. * Retrieves the upper bound for this integer variable.
  64. * @returns the upper bound for this integer variable.
  65. */
  66. std::unique_ptr<storm::ir::expressions::BaseExpression> const& getUpperBound() const;
  67. /*!
  68. * Retrieves a string representation of this variable.
  69. * @returns a string representation of this variable.
  70. */
  71. std::string toString() const;
  72. private:
  73. // The lower bound of the domain of the variable.
  74. std::unique_ptr<storm::ir::expressions::BaseExpression> lowerBound;
  75. // The upper bound of the domain of the variable.
  76. std::unique_ptr<storm::ir::expressions::BaseExpression> upperBound;
  77. };
  78. } // namespace ir
  79. } // namespace storm
  80. #endif /* STORM_IR_INTEGERVARIABLE_H_ */