9 : name(name), type(type.clone()), variable(variable), init(init), transient(transient) {
14 : name(name), type(type.clone()), variable(variable), init(), transient(false) {
23 return std::make_unique<Variable>(name, *type, variable, init, transient);
31 variable = newVariable;
56 this->init = initialExpression;
59void Variable::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression>
const& substitution,
60 bool const substituteTranscendentalNumbers) {
64 type->substitute(substitution, substituteTranscendentalNumbers);
78 if (
getType().isBoundedType()) {
81 if (boundedType.hasLowerBound()) {
84 if (boundedType.hasUpperBound()) {
96 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
98 return std::make_shared<Variable>(name, type, variable, initValue.get(), transient);
100 STORM_LOG_ASSERT(!transient,
"Expecting variable without init value to be not a transient variable");
101 return std::make_shared<Variable>(name, type, variable);
106 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
111 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
116 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
121 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
127 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient,
128 boost::optional<storm::expressions::Expression>
const& lowerBound,
129 boost::optional<storm::expressions::Expression>
const& upperBound) {
133 variable, initValue, transient);
137 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient,
138 boost::optional<storm::expressions::Expression>
const& lowerBound,
139 boost::optional<storm::expressions::Expression>
const& upperBound) {
144 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient,
145 boost::optional<storm::expressions::Expression>
const& lowerBound,
146 boost::optional<storm::expressions::Expression>
const& upperBound) {
151 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
156 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
161 boost::optional<storm::expressions::Expression>
const& initValue,
bool transient) {
170 return !(lhs == rhs);
bool isInitialized() const
Checks whether the object encapsulates a base-expression.
BoundedType const & asBoundedType() const
Variable(std::string const &name, JaniType const &type, storm::expressions::Variable const &variable, storm::expressions::Expression const &init, bool transient=false)
Creates a new variable with initial value construct.
void setName(std::string const &newName)
Sets the name of the variable.
void setExpressionVariable(storm::expressions::Variable const &newVariable)
Sets the associated expression variable.
static std::shared_ptr< Variable > makeArrayVariable(std::string const &name, JaniType const &baseType, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
static std::shared_ptr< Variable > makeContinuousVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
static std::shared_ptr< Variable > makeIntegerVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
static std::shared_ptr< Variable > makeRealVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
static std::shared_ptr< Variable > makeBooleanVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
static std::shared_ptr< Variable > makeBoundedIntegerVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient, boost::optional< storm::expressions::Expression > const &lowerBound, boost::optional< storm::expressions::Expression > const &upperBound)
bool hasInitExpression() const
Retrieves whether an initial expression is set.
std::unique_ptr< Variable > clone() const
Clones the variable.
storm::expressions::Variable const & getExpressionVariable() const
Retrieves the associated expression variable.
static std::shared_ptr< Variable > makeBoundedRealVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient, boost::optional< storm::expressions::Expression > const &lowerBound, boost::optional< storm::expressions::Expression > const &upperBound)
storm::expressions::Expression getRangeExpression() const
Retrieves an expression characterizing the legal range of the variable.
static std::shared_ptr< Variable > makeVariable(std::string const &name, JaniType const &type, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
Convenience functions to call the appropriate constructor and return a shared pointer to the variable...
storm::expressions::Expression const & getInitExpression() const
Retrieves the initial expression Should only be called if an initial expression is set for this varia...
void setInitExpression(storm::expressions::Expression const &initialExpression)
Sets the initial expression for this variable.
static std::shared_ptr< Variable > makeBasicTypeVariable(std::string const &name, BasicType::Type const &type, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
static std::shared_ptr< Variable > makeBoundedVariable(std::string const &name, BoundedType::BaseType const &type, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient, boost::optional< storm::expressions::Expression > const &lowerBound, boost::optional< storm::expressions::Expression > const &upperBound)
std::string const & getName() const
Retrieves the name of the variable.
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Substitutes all variables in all expressions according to the given substitution.
static std::shared_ptr< Variable > makeClockVariable(std::string const &name, storm::expressions::Variable const &variable, boost::optional< storm::expressions::Expression > const &initValue, bool transient)
#define STORM_LOG_ASSERT(cond, message)
bool operator!=(SynchronizationVector const &vector1, SynchronizationVector const &vector2)
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
bool operator==(SynchronizationVector const &vector1, SynchronizationVector const &vector2)