-
Notifications
You must be signed in to change notification settings - Fork 63
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
Unsound compositional proof #30
Comments
This is fixed in 43cc206. The code to override functions based on previous proofs had an embarrassing bug: it completely ignored state changes made by the overridden function, propagating only the return value. It's no longer quite so broken. |
Not quite so broken, yes, but still broken. Consider this small change to the example, where one of the effects is commented out of the first specification:
Fine so far, that's a true fact, albeit an incomplete description. It can be used unsoundly:
Typically, specifications for called routines will need to make some honest statement about what they can modify, but this is missing here. |
This is a known issue which should have already had its own ticket. I believe I'd mentioned it to you in earlier discussions, @msaaltink. Apologies if I didn't. One of the key reasons for a formalization of what these specifications mean is that, for the memory model used by the LLVM simulator, it's unclear exactly what we need to check to ensure that functions do not have effects beyond what's specified. |
I'm not sure if this would fix all instances of this unsoundness, but a first approximation might be: For each variable (global, parameter, etc.) appearing in a precondition, unless it's value is also uniquely determined by a postcondition*, creating a new postcondition stating that it's value doesn't change. It might be best if the SAW manual included a note about this for 0.3. *This is probably the challenging bit. |
* Invalidate memory before executing postcondition * Do not implicitly allocate mutable global variables. Instead, use a new crucible_alloc_global function. * Refactor unwieldy additions to verifyPrestate and executeCond * Update integration test suite * Add some integration tests for issue #30 * Add source location for global allocations * Bump crucible submodule Fixes #30.
* Invalidate memory before executing postcondition * Do not implicitly allocate mutable global variables. Instead, use a new crucible_alloc_global function. * Refactor unwieldy additions to verifyPrestate and executeCond * Update integration test suite * Add some integration tests for issue #30 * Add source location for global allocations * Bump crucible submodule Fixes #30.
Make test binary load, translate, and typecheck `Cryptol.cry`.
I'm getting an unsound result from a composite proof of this simple code:
Here's the SAWscript:
This supposed proof works fine in the latest saw-script interpreter. Oddly enough, a non-compositional proof knows the righty answer:
The text was updated successfully, but these errors were encountered: