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

nullable is ignored for arguments of model methods #3186

Closed
gewitternacht opened this issue Jun 27, 2023 · 0 comments · Fixed by #3307
Closed

nullable is ignored for arguments of model methods #3186

gewitternacht opened this issue Jun 27, 2023 · 0 comments · Fixed by #3307
Assignees

Comments

@gewitternacht
Copy link

Description

When defining a model method with a nullable argument like

helper model int foo(nullable Nullable n) { ... }

it seems KeY ignores the nullable annotation.

For example, this can be observed when loading the contract for the model method itself, an accessible clause thereof or when applying the rule "Use Dependency Contract" on this model method: They all look the same as if nullable is omitted and contain (¬n = null)«impl».

Reproducible

always

Steps to reproduce

  1. load Nullable.java in KeY
  2. choose any contract of foo() to prove
  3. observe the (¬n = null)«impl»

To understand where this is a problem for me:

  1. load nullable.proof in KeY
  2. observe that one subgoal necessary for applying "Use Dependency Contract" is not provable due to the ignored annotation

Note that this particular proof could be closed simply by not using the dependency contract and instead expanding the definition of foo(). However, this is not always (easily) possible in more complex proof situations.

Files: nullable.zip


unp1 added a commit that referenced this issue Oct 19, 2023
unp1 added a commit that referenced this issue Oct 19, 2023
…fiers to return type declaration of model methods
@unp1 unp1 linked a pull request Oct 19, 2023 that will close this issue
@unp1 unp1 self-assigned this Oct 20, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 22, 2023
- Fix issue #3186: Preserve nullable/non_null modifiers on paramters of
model methods
- Addendum to fix for issue #3186: Also reattach non_null/nullable
modifiers to return type declaration of model methods
unp1 added a commit that referenced this issue Oct 28, 2023
unp1 added a commit that referenced this issue Oct 28, 2023
…fiers to return type declaration of model methods
unp1 added a commit that referenced this issue Nov 10, 2023
unp1 added a commit that referenced this issue Nov 10, 2023
…fiers to return type declaration of model methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants