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

Yields variables are nameable in preconditions #742

Closed
bobismijnnaam opened this issue Jun 9, 2022 · 0 comments
Closed

Yields variables are nameable in preconditions #742

bobismijnnaam opened this issue Jun 9, 2022 · 0 comments
Labels
A-Bug R Rewriting problem

Comments

@bobismijnnaam
Copy link
Contributor

In VerCors 2.0.0 alpha 6, yields variables are nameable in preconditions. The following verifies:

class Test {
  yields int[] indegree;
  requires indegree != null ** indegree.length > 0;
  requires Perm(indegree[0], write) ** indegree[0] == 0;
  boolean m() {
    assert \old(indegree[0]) == 0;
  }
}

Instead, I would expect one, possibly two, errors:

  • indegree does not have a value in the method pre-state, so that should be an error
  • therefore it also cannot be mentioned in \old expressions, so that could also be an error.

In this specific case it'd be fine if the precondition error makes the error about the usage of a yields var in \old disappear. However in other cases that should also be an error.

@pieter-bos pieter-bos added A-Bug R Rewriting problem labels Sep 28, 2022
pieter-bos added a commit that referenced this issue Oct 20, 2023
fix #742: yields variables are not referencable in requires/context/c_e
@github-project-automation github-project-automation bot moved this to Done in Board Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Bug R Rewriting problem
Projects
Status: Done
Development

No branches or pull requests

2 participants