Skip to content

Commit

Permalink
Interpret: error on get-value if in non-sat state
Browse files Browse the repository at this point in the history
Give an error messge if `get-value` is called, but the solver is not in
a satisfiable state.  The new behaviour is consistent with `get-models`.
  • Loading branch information
aehyvari committed Apr 20, 2022
1 parent fecffbf commit 3b87b53
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bin/Interpret.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,12 @@ void Interpret::interp(ASTNode& n) {
break;
}
case t_getvalue: {
if (isInitialized()) {
getValue(n.children);
} else {
if (not isInitialized()) {
notify_formatted(true, "Illegal command before set-logic: get-value");
} else if (main_solver->getStatus() != s_True) {
notify_formatted(true, "Command get-value called, but solver is not in SAT state");
} else {
getValue(n.children);
}
break;
}
Expand Down

0 comments on commit 3b87b53

Please sign in to comment.