diff --git a/src/storm/storage/jani/VariableSet.cpp b/src/storm/storage/jani/VariableSet.cpp index 4c8b86591..ac692c637 100644 --- a/src/storm/storage/jani/VariableSet.cpp +++ b/src/storm/storage/jani/VariableSet.cpp @@ -112,7 +112,11 @@ namespace storm { bool VariableSet::hasVariable(std::string const& name) const { return nameToVariable.find(name) != nameToVariable.end(); } - + + bool VariableSet::hasVariable(Variable const& var) const { + return hasVariable(var.getName()); + } + Variable const& VariableSet::getVariable(std::string const& name) const { auto it = nameToVariable.find(name); STORM_LOG_THROW(it != nameToVariable.end(), storm::exceptions::InvalidArgumentException, "Unable to retrieve unknown variable '" << name << "'."); diff --git a/src/storm/storage/jani/VariableSet.h b/src/storm/storage/jani/VariableSet.h index 200489116..6d101ad7a 100644 --- a/src/storm/storage/jani/VariableSet.h +++ b/src/storm/storage/jani/VariableSet.h @@ -103,6 +103,10 @@ namespace storm { */ Variable const& getVariable(std::string const& name) const; + /*! + * Retrieves whether this variable set contains a given variable. + */ + bool hasVariable(storm::jani::Variable const& variable) const; /*! * Retrieves whether this variable set contains a variable with the expression variable. */