diff --git a/src/storage/prism/Program.cpp b/src/storage/prism/Program.cpp index 9ac73881e..8e3fae0cf 100644 --- a/src/storage/prism/Program.cpp +++ b/src/storage/prism/Program.cpp @@ -1066,6 +1066,16 @@ namespace storm { storm::prism::Module singleModule(newModuleName.str(), allBooleanVariables, allIntegerVariables, newCommands, this->getFilename(), 0); return Program(manager, this->getModelType(), this->getConstants(), std::vector(), std::vector(), this->getFormulas(), {singleModule}, actionToIndexMap, this->getRewardModels(), false, this->getInitialConstruct(), this->getLabels(), this->getFilename(), 0, true); } + + std::unordered_map Program::buildCommandIndexToActionNameMap() const { + std::unordered_map res; + for(auto const& m : this->modules) { + for(auto const& c : m.getCommands()) { + res.emplace(c.getGlobalIndex(), c.getActionName()); + } + } + return res; + } Command Program::synchronizeCommands(uint_fast64_t newCommandIndex, uint_fast64_t actionIndex, uint_fast64_t firstUpdateIndex, std::string const& actionName, std::vector> const& commands) const { // To construct the synchronous product of the commands, we need to store a list of its updates. diff --git a/src/storage/prism/Program.h b/src/storage/prism/Program.h index f2b13781d..1b6f994e9 100644 --- a/src/storage/prism/Program.h +++ b/src/storage/prism/Program.h @@ -443,6 +443,11 @@ namespace storm { * @return The manager responsible for the expressions of this program. */ storm::expressions::ExpressionManager& getManager(); + + /*! + * + */ + std::unordered_map buildCommandIndexToActionNameMap() const; private: /*!