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

JML ghost declarations should behave like set statements #3466

Open
wadoon opened this issue Apr 29, 2024 · 0 comments
Open

JML ghost declarations should behave like set statements #3466

wadoon opened this issue Apr 29, 2024 · 0 comments

Comments

@wadoon
Copy link
Member

wadoon commented Apr 29, 2024

After #3195, set and assert/assume statements are not handled inside Java anymore. Previous to this fix, the set statements were a regular copy assignment in Java. Therefore, classes were needed in the hierarchy of the Java AST to resemble JML expressions (e.g., empty set literal, ...). These classes are not needed anymore iff we push the migration further and transform declarations of ghost and model fields into set statements. The cases are

class A {
  //@ ghost int x = (\num_of int y; 0<= y <= a.length; a[y]>0);

  void foo() {
     //@ ghost int x = (\sum ...);
  }
}

TODO: Split ghost declaration into the declaration and the initialization part. The latter one can be handled via set statement. This requires a built-in rule. Better wait for a new JML framework.

Workaround until fix You do the split manually to have the full power of JML, e.g.,

void foo() { /*@ghost int x; set x = (\sum ...);*/ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant