diff --git a/src/ir/Module.h b/src/ir/Module.h index e55b8a303..08c0dcefc 100644 --- a/src/ir/Module.h +++ b/src/ir/Module.h @@ -29,7 +29,7 @@ namespace ir { * * @param name The name of the boolean variable to add. */ - virtual uint_fast64_t addBooleanVariable(std::string const& name) = 0; + uint_fast64_t addBooleanVariable(std::string const& name) = 0; /*! * Adds an integer variable with the given name, lower and upper bound. @@ -38,17 +38,17 @@ namespace ir { * @param lower The lower bound of the integer variable. * @param upper The upper bound of the integer variable. */ - virtual uint_fast64_t addIntegerVariable(std::string const& name) = 0; + uint_fast64_t addIntegerVariable(std::string const& name) = 0; /*! * Retrieves the next free (global) index for a boolean variable. */ - virtual uint_fast64_t getNextGlobalBooleanVariableIndex() = 0; + uint_fast64_t getNextGlobalBooleanVariableIndex() const = 0; /*! * Retrieves the next free (global) index for a integer variable. */ - virtual uint_fast64_t getNextGlobalIntegerVariableIndex() = 0; + uint_fast64_t getNextGlobalIntegerVariableIndex() const = 0; }; /*! diff --git a/src/parser/prismparser/VariableState.cpp b/src/parser/prismparser/VariableState.cpp index 1bdf7b0e0..29feb025b 100644 --- a/src/parser/prismparser/VariableState.cpp +++ b/src/parser/prismparser/VariableState.cpp @@ -86,7 +86,7 @@ std::shared_ptr VariableState::getBooleanVariableExpression( } else { if (firstRun) { LOG4CPLUS_TRACE(logger, "Trying to retrieve boolean variable " << name << " that was not yet created; returning dummy instead."); - return std::shared_ptr(nullptr); + return std::shared_ptr(BaseExpression::bool_, 0, name); } else { LOG4CPLUS_ERROR(logger, "Boolean variable " << name << " does not exist."); throw storm::exceptions::InvalidArgumentException() << "Boolean variable " << name << " does not exist."; @@ -101,7 +101,7 @@ std::shared_ptr VariableState::getIntegerVariableExpression( } else { if (firstRun) { LOG4CPLUS_TRACE(logger, "Trying to retrieve integer variable " << name << " that was not yet created; returning dummy instead."); - return std::shared_ptr(nullptr); + return std::shared_ptr(BaseExpression::int_, 0, name); } else { LOG4CPLUS_ERROR(logger, "Integer variable " << name << " does not exist."); throw storm::exceptions::InvalidArgumentException() << "Integer variable " << name << " does not exist.";