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.

89 lines
3.7 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::shared_ptr<storm::ir::expressions::BaseExpression> lowerBound, std::shared_ptr<storm::ir::expressions::BaseExpression> upperBound, std::shared_ptr<storm::ir::expressions::BaseExpression> initialValue = std::shared_ptr<storm::ir::expressions::BaseExpression>(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. * Retrieves the lower bound for this integer variable.
  52. * @returns the lower bound for this integer variable.
  53. */
  54. std::shared_ptr<storm::ir::expressions::BaseExpression> getLowerBound() const;
  55. /*!
  56. * Retrieves the upper bound for this integer variable.
  57. * @returns the upper bound for this integer variable.
  58. */
  59. std::shared_ptr<storm::ir::expressions::BaseExpression> getUpperBound() const;
  60. /*!
  61. * Retrieves a string representation of this variable.
  62. * @returns a string representation of this variable.
  63. */
  64. std::string toString() const;
  65. private:
  66. // The lower bound of the domain of the variable.
  67. std::shared_ptr<storm::ir::expressions::BaseExpression> lowerBound;
  68. // The upper bound of the domain of the variable.
  69. std::shared_ptr<storm::ir::expressions::BaseExpression> upperBound;
  70. };
  71. } // namespace ir
  72. } // namespace storm
  73. #endif /* STORM_IR_INTEGERVARIABLE_H_ */