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

\not_specified #12

Closed
davidcok opened this issue Dec 8, 2021 · 12 comments
Closed

\not_specified #12

davidcok opened this issue Dec 8, 2021 · 12 comments

Comments

@davidcok
Copy link
Contributor

davidcok commented Dec 8, 2021

Can we please deprecate \not_specified?

  • I have never used it explicitly.

  • The default in a clause (in OpenJML anyway) is the same as omitting the clause.

  • Without it, implementation is simpler

  • Without it, explanation to the user is simpler

  • Without it, we don't need to make a distinction between lightweight and heavyweight behaviors.

  • A tool could supply something other than the standard default in place of \not_specified, but that would be better done by changing defaults across the board (to use inference, or some fixed set of defaults that is less conservative) rather than just where not_specified is implicit

Is there a use case for it? It seems to me unneeded complexity/

@leavens
Copy link

leavens commented Dec 8, 2021 via email

@wadoon
Copy link

wadoon commented Dec 8, 2021

I also see \not_specified as deprecated for the use by user. It might still be useful for implementors of JML when building the JML (meta-)model.

There is also the \same keyword. Do you also want to deprecate it?

@mattulbrich
Copy link

mattulbrich commented Dec 8, 2021 via email

@wadoon
Copy link

wadoon commented Dec 8, 2021

But we could also use comments in the stub contract generator, instead of \not_specified

/*@ public normal_behavior
   @  //requires expr;
   @  //ensures expr;
   @  //assignable locset;
   @*/

@mattulbrich
Copy link

Sure. I am happy with deprecating it. Keep the language small!

@leavens
Copy link

leavens commented Dec 8, 2021 via email

@mattulbrich
Copy link

mattulbrich commented Dec 8, 2021 via email

@wadoon
Copy link

wadoon commented Dec 8, 2021

Maybe we should clarify the default "expression", before we bury \not_specified. A contract without an requires clause, has the following implicit value as the pre-condition:

  1. true,
  2. inherits its pre-condition (from contract of the overridden method),
  3. a tool-specific default.

@davidcok
Copy link
Contributor Author

davidcok commented Dec 8, 2021 via email

@davidcok
Copy link
Contributor Author

davidcok commented Dec 8, 2021

Resolved.
\not_specified is deprecated.
Where it would have been explicitly used, just omit the clause
The clauses all have defaults if they are omitted.
This also lessens the cognitive distance between lightweight and heavyweight behaviors, such that we won't continue to make that distinction (though the different kinds of behaviors do have some different defaults). A lightweight behavior is just a regular 'behavior' with the visibility of the associated method.

@davidcok davidcok closed this as completed Dec 8, 2021
@mattulbrich
Copy link

For the record: Let's keep well-defined default clauses for now and talk about inferences and their impact on defaults later. I am skeptical.

@davidcok
Copy link
Contributor Author

davidcok commented Dec 8, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants