Browse Source

Equality Comparisons for JaniVars, just to make life easier :-)

main
sjunges 9 years ago
parent
commit
c16390e7f5
  1. 9
      src/storm/storage/jani/Variable.cpp
  2. 5
      src/storm/storage/jani/Variable.h

9
src/storm/storage/jani/Variable.cpp

@ -101,6 +101,13 @@ namespace storm {
this->setInitExpression(this->getInitExpression().substitute(substitution)); this->setInitExpression(this->getInitExpression().substitute(substitution));
} }
} }
bool operator==(Variable const& lhs, Variable const& rhs) {
return lhs.getExpressionVariable() == rhs.getExpressionVariable();
}
bool operator!=(Variable const& lhs, Variable const& rhs) {
return !(lhs == rhs);
}
} }
} }

5
src/storm/storage/jani/Variable.h

@ -89,7 +89,7 @@ namespace storm {
* Substitutes all variables in all expressions according to the given substitution. * Substitutes all variables in all expressions according to the given substitution.
*/ */
virtual void substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution); virtual void substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution);
private: private:
// The name of the variable. // The name of the variable.
std::string name; std::string name;
@ -103,6 +103,9 @@ namespace storm {
/// Expression for initial values /// Expression for initial values
boost::optional<storm::expressions::Expression> init; boost::optional<storm::expressions::Expression> init;
}; };
bool operator==(Variable const& lhs, Variable const& rhs);
bool operator!=(Variable const& lhs, Variable const& rhs);
} }
} }
Loading…
Cancel
Save