Kartik Agaram
wp or wdec. Or I know nothing and am incapable of judging anything about this book.Joel Neely
08/03/2025, 10:22 PMKartik Agaram
wdec("x := x + y") under the metric t = abs(x-y), Dijkstra calculates:
tmin(x, y) <= t(x, y) - 1
(I find it helpful to explicitly add the (x, y) to remind myself that t is a function.)
This he then simplifies to:
x <= abs(x-y) -1
If I understand correctly, the left hand side of the inequality is just the value of t after x := x + y has run.
tmin(x, y) = abs(x+y - y) = abs(x)
=> x, since x > 0 by the preconditions of the chapter/problem
This I never understood until now, and I think I've always been thrown off by the "min" in the name "tmin". It seems to me clearer to call it t(x', y') where x' and y' are the values of x and y after x := x + y has run.
t(x', y') <= t(x, y) - 1
abs(x+y - y) <= abs(x-y) - 1
etc.
I suppose my two questions are:
⢠Am I on the right track? And,
⢠Does this approach seem clearer to you?
I don't really understand the name tmin. Dijkstra introduces it in Chapter 6 as, "the lowest upper bound for the final value of `t`". There's a "min" and a "max" there, and also a "final". If I had to choose a new name, I'd call it t_after or something like that. Perhaps the lack of subscripts affected the choice of name, since "after" starts with a vowel..Kartik Agaram
Jasmine Otto
08/04/2025, 4:59 PMtmin is defined like a supremum (least upper bound). I don't know how Djikstra 1976 constructs that as a postcondition we can reason about, how excitingKartik Agaram
t can have.Joel Neely
08/09/2025, 3:10 PMJoel Neely
08/09/2025, 3:13 PMJoel Neely
08/09/2025, 3:31 PMJoel Neely
08/09/2025, 10:14 PMx := x-y) are, EWDâs reasoning makes some kinds of determinism a not-very-interesting special case. The âAha!â moment for me was his solution for max in c := a max b.
if
a >= b -> c := a
[]
b >= a -> c :- b
fi
In the (again, uninteresting) special case that a = b, both guards are true it is perfectly valid to âperformâ either of the two guarded commands.Kartik Agaram
Joel Neely
08/17/2025, 1:19 PMJoel Neely
08/17/2025, 1:21 PMKartik Agaram
Joel Neely
08/17/2025, 9:40 PM