Skip to content
Snippets Groups Projects
Commit 9f30d3ef authored by Manos Koukoutos's avatar Manos Koukoutos
Browse files

Improve unsupported handling in SMTLIB

parent 4ae5ae4f
No related branches found
No related tags found
No related merge requests found
......@@ -682,9 +682,13 @@ trait SMTLIBTarget {
out.write("\n")
out.flush()
}
if (hasError) Unsupported else interpreter.eval(cmd) match {
interpreter.eval(cmd) match {
case err@ErrorResponse(msg) if !interrupted =>
reporter.fatalError("Unexpected error from smt-"+targetName+" solver: "+msg)
reporter.warning(s"Unexpected error from $name solver: $msg")
// Store that there was an error. Now all following check()
// invocations will return None
addError()
err
case res => res
}
}
......@@ -703,11 +707,14 @@ trait SMTLIBTarget {
}
override def check: Option[Boolean] = sendCommand(CheckSat()) match {
case CheckSatStatus(SatStatus) => Some(true)
case CheckSatStatus(UnsatStatus) => Some(false)
case CheckSatStatus(UnknownStatus) => None
case e => None
override def check: Option[Boolean] = {
if (hasError) None
else sendCommand(CheckSat()) match {
case CheckSatStatus(SatStatus) => Some(true)
case CheckSatStatus(UnsatStatus) => Some(false)
case CheckSatStatus(UnknownStatus) => None
case e => None
}
}
override def getModel: Map[Identifier, Expr] = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment