You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was created at git.key-project.org where the discussions are preserved.
For a code fragment such as
/*@ public normal_behavior @ ensures true; (at)*/publicstaticintfib(intn) {
intk0 = 1; intk1 = 1;
//@ ghost int k0_old = k0;//@ ghost int k1_old = k1;/*@ loop_invariant @ n >= 2 ==> ( @ i <= n + 1 && @ k1 == k1_old + k0_old @ ); @ decreases n-i+1; @ assignable \nothing; (at)*/for (inti = 2; i <= n; i++) {
inttmp = k1;
k1 = k0 + k1;
k0 = tmp;
//@ set k0_old = k0;//@ set k1_old = k1;
}
returnk1;
}
...KeY adds the Java statements resulting from setting the ghosts to the wrong places, that is outside the for loop and directly before the return:
for (int i = 2; i<=_n; i++) {
int tmp = k1;
k1=k0+k1;
k0=tmp;
}
k0_old=k0;
k1_old=k1;
I understand that this is probably due to the fact that Recoder needs a statement to assign comments to, and that the next statement after the setters is the return statement, but in any case that is undesired behavior, even more so since a block is left.
This issue was created at git.key-project.org where the discussions are preserved.
For a code fragment such as
...KeY adds the Java statements resulting from setting the ghosts to the wrong places, that is outside the for loop and directly before the return:
I understand that this is probably due to the fact that Recoder needs a statement to assign comments to, and that the next statement after the setters is the return statement, but in any case that is undesired behavior, even more so since a block is left.
Information:
The text was updated successfully, but these errors were encountered: