Browse Source

getUndefinedConstantsAsString added to storm::prism::program

Former-commit-id: 8dbfbf2566
tempestpy_adaptions
sjunges 9 years ago
parent
commit
2d44d4f822
  1. 15
      src/storage/prism/Program.cpp
  2. 9
      src/storage/prism/Program.h

15
src/storage/prism/Program.cpp

@ -171,6 +171,21 @@ namespace storm {
}
return result;
}
std::string Program::getUndefinedConstantsAsString() const {
std::stringstream stream;
bool printComma = false;
for (auto const& constant : getUndefinedConstants()) {
if (printComma) {
stream << ", ";
} else {
printComma = true;
}
stream << constant.get().getName() << " (" << constant.get().getType() << ")";
}
stream << ".";
return stream.str();
}
bool Program::hasConstant(std::string const& constantName) const {
return this->constantToIndexMap.find(constantName) != this->constantToIndexMap.end();

9
src/storage/prism/Program.h

@ -89,7 +89,14 @@ namespace storm {
* @return The undefined constants in the program.
*/
std::vector<std::reference_wrapper<storm::prism::Constant const>> getUndefinedConstants() const;
/*!
* Retrieves the undefined constants in the program as a comma-separated string.
*
* @return A string with the undefined constants in the program, separated by a comma
*/
std::string getUndefinedConstantsAsString() const;
/*!
* Retrieves whether the given constant exists in the program.
*

Loading…
Cancel
Save