From c683934ea0f10088bc65343ef79ccbd2e224b6db Mon Sep 17 00:00:00 2001 From: dehnert Date: Fri, 7 Aug 2015 19:53:58 +0200 Subject: [PATCH] removed debug output and fixed bug Former-commit-id: 0c33f61bbea9dfe743c213ff0eecdad1eb3008d1 --- src/builder/DdPrismModelBuilder.cpp | 3 - src/parser/PrismParser.cpp | 9 +- src/storage/prism/Program.cpp | 4 +- .../builder/DdPrismModelBuilderTest.cpp | 88 +++++++++---------- 4 files changed, 53 insertions(+), 51 deletions(-) diff --git a/src/builder/DdPrismModelBuilder.cpp b/src/builder/DdPrismModelBuilder.cpp index 13a6cb985..eae18d06e 100644 --- a/src/builder/DdPrismModelBuilder.cpp +++ b/src/builder/DdPrismModelBuilder.cpp @@ -613,7 +613,6 @@ namespace storm { } preparedProgram = preparedProgram.substituteConstants(); - std::cout << "translating: " << preparedProgram << std::endl; // Start by initializing the structure used for storing all information needed during the model generation. // In particular, this creates the meta variables used to encode the model. @@ -621,8 +620,6 @@ namespace storm { std::pair, ModuleDecisionDiagram> transitionMatrixModulePair = createSystemDecisionDiagram(generationInfo); storm::dd::Add transitionMatrix = transitionMatrixModulePair.first; - transitionMatrix.exportToDot("trans.dot"); - std::cout << "trans: " << transitionMatrix << std::endl; ModuleDecisionDiagram const& globalModule = transitionMatrixModulePair.second; // Finally, we build the DDs for a reward structure, if requested. It is important to do this now, because diff --git a/src/parser/PrismParser.cpp b/src/parser/PrismParser.cpp index bff8c71b8..ddb348249 100644 --- a/src/parser/PrismParser.cpp +++ b/src/parser/PrismParser.cpp @@ -378,7 +378,8 @@ namespace storm { if (!actionName.empty()) { auto const& nameIndexPair = globalProgramInformation.actionIndices.find(actionName); if (nameIndexPair == globalProgramInformation.actionIndices.end()) { - globalProgramInformation.actionIndices[actionName] = globalProgramInformation.actionIndices.size(); + std::size_t nextIndex = globalProgramInformation.actionIndices.size(); + globalProgramInformation.actionIndices[actionName] = nextIndex; } } @@ -392,7 +393,8 @@ namespace storm { // Register the action name if it has not appeared earlier. auto const& nameIndexPair = globalProgramInformation.actionIndices.find(actionName); if (nameIndexPair == globalProgramInformation.actionIndices.end()) { - globalProgramInformation.actionIndices[actionName] = globalProgramInformation.actionIndices.size(); + std::size_t nextIndex = globalProgramInformation.actionIndices.size(); + globalProgramInformation.actionIndices[actionName] = nextIndex; } } @@ -518,7 +520,8 @@ namespace storm { if (!newActionName.empty()) { auto const& nameIndexPair = globalProgramInformation.actionIndices.find(newActionName); if (nameIndexPair == globalProgramInformation.actionIndices.end()) { - globalProgramInformation.actionIndices[newActionName] = globalProgramInformation.actionIndices.size(); + std::size_t nextIndex = globalProgramInformation.actionIndices.size(); + globalProgramInformation.actionIndices[newActionName] = nextIndex; } } diff --git a/src/storage/prism/Program.cpp b/src/storage/prism/Program.cpp index 0b61fd795..4655f1bcc 100644 --- a/src/storage/prism/Program.cpp +++ b/src/storage/prism/Program.cpp @@ -13,8 +13,10 @@ namespace storm { namespace prism { Program::Program(std::shared_ptr manager, ModelType modelType, std::vector const& constants, std::vector const& globalBooleanVariables, std::vector const& globalIntegerVariables, std::vector const& formulas, std::vector const& modules, std::map const& actionToIndexMap, std::vector const& rewardModels, bool fixInitialConstruct, storm::prism::InitialConstruct const& initialConstruct, std::vector