-
Notifications
You must be signed in to change notification settings - Fork 36
Add a stricter dependency contract proof obligation #3565
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
base: main
Are you sure you want to change the base?
Conversation
Problem: Currently, the heaps are compared entirely for equality, instead of just comparing the locations from the accessible clause
This PR is the result of the 2025 HacKeYthon |
Thanks, guys! Looks cool. Contracts are used to conservatively abstract from method invocations. The (old) dependency contracts are used to show that the value of calls to pure methods does not change since the dependency set remains untouched. Is there a similar use case for the stronger dependency contracts that exploit the proofs? The method-invocation rule would probably have to ensure that the read variables of the called method are a subset of the accessible locations in the calling method. ... |
Is planned to have a taclet option to switch between the old and new PO? |
The motivation (for me) was first to enable dependency contracts for void methods and second to see if it could be done. We did briefly consider if it would be useful but I think we need more experimentation for a proper use case. For that reason, a taclet option is not planned. (And we should not make it a taclet option as it does not affect the semantics of the Kripke structure.) |
Intended Change
The current proof obligation (
DependencyContractPO
) only verifies that the return value of a method only depends on the locations in the accessible clause. In contrast, this new proof obligation additionally verifies that any objects on the heap (except those newly created) only depend on the locations in the accessible clause.The formula that is generated by this proof obligation for a method$(\mathit{pre}, \mathit{post}, \mathit{mod}, \mathit{dep})$ is roughly
m
with contractWhile testing, you may run into #3563, so beware.
A simple example which proves succesfully with the current proof obligation, but cannot be proven with this new one is as follows:
Plan
Type of pull request
Ensuring quality
Additional information and contact(s)
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.