Browse Source

Fixed dummy returns in VariableState.cpp.

tempestpy_adaptions
dehnert 12 years ago
parent
commit
82430ca12d
  1. 8
      src/ir/Module.h
  2. 4
      src/parser/prismparser/VariableState.cpp

8
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;
};
/*!

4
src/parser/prismparser/VariableState.cpp

@ -86,7 +86,7 @@ std::shared_ptr<VariableExpression> 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<VariableExpression>(nullptr);
return std::shared_ptr<VariableExpression>(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<VariableExpression> 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<VariableExpression>(nullptr);
return std::shared_ptr<VariableExpression>(BaseExpression::int_, 0, name);
} else {
LOG4CPLUS_ERROR(logger, "Integer variable " << name << " does not exist.");
throw storm::exceptions::InvalidArgumentException() << "Integer variable " << name << " does not exist.";

Loading…
Cancel
Save