What does that mean for those of us that follow the formal methods at a high-level?
What does that mean for those of us that follow the formal methods at a high-level?
Obviously, there are also other approaches to formal methods that are not built upon type theory. However, my experience is that the type theorists have been incredibly productive, so if you spend enough time doing formal methods you'll probably find some work done in the type theory tradition that's useful or relevant to any particular approach.
+ I'm not a type theorist and have reason to believe that certain type theorists would perhaps disagree with this characterization for reason that would be rather difficult for a non-type-theorist to understand, but hopefully this gives you a rough idea.
Also, it's worth noting that those in the Milner tradition see their agenda as being far more than just one approach toward formal methods, and also as not being principally about types. But thinking about that tradition in terms of Coq et al. and props-as-types is the best way to understand its place in Formal Methods.
They have, but much less so than people in the "temporal logic tradition". Type theory-based formal methods are virtually nonexistent in the industry (and the word virtually could probably be replaced with literally if we don't count joint industry-academia projects), while temporal logic is used to verify thousands of applications every year. The reason you see fewer papers is precisely because the approach is less mature. On the other hand, you find that papers using more traditional approaches are more cited (e.g., Lamport's first TLA paper alone has many more citations than any paper on type theory ever).
It is true, however, that PL theory is about much more than just formal methods (it is first and foremost about programming languages). The problem they're tackling is much harder and more ambitious, but so far they've had little success in the field.
I mean, all of the ML-derivative languages are in very wide-spread use. I guess you could argue that type systems aren't formal methods, but I'd disagree -- especially in the case of systems with effective type inference, which is essentially a bit of theorem proving baked into your language.
I would guess that Algorithm W (and derivatives) are the most successful and most widely used formal methods tool in the world today.
> ...if we don't count joint industry-academia projects
The same is true for most formal methods (FWIW I consider MSR and similar labs squarely in the "academia" side of that divide...) It's not even clear to me that this is a bad thing, actually. Maybe for highly critical systems it makes sense for companies to contract with boutique formal methods firms.
More generally, what I meant by "incredibly productive" is that a lot of the ideas in their work are equally applicable to other systems that aren't in that tradition. So that even if you aren't working the Milner tradition (which I man not), you may still find this work worth knowing about and borrowing from (which I do).
The kind of properties those type systems that are in relatively widespread use prove are not even remotely close to those you'd call "program correctness".
> I would guess that Algorithm W (and derivatives) are the most successful and most widely used formal methods tool in the world today.
OK, but that's an extremely weak formal method; weaker than some static analysis tools, that are also in widespread use.
> The same is true for most formal methods
Not really. SCADE is quite popular in safety-critical hard realtime systems, and TLA+, while far from "popular" is being regularly used at Amazon, Oracle and smaller companies without any assistance from academia. Other tools, like Z and Ada SPARK (both used by Altran), B-Method (popular in railway software) or SPIN are also regularly used in the industry.
> you may still find this work worth knowing about and borrowing from (which I do).
Sure, but it goes both ways. I've seen a paper about proving the correctness of some control systems for quadcopters in Coq, and they basically used Lamport's TLA in Coq.
To Lamport, and algorithm is an abstract mathematical concept. A computation is discrete dynamical system (analogous to a continuous dynamical system), which is generated by a machine (an algorithm), which expressed mathematically in a simple, almost-ordinary-math way, almost exactly like dynamical systems are expressed as ordinary differential equations. Reasoning is done entirely semantically (the syntax of Lamport's formalism isn't a programming language, and its semantics are simple mathematical semantics -- again, like ODEs).
Lamport's approach is best explained in the link I posted above (which is a very interesting read) and in section 6.3 of this paper (also an easy read, at least that section): http://research.microsoft.com/en-us/um/people/lamport/pubs/l...
In the conversation with Meijer, Lamport explains that he believes that "linguistic reasoning" 1. requires far more complicated math ("weird, computer science math", like domain theory, category theory, type theory etc.) but, in his opinion, that math doesn't really make reasoning about the algorithm any easier.
All I can say personally is that I find Lamport's view to be a more natural fit with how I think of algorithms (this is entirely subjective), and that learning his formalism to the level where you can specify and reason about very large, very complex real-world systems takes a "plain" engineer maybe two weeks of self study, while learning the more PL-based approaches to reach that level would take a programmer years. This is pretty objective. I can also say that I occasionally see academic papers that describe how to express and reason about some simple properties (like worst-case complexity) in Coq, which would be almost trivial for a TLA+ practitioner, no more than a month after first laying eyes on TLA+. So for me, at least, the difference is a pragmatic one.
I'm not from the Milner tradition, but I disagree with your criticisms of that tradition.
I think the key difference between TLA+ et al and the Milner tradition is automation.
In the Milner tradition, the automation follows sort of systematically from a proper formulation. So if you find the "right" way of formulating worst-case complexity, you get a lot more than just a way to state and hopefully prove some particular property -- you also get a way of automatically inferring that property and a sort of systematic way of baking your results into compiler infrastructure. This insight is perhaps masked by the fact that you can also formulate arbitrary properties in arbitrary styles in a dependent type theory... so to put it another way, the evidence for the fact that ML type systems are well-designed is the unification algorithm, not the type checker.
The TLA+ (et al.) story about automation is mostly "model checkers and invariant generators". In other words, the "hard stuff" is typically exogenous to the specification system/language. I know you might claim that model checking is sufficient, but I have a lot of experience with that approach and I respectfully disagree -- in part because the Milner tradition has produced a lot of insights that are often baked into model checkers and invariant generators. But also because this approach has fundamental scaling issues and designing around those constraints requires much more skill than advertised.
So while it's true that the type theory tradition is more difficult to understand, it's also true (IMO) that if you get something "right" in that tradition, it's far more powerful than getting something "right" in the TLA+ tradition.
> In other words, the "hard stuff" is typically exogenous to the specification system/language.
1. I don't think that's the hard stuff. It's some other hard stuff.
2. Even in the PL approach, that hard stuff is mostly theoretical today.
> the Milner tradition has produced a lot of insights that are often baked into model checkers and invariant generators
I don't know about that. You may be right, but I don't think that's the case. AFAIK, most of that work -- and its inspiration -- is done by people who work with programs and logic, and not PLT.
> But also because this approach has fundamental scaling issues and designing around those constraints requires much more skill than advertised.
That's true, but the deductive approaches currently suffer from much greater scaling issues. Even Xavier Leroy, who, AFAIK, is the only person who ever managed to do an end-to-end verification of a non-trivial real-world program in Coq, says that model checkers work on larger problems than manual deduction (not that it matters; both model checking and manual deduction can be done in either approach, using very similar algorithms).
> if you get something "right" in that tradition, it's far more powerful than getting something "right" in the TLA+ tradition.
I'm not entirely sure what you mean. Proving correctness is the same in both approaches. It's all just logic. The benefit of program extraction is currently theoretical. The benefit of end-to-end verification is real, but end-to-end verification is so costly, and can work on such small programs, that it's a very specialized activity, and one that is explicitly outside the scope of TLA+ (although end-to-end has been done in TLA+, too).
I don't think that anyone would disagree that if one day a programming language that can both be used to affordably reason about programs -- as affordably as TLA+ -- and could at the same time be compiled to efficient machine code, and perhaps also significantly assist with the programming process itself, that would be a great thing. But there's no such language on the horizon.
Don't get me wrong: the work done in PLT is ambitious and extremely important. But TLA+ is an affordable way to "just" reason about programs today. It works because it's undertaken a far simpler task. But a simple, useful solution to a hard problem that works is more important for practitioners, today, than a much bigger problem, with an unclear solution, that may work one day in the far future.
His alternative or-composition rule looks strange to me, since given either A or B it is entirely subsumed by simple implication, but his rule still seems to need both..? Or am I missing something about his notation?
Section 6.3 also contains unsubstantiated claims about what is "popular among computer scientists" and what "many computer scientist" do or that they "denigrate the use of ordinary mathematics". I mean, this guy knows who he is talking about, why not call them out on the specifics? (He does reference one paper, and then attacks it by comparing it to a specification he worked on, which he does not reference.)
He's obviously way smarter than me, and I think I understand his general position, but it's hard to get at his arguments when he wraps them in some much hostility.
Personally I'm more interested and fascinated by the stuff going on in the Milner camp, so I'm obviously biased against him. But I do think the most fruitful approach is to have many people working in different directions and seeing what falls out, instead of trying to prove a priori that a research direction is useless.
Oh, that article is especially trollish, but there are articles like that in both camps.
> His alternative or-composition rule looks strange to me, since given either A or B it is entirely subsumed by simple implication, but his rule still seems to need both..?
It's not about "needing" both, but about how proofs are decomposed. Sometimes you need to prove `A ∨ B ⇒ C`; that's your proof goal. To do that, you prove `A ⇒ C` and `B ⇒ C`. That's all. If you look at basic texts about formal reasoning, they're full of such rules (see, e.g. https://en.wikipedia.org/wiki/Natural_deduction)
But from a pragmatic perspective, I think this is clear: if you want to formally reason about large, real-world programs today (especially if they're concurrent or distributed) "Lamport's" approach is the only affordable way to do it. It is also mathematically simple, very elegant and fun. Whatever you're interested in academically, it also covers the most important concepts anyway (refinement/abstraction relations, inductive invariance), and, in the end how you work and think is basically the same.
Do you have any examples?
>Sometimes you need to prove `A ∨ B ⇒ C`; that's your proof goal. To do that, you prove `A ⇒ C` and `B ⇒ C`. That's all.
Yeah, I was just confused, it's just or-elimination with a different notation.
https://existentialtype.wordpress.com/2011/03/16/languages-a...
https://www.quora.com/What-is-Lambda-Calculus-in-laymans-ter...
I wrote about some aspects of this mutual... hmm... let's call it skepticism here: https://pressron.wordpress.com/2016/08/30/what-we-talk-about...
There is one case in which it’s worth doing the extra
work: when the computer does a lot of it for you.
[..]
In that case, the extra work introduced by decomposition
will be more than offset by the enormous benefit of using
model checking instead of human reasoningThere are several motivations for the PL approach: 1. an executable can be extracted from the code -- i.e., it can be compiled to an efficient program, 2. they believe that reasoning with syntax is easier, and 3. high-level reasoning could potentially assist in writing parts the program automatically. Lamport completely disagrees with point 2, and as to point 1, he says that had a language that could both reason about programs affordably and be compiled efficiently existed that would be great, but currently this is not the case. So he believes that they're sacrificing the simplicity of reasoning in a major way for the goal of having both programming and reasoning done in the same language. He may agree that it's a worthy goal, but one that we're currently far from attaining. He's interested in things that work on real-life software today. He says that how you program and how you reason about programs should not necessarily be the same, and if making them the same makes either of them significantly more complicated than would be possible when keeping them separate, then we should keep them separate.