News for hackers. Stuff that matters.
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by Joker_vD on Wednesday March 31, 2021 @02:41PM (#26651252)
No goto? Funny, but there is actually a Hoare rule for goto (by Hoare himself), and a rather straightforward one:

      { pre(L) }  S;  { P }
    ------------------------
    { pre(L) }  L: S;  { P }
    
    
    { pre(L) }  goto L;  { false }
You just have to use the same precondition pre(L) for every mention of the label L.

There are no comments on this comment yet.