diff --git a/src/storage/prism/Program.cpp b/src/storage/prism/Program.cpp index fee721878..7947b4c78 100644 --- a/src/storage/prism/Program.cpp +++ b/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(); diff --git a/src/storage/prism/Program.h b/src/storage/prism/Program.h index b4e6d45b5..45ac16b62 100644 --- a/src/storage/prism/Program.h +++ b/src/storage/prism/Program.h @@ -89,7 +89,14 @@ namespace storm { * @return The undefined constants in the program. */ std::vector> 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. *