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. 7
      src/storage/prism/Program.h

15
src/storage/prism/Program.cpp

@ -172,6 +172,21 @@ namespace storm {
return result; 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 { bool Program::hasConstant(std::string const& constantName) const {
return this->constantToIndexMap.find(constantName) != this->constantToIndexMap.end(); return this->constantToIndexMap.find(constantName) != this->constantToIndexMap.end();
} }

7
src/storage/prism/Program.h

@ -90,6 +90,13 @@ namespace storm {
*/ */
std::vector<std::reference_wrapper<storm::prism::Constant const>> getUndefinedConstants() const; 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. * Retrieves whether the given constant exists in the program.
* *
Loading…
Cancel
Save