NOTE: This transcription was contributed by Martin P.M. van der Burgt, who has devised a process for producing transcripts automatically. Although its markup is incomplete, we believe it serves a useful purpose by virtue of its searchability and its accessibility to text-reading software. It will be replaced by a fully marked-up version when time permits. —HR
Yet another note about termination.
I had never thought that I would have to write this note, but apparently I have to. In a paper I had written:
“For each repetitive process we must have a monotonicity argument on which to base our proof of termination.” |
Because perhaps my Editor’s hesitation was caused by the nondeterminacy that also played a role in that paper, let us consider the general —and in general nondeterministic— repetitive construct DO:
do B1 → S1 ▯ ... ▯ Bn → Sn od . |
{if B1 →S1 ▯ ... ▯ Bn → Sn fi}* or {IF}* |
(mn(x) > 0) ⇒ (mn(F(x)) ≤ mn(x) -1) . |
Note. If F(x) is a single valued function, the program is deterministic and the maximum number of steps needed is also the actual number of steps needed; and then we have
(mn(x) > 0) ⇒ (mn(F(x)) = mn(x) - 1) . (End of note.) |
Hence, for all initial states in which termination is guaranteed to occur, the finite function mn(x) which decreases monotonically by at least one at each application of x:= F(x) exists; conversely: each proof of termination boils down to a proof of the existence of such a monotonically decreasing function.
* *
*
Because my challenged claim is one about all possible arguments for termination, a less operational approach that is directly based on the axiomatic definition of the repetitive construct might be appreciated.
For the repetitive construct DO the predicate transformation —see [1], page 35— is given in terms of the predicate transformation of the corresponding alternative construct IF by
H0(R) = R and non BB | ||
Hk+1(R) = wp(IF, Hk(R)) or H0(R) | (2) | |
wp(DO, R) = (E k: k ≥ 0: Hk(R)) . |
(P and t ≤ k) ⇒ Hk(T) for all states x |
(P and BB and t ≤ t0+1) ⇒ wp(IF, t ≤ t0) |
[1] Dijkstra, Edsger W., “A Discipline of Programming”. Prentice Hall, 1976
Plataanstraat 5 | prof.dr.Edsger W.Dijkstra |
NL-4565 NUENEN | Burroughs Research Fellow |
The Netherlands |
Transcribed by Martin P.M. van der Burgt
Last revision 2014-12-12 .