You are viewing archived messages.
Go here to search the history.

Kartik Agaram 🕰️ 2025-08-02 07:11:45

This might be premature, but I think I finally understand Dijkstra's approach to deriving programs from post-conditions in "A Discipline of Programming". I've had this book on my bookshelf for almost 20 years, never understood it but also never quite worked up the will to toss it out. (For context, I only own like a dozen books over the long term.)

Concretely, I've made it to the end of Chapter 7. I feel like I understand every bit up until this point.

Parts of Chapter 6 and 7 feel very sloppily written! And this is Dijkstra! So either my leaps of interpretation are only leaps because I'm missing something, or my sense of understanding is an illusion 😅

Has anyone here made it this far and feel like they understood it? I'd love to talk to you.

Incidentally: I wouldn't have made it in even this my probably 4th attempt, if it wasn't for LLMs. They're better than a rubber duck for talking things over with! It's amazing that they can all converse intelligently about the Dijkstra method, and all I need to do is mention wp or wdec . Or I know nothing and am incapable of judging anything about this book.

Joel Neely 2025-08-03 22:22:51

Hi, Kartik, I'd be very interested in having a conversation about Dijkstra's book. I still have my copy that I ordered as soon as I could after it was published. Working through that book (one works it instead of reading it 🙂) profoundly changed my perspective on programming.

I find it highly ironic that some people who have been critical of formal methods (or even of Dijkstra's style and content) are also proponents of TDD. I have long thought that both ADoP and TDD emphasize using reasoning about correctness as part of the design process (although I continue to believe that Dijkstra's method is potentially more robust, for a variety of reasons).

I'm curious as to what about chapters 6 (designing for termination) and 7 (Euclid's algorithm revisited) left you uncomfortable.

I hope we can connect.

Joel Neely 2025-08-09 22:14:41

I hadn’t thought about your before-and-after interpretation in quite that way. I’ll have to ponder a bit.

Regarding your reference to determinism, only some constructions in EWD’s wp-based notation are deterministic! While some cases (e.g. x := 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.

Jasmine Otto 2025-08-04 22:14:52
Nilesh Trivedi 2025-08-06 08:06:51

Prof Eric Hehner's April 2025 article on interpreting the Halting Problem:

cs.utoronto.ca/~hehner/Boxes.pdf

image.png

Nilesh Trivedi 2025-08-06 08:40:47

Here is the crux of the argument: Translating programs from one language to another, changes their correctness when self-references is involved.

image.png

Nilesh Trivedi 2025-08-06 11:37:04

Context-Dependent Functions: arxiv.org/pdf/1501.03018

image.png

When Leggett 2025-08-06 15:44:10

This feel like an appropriate time to bring in Douglas Hofstadter and Metamagical Themas.

I immediately though of his question: How would you translate the following sentence to Chinese: "This sentence is in English"

Konrad Hinsen 2025-08-07 09:34:35

Having done some translating long ago, I can answer that question: it depends on context. You need to figure out what the role of "English" is in this context, and then pick one out of mainly three options:

  • Keep "English"
  • Replace by "Chinese"
  • Reformulate the surrounding paragraph to convey the intended message in a different way.
When Leggett 2025-08-07 10:01:02

For sure - the point about the sentence is recognizing that its self-referential, and how that creates a new meaning not purely conveyed by a direct translation of the words. I thought that was interesting relating to:

Here is the crux of the argument: Translating programs from one language to another, changes their correctness when self-references is involved.

Guyren Howe 2025-08-07 23:50:44

The crux of a universal computer is that you can write an interpreter for any programming language in any Turing Complete programming language. The halting problem is just a mathematical truth, and it is equivalent to Gödel’s Incompleteness Theorem.

misha 2025-08-08 13:29:12
  • if you need to run program and wait for it to finish to know whether it halts or not (sync) – language of test implementation and running it in different process/machine - is irrelevant.
  • if you think you can tell just by analyzing source code (async): if program involves any outside data – there is always a chance an irreducible computation is required, which can be done only by running program, goto 1.