Skip to content

Commit

Permalink
fix resource limit & timeout handling in CheckSat in SMTLibInteractiv…
Browse files Browse the repository at this point in the history
…eTheoremProver
  • Loading branch information
Samuel Pilz committed Jan 9, 2025
1 parent 7f9f784 commit 15bd45a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Provers/SMTLib/SMTLibInteractiveTheoremProver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,15 @@ public async Task<SolverOutcome> CheckSat(CancellationToken cancellationToken,
currentErrorHandler.OnModel(labels, model, result);
}

// if the solver is out of resources or has timed out, the global result needs to reflect that.
if (result == SolverOutcome.OutOfResource || result == SolverOutcome.TimeOut) {
globalResult = result;
}

Debug.Assert(errorsDiscovered > 0);
// if errorLimit is 0, loop will break only if there are no more
// counterexamples to be discovered.
// counterexamples to be discovered or the solver is out of resources
// or has timed out.
if (labels == null || !labels.Any() || errorsDiscovered == errorLimit)
{
break;
Expand Down

0 comments on commit 15bd45a

Please sign in to comment.