Simpler sort syntax - #3957
Conversation
d374d8d to
4e789c9
Compare
|
I really like this feature. However, we should consider the following (motivated by experience with VeriFast, compare also to verifast/verifast#271): Assuming we want to lift this syntax into JML (for instance for ghost fields and model methods), it might be unexpected for the user that the A class List<T> {
//@ ghost \seq<T> absVal;
//@ ensures absVal == \old(absVal) ++ (t); // <-- This is ok.
void add(T t) {
..
}
//@ ensures \result == absVal[i]; // <-- Probably still ok here ...
//@ assignable \nothing;
T get(int i) {
..
}
} |
|
Actually, in the example above it might not be a problem, because T in the ghost field is inside the scope of the class, so it is actually the same T here. |
|
The consensus is that this PR should be merged once ready. |
|
Wolfram's point was already discussed some time ago, where we discovered that the implicit upper bound between Java ( Let us assume the following: The following is valid We discussed the introduction of additional type parameter parentheses. But maybe playing around with JML/Java syntax could avoid the confusion:
|
39be615 to
1396236
Compare
Intended Change
This PR suggests changing the type parameter syntax from
T<[X]>toT<X>for readability reasons.(The original syntax was suggested to avoid parser problems wrt implicit identifiers like
<init>.)Plan
>=and>>toStringmethodsType 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.