Hacker News new | ask | show | jobs
by mpweiher 23 days ago
My (limited) experience from a long time ago: a course on formal specification in Z, after doing various kinds of formal proofs of correctness for both imperative and functional programs in undergraduate classes.

My observation was that in real life, you always start with an informal idea of what the program should do.

And you always have to figure out whether whatever formalization you choose matches that informal idea. And there's a rub:

“One can’t proceed from the informal to the formal by formal means.” — Alan Perlis

I invariably found that matching to be significantly harder with the Z specification than with an actual program.

And since that is (usually) the hard step, making that step harder is a losing proposition even if it makes other steps easier. Which it might or might not.

Of course, the parameters and weights in this chain can vary, and vary sufficiently that you get a different outcome.

However, I think this fundamental and at best difficult-, at worst impossible-to-solve problem is why specification and proof are not used much.