Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crashes with verification coverage + counterexamples #817

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- Target framework and package configuration -->
<PropertyGroup>
<Version>3.0.7</Version>
<Version>3.0.8</Version>
<TargetFramework>net6.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Authors>Boogie</Authors>
Expand Down
3 changes: 3 additions & 0 deletions Source/Model/ParserZ3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ internal override void Run()
}
else
{
if (funName.StartsWith("aux$$")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the name aux$$ occur anywhere else in the code? Can we use a string constant to refer to it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it occurs in a small number of other places. We probably should create a string constant for it. I'll do that in a future refactoring.

continue;
}
var fn = currModel.MkFunc(funName, 0);
fn.SetConstant(GetElt(lastWord));
}
Expand Down
4 changes: 3 additions & 1 deletion Source/Provers/SMTLib/SMTLibBatchTheoremProver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ private async Task<Outcome> CheckSat(CancellationToken cancellationToken)

if (options.LibOptions.ProduceUnsatCores) {
var unsatCoreSExp = responseStack.Pop();
ReportCoveredElements(unsatCoreSExp);
if (result == Outcome.Valid) {
ReportCoveredElements(unsatCoreSExp);
}
}

if (result == Outcome.Invalid) {
Expand Down
2 changes: 2 additions & 0 deletions Source/Provers/SMTLib/SMTLibProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ private async Task<SExpr> GetProverResponse()
return resp;
} else if (resp.Arguments[0].Name.Contains("model is not available")) {
return null;
} else if (resp.Arguments[0].Name.Contains("unsat core is not available")) {
return null;
} else if (resp.Arguments[0].Name.Contains("context is unsatisfiable")) {
return null;
} else if (resp.Arguments[0].Name.Contains("Cannot get model")) {
Expand Down
6 changes: 6 additions & 0 deletions Test/coverage/verificationCoverageCounterexample.bpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// RUN: %boogie /trackVerificationCoverage /enhancedErrorMessages:1 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"
procedure P(x: int) {
assume {:id "id1"} x < 100;
assert {:id "id2"} x < 10;
}
5 changes: 5 additions & 0 deletions Test/coverage/verificationCoverageCounterexample.bpl.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
verificationCoverageCounterexample.bpl(5,3): Error: this assertion could not be proved
Execution trace:
verificationCoverageCounterexample.bpl(4,3): anon0

Boogie program verifier finished with 0 verified, 1 error
Loading