Fixes #2584. Currently, we are immediately terminating CVC4 if the user
issues a `(get-info :reason-unknown)` command if it didn't succeed a
`(check-sat)` call returning `unknown`. This commit changes the behavior
to return an `(error ...)` but continue executing afterwards. It turns
the `ModalException` thrown in this case into a
`RecoverableModalException` and adds a check in
`GetInfoCommand::invoke()` to turn it into a
`CommandRecoverableFailure`, which solves the issue.
{
d_commandStatus = new CommandUnsupported();
}
+ catch (RecoverableModalException& e)
+ {
+ d_commandStatus = new CommandRecoverableFailure(e.what());
+ }
catch (exception& e)
{
d_commandStatus = new CommandFailure(e.what());
transform(s.begin(), s.end(), s.begin(), ::tolower);
return SExpr(SExpr::Keyword(s));
} else {
- throw ModalException("Can't get-info :reason-unknown when the "
- "last result wasn't unknown!");
+ throw RecoverableModalException(
+ "Can't get-info :reason-unknown when the "
+ "last result wasn't unknown!");
}
} else if(key == "assertion-stack-levels") {
AlwaysAssert(d_userLevels.size() <=
regress0/smallcnf.cvc
regress0/smt2output.smt2
regress0/smtlib/get-unsat-assumptions.smt2
+ regress0/smtlib/reason-unknown.smt2
regress0/strings/bug001.smt2
regress0/strings/bug002.smt2
regress0/strings/bug612.smt2
--- /dev/null
+; EXPECT: (error "Can't get-info :reason-unknown when the last result wasn't unknown!")
+; EXPECT: sat
+(set-logic QF_SAT)
+(get-info :reason-unknown)
+(check-sat)