diff --git a/src/ir/IntegerVariable.cpp b/src/ir/IntegerVariable.cpp index 8b4902ce7..ace6735be 100644 --- a/src/ir/IntegerVariable.cpp +++ b/src/ir/IntegerVariable.cpp @@ -28,6 +28,7 @@ namespace storm { IntegerVariable::IntegerVariable(IntegerVariable const& oldVariable, std::string const& newName, uint_fast64_t newGlobalIndex, std::map const& renaming, storm::parser::prism::VariableState const& variableState) : Variable(oldVariable, newName, newGlobalIndex, renaming, variableState), lowerBound(oldVariable.lowerBound->clone(renaming, variableState)), upperBound(oldVariable.upperBound->clone(renaming, variableState)) { + // Nothing to do here. } std::shared_ptr IntegerVariable::getLowerBound() const { diff --git a/src/ir/Module.cpp b/src/ir/Module.cpp index e29d07671..b28c9c9fe 100644 --- a/src/ir/Module.cpp +++ b/src/ir/Module.cpp @@ -51,8 +51,8 @@ namespace storm { LOG4CPLUS_ERROR(logger, "Boolean variable " << moduleName << "." << booleanVariable.getName() << " was not renamed."); throw storm::exceptions::InvalidArgumentException() << "Boolean variable " << moduleName << "." << booleanVariable.getName() << " was not renamed."; } else { - this->booleanVariables.emplace_back(booleanVariable, renamingPair->second, variableState.getNextGlobalBooleanVariableIndex(), renaming, variableState); - variableState.addBooleanVariable(renamingPair->second); + uint_fast64_t globalIndex = variableState.addBooleanVariable(renamingPair->second); + this->booleanVariables.emplace_back(booleanVariable, renamingPair->second, globalIndex, renaming, variableState); } } // Now do the same for the integer variables. @@ -63,8 +63,8 @@ namespace storm { LOG4CPLUS_ERROR(logger, "Integer variable " << moduleName << "." << integerVariable.getName() << " was not renamed."); throw storm::exceptions::InvalidArgumentException() << "Integer variable " << moduleName << "." << integerVariable.getName() << " was not renamed."; } else { - this->integerVariables.emplace_back(integerVariable, renamingPair->second, variableState.getNextGlobalIntegerVariableIndex(), renaming, variableState); - variableState.addIntegerVariable(renamingPair->second); + uint_fast64_t globalIndex = variableState.addIntegerVariable(renamingPair->second); + this->integerVariables.emplace_back(integerVariable, renamingPair->second, globalIndex, renaming, variableState); } } diff --git a/src/ir/Variable.cpp b/src/ir/Variable.cpp index eefa63063..7a7fe7cf8 100644 --- a/src/ir/Variable.cpp +++ b/src/ir/Variable.cpp @@ -25,7 +25,7 @@ namespace storm { } Variable::Variable(Variable const& var, std::string const& newName, uint_fast64_t newGlobalIndex, std::map const& renaming, storm::parser::prism::VariableState const& variableState) - : localIndex(var.getLocalIndex()), globalIndex(newGlobalIndex), variableName(var.getName()) { + : localIndex(var.getLocalIndex()), globalIndex(newGlobalIndex), variableName(newName) { if (var.initialValue != nullptr) { this->initialValue = var.initialValue->clone(renaming, variableState); } diff --git a/src/parser/prismparser/PrismGrammar.cpp b/src/parser/prismparser/PrismGrammar.cpp index 341e22a66..992e9c039 100644 --- a/src/parser/prismparser/PrismGrammar.cpp +++ b/src/parser/prismparser/PrismGrammar.cpp @@ -38,10 +38,6 @@ namespace storm { namespace parser { namespace prism { -void dump(const std::string& s) { - std::cerr << "Dump: " << s << std::endl; -} - std::shared_ptr PrismGrammar::addIntegerConstant(std::string const& name, std::shared_ptr const& value) { this->state->integerConstants_.add(name, value); this->state->allConstantNames_.add(name, name);