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

Exception in solver interaction leads to false report of validity #487

Closed
atomb opened this issue Jan 21, 2022 · 2 comments
Closed

Exception in solver interaction leads to false report of validity #487

atomb opened this issue Jan 21, 2022 · 2 comments
Assignees
Labels

Comments

@atomb
Copy link
Collaborator

atomb commented Jan 21, 2022

If exceptions arise during interaction with a solver, VCGen.VerifyImplementation can sometimes silently and erroneously return Correct. In particular, I've seen this arise twice:

  • When incorrectly implementing a new feature in NoopSolver that led to an exception in SMTLibProcessTheoremProver.GetRCount.
  • When attempting to use Dafny with Yices and configuring it incorrectly.

You can replicate this by putting the following in an executable file named badz3:

#!/bin/bash
echo "dfksal"

And then running Boogie with the prover set to that script, something like this:

dotnet Source/BoogieDriver/bin/Debug/net6.0/BoogieDriver.dll /trace /proverOpt:PROVER_PATH=`pwd`/badz3 Test/test2/Arrays.bpl

This leads to the following output:

Parsing Test/test2/Arrays.bpl
Coalescing blocks...
Inlining...
[TRACE] Using prover: /Users/aarotomb/Repositories/boogie/badz3

Verifying P0 ...
  [0.101 s, 2 proof obligations]  verified

Verifying P1 ...
  [0.001 s, 1 proof obligation]  verified

Verifying P2 ...
  [0.000 s, 1 proof obligation]  verified

Verifying Q0 ...
  [0.001 s, 2 proof obligations]  verified

Verifying Q1 ...
  [0.000 s, 1 proof obligation]  verified

Verifying Q2 ...
  [0.000 s, 1 proof obligation]  verified

Verifying Q3 ...
  [0.000 s, 1 proof obligation]  verified

Verifying Q4 ...
  [0.000 s, 1 proof obligation]  verified

Verifying Skip0 ...
  [0.000 s, 2 proof obligations]  verified

Verifying Skip1 ...
  [0.001 s, 2 proof obligations]  verified

Boogie program verifier finished with 10 verified, 0 errors

When running with a working Z3, it reports 8 verified, 2 errors.

I believe that the issue arises at least in part from the following line:

Outcome outcome = Outcome.Correct;

I was hoping that changing Correct to Inconclusive here would resolve the issue, and that later code would set the outcome to Correct when encountering concrete evidence of correctness (e.g., "unsat" from a prover). However, it seems as though later code depends on this initial value, so I'm still investigating the appropriate fix.

@keyboardDrummer
Copy link
Collaborator

I can also get Boogie to return "Verified" if I run it in Zsh and use "Ctrl+C" to terminate the process.

@atomb
Copy link
Collaborator Author

atomb commented Feb 1, 2022

Closed by #488.

@atomb atomb closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants