I've recently read the following JML code in an old exam:
Class L {
/*@non_null*/ int[] a;
/*@ public normal_behaviour
@ requires !(\exists int i; 0 <= i && i < a.length; a[i] == d);
@ ensures a.length == \old(a.length) + 1;
@ ensures a[\old(a.length)] == d;
@ ensures (\forall int i; 0 <= i && i < \old(a.length);
a[i] == \old(a[i]));
@ assignable a, a[*];
@*/
public void st(int d) {
...
}
}
I don't understand the
assignable a, a[*];
part. What does a[*]
mean? What would be different if there was only
assignable a;
?
(A link to a reference would be great.)