Browse Source

small fix for solver to work with timeout

Former-commit-id: a029597160
main
TimQu 10 years ago
parent
commit
88631a1ded
  1. 9
      src/solver/Smt2SmtSolver.cpp

9
src/solver/Smt2SmtSolver.cpp

@ -313,17 +313,19 @@ namespace storm {
void Smt2SmtSolver::checkForErrorMessage(const std::string message){ void Smt2SmtSolver::checkForErrorMessage(const std::string message){
size_t errorOccurrance = message.find("error"); size_t errorOccurrance = message.find("error");
if (errorOccurrance!=std::string::npos){
this->needsRestart=true;
//do not throw an exception for timeout or memout errors //do not throw an exception for timeout or memout errors
if(message.find("timeout")!=std::string::npos){ if(message.find("timeout")!=std::string::npos){
STORM_LOG_INFO("SMT solver answered: '" << message << "' and I am interpreting this as timeout "); STORM_LOG_INFO("SMT solver answered: '" << message << "' and I am interpreting this as timeout ");
this->needsRestart=true;
this->processIdOfSolver=0;
} }
else if(message.find("memory")!=std::string::npos){ else if(message.find("memory")!=std::string::npos){
STORM_LOG_INFO("SMT solver answered: '" << message << "' and I am interpreting this as out of memory "); STORM_LOG_INFO("SMT solver answered: '" << message << "' and I am interpreting this as out of memory ");
this->needsRestart=true;
this->processIdOfSolver=0; this->processIdOfSolver=0;
} }
else{
else if(errorOccurrance!=std::string::npos){
this->needsRestart=true;
std::string errorMsg = "An error was detected while checking the solver output. "; std::string errorMsg = "An error was detected while checking the solver output. ";
STORM_LOG_DEBUG("Detected an error message in the solver response:\n" + message); STORM_LOG_DEBUG("Detected an error message in the solver response:\n" + message);
size_t firstQuoteSign = message.find('\"',errorOccurrance); size_t firstQuoteSign = message.find('\"',errorOccurrance);
@ -344,4 +346,3 @@ namespace storm {
} }
} }
} }
}
Loading…
Cancel
Save