News for hackers. Stuff that matters.
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by jasperry on Wednesday March 31, 2021 @08:35AM (#26646419)
Thanks for posting this--I'm getting back into studying the formal semantics of programming languages. Questions for those working in this area:

According to Pierce's Types and Programming Languages, axiomatic semantics of the type that Hoare pioneered are not found as useful today as operational semantics. Is that (still) true?

Are the major approaches (operational, denotational, axiomatic) pretty much solidified now, or are there significant new efforts at finding better overall formalizing frameworks?

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by Joker_vD on Wednesday March 31, 2021 @10:04AM (#26647452)
Right, the axiomatic semantics aka "the Floyd-Hoare rules". The interesting thing about them is that I've read many presentations of them and not a single one of those had any mention of subroutines (procedures or functions, doesn't matter) at all. All you have is global variables, assignments, sequencing, conditions, and loops. That's it. And while one would think that adding support for subroutines would be tremendously useful, allowing for e.g. specifying correctness of data structures' implementations, apparently it has not been done.

The closest thing to it I've seen is TLA+ but holy fatcats is it unwieldy.

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by rssoconnor on Wednesday March 31, 2021 @12:45PM (#26649551)
VerifiableC[1] provides Hoare rules for (a large subset[2] of) C that include function calls, pointers and heap allocation, and some amount of concurrency. It does use an extension to Hoare logic, called separation logic, to achieve some of these features. In particular, separation logic's frame rule is instrumental for the modularization needed for semantics of function calls.

[1]https://vst.cs.princeton.edu/veric/

[2]excludes setjmp/longjmp, unstructured switch statements, goto and maybe a few other moderately exotic constructions.

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.
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by rramadass on Thursday April 01, 2021 @12:43AM (#26656751)
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by auggierose on Wednesday March 31, 2021 @09:24AM (#26646950)
There is only one formalising framework, it is called math. The rest is just noise.

When trying to make a better framework for formalising computer programs, just make a better framework for formalising math first.

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by taeric on Wednesday March 31, 2021 @09:41AM (#26647163)
Math has many formalisms. Some more useful than others, in certain contexts. All restricted by the norms of communication that they are written in.

So, yes, there are some math formalities for processes. No, they probably don't help in finding new processes as much as you'd think. Despite being quite good at understanding existing processes through formal exploration.

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by Joker_vD on Wednesday March 31, 2021 @09:28AM (#26646993)
You can't make a better framework for formalising math, because, as you've yourself said, "there is only one formalising framework", and it's math itself. Cue the problems with self-application and Goedel's tricks :)
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by auggierose on Wednesday March 31, 2021 @09:42AM (#26647181)
Yeah, in a way you are right.

Ok, let me put it this way: Math is not formal. But, formality has its advantages, so what I would like to see is a framework that, while being formal, still allows formulating ideas just as a mathematician would. Kind of like envisioned here: https://www.practal.com

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by dang on Wednesday March 31, 2021 @11:19AM (#26648400)
Hoare's thoughts on the 40th anniversary: https://cacm.acm.org/magazines/2009/10/42360-retrospective-a...

Discussed (barely) at the time:

Retrospective: An Axiomatic Basis for Computer Programming - https://news.ycombinator.com/item?id=905176 - Oct 2009 (1 comment)

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by rramadass on Wednesday March 31, 2021 @12:36PM (#26649407)
Also read Robert Floyd's paper Assigning Meanings to Programs.

After getting the gist of the above, reading Bertrand Meyer's Design by Contract and Applying Design by Contract will clarify on how to apply the ideas to "real" systems.

Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by BruceEel on Wednesday March 31, 2021 @06:16AM (#26645463)
A gem of readability and clarity.
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by cjohansson on Wednesday March 31, 2021 @08:19AM (#26646245)
How does one read it? I simply can't read it, only see the first page
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by d_tr on Wednesday March 31, 2021 @08:52AM (#26646601)
Did you try more than one viewer? It renders fine in Evince and in Vivaldi here. The 'bodies' of the pages are not regular text but images over that background gradient, by the way.
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by baxrob on Wednesday March 31, 2021 @09:33AM (#26647053)
Works for me but found this less unusual pdf: http://www.cs.toronto.edu/~chechik/courses05/csc410/readings...
Re:An Axiomatic Basis for Computer Programming (1969) [pdf] by tjalfi on Wednesday March 31, 2021 @10:12AM (#26647558)
(submitter)

Thanks, I have asked dang to update the link.