by unboxed_type · 9y ago · 0 comments
I think the phrase 'reliable systems' is more appropriate to what you are up to, as opposed to the phrase 'correct systems' which usually corresponds to formal verification.
What you can't close is the language that you use to do all the verification in, itself. You wind up with a core calculus that you have to stare at really hard and trust / prove via other means.
http://www.cs.utexas.edu/users/jared/milawa/Web/
The other approach I investigated was proving the logics sound in set theory given it's well-understood, trusted, and widely deployed by mathematicians. Once the logics like FOL or HOL are verified, we just have to verify the specs and checkers (already done to in progress). Run on diverse hardware to prevent glitches there. From then on, mainly just look at logical specs since we should be good. I also found a verified compiler that uses Z specs with Prolog code... a method that might be used with Milawa for bootstrapping trust.
It's always possible there is a loop somewhere. The best you can hope for is make it infinitesimally small.
http://www.cse.chalmers.se/~myreen/
Follow he and his colleagues work for all that. Especially Milawa and CakeML. If you want a starting point, a small, Forth-like processor verifiable by hand on a node verifiable by eye could run the initial interpreter and prover for the first, real CPU. Plus, common practice is to split work into untrusted generation of artifacts with traces that are verified by a trusted checker that's comparatively tiny and simple. The little CPU would just run the checkers. You can run the generation on anything you like with the speed benefit. :)
As far as I understand modern truly reliable system (commerical avionics-like) still must be relatively simple to be verified up to hardware level.
[1] https://www.sosy-lab.org/~dbeyer/verification-witnesses/
https://wwwbroy.in.tum.de/~berghofe/papers/TYPES2002_slides....
[Fixpoint terms are also CIC programs, so there's a sense in which they're related, but it's not really about Curry-Howard.]
But the reality of formal verification is that we simply do not yet have the capability -- with any tool -- to formally specify and verify a large, complex software system end-to-end (namely, from high-level global correctness properties and all the way down to machine code). There are two options: either use tools that can do end-to-end verification like Coq and Isabelle and limit yourself to small software, and even then expend an inordinate amount of effort (like seL4 or CompCert, small programs that have been verified end-to-end, taking years), or use any verification tool (be it Coq or TLA+) for a high-level specification and verification without extending it end-to-end, for a lowered confidence. If you like, you can augment that with code-level specification -- like JML (Java), ACSL (C), SPARK (Ada) etc..
[1]: https://link.springer.com/chapter/10.1007/978-3-319-17581-2_...
There's also ASM's and equational methods that allowed specification or verification of instructions or their use to happen in days when the tooling was already adequate. I wouldn't use TLA+ for this unless we're talking about concurrency. Even then, I'd be using it in combination with something else.
You might also find it interesting that one group embedded TLA+ in a sound prover (HOL?) for making the TLA+ analysis sound. They extended it in some way, too. Anyway, the got the benefits of both with that combination. So, some weaknesses in the tooling can be knocked out over time if more people just put labor in.
Supplementing a high-level verification with code-level specification tools is always possible, but, again, everything here is a matter of the required confidence vs. affordable cost. Additional confidence always comes with additional cost.
https://en.wikipedia.org/wiki/SPARK_(programming_language)
http://www.electronicdesign.com/industrial/rust-and-spark-so...
Here's an example of combining Event-B with SPARK to split overall verification between tools with each handling what they're good at:
https://pdfs.semanticscholar.org/481c/d4d2409115429f4b824f37...
Runtime checks are good as to prevent something from happening, but they are not able to guarantee the absence of an error in the first place, right?
http://www.cambridge.org/us/academic/subjects/computer-scien...
Ada/SPARK has parallel computations defined at language level, known as tasks.
Nevertheless, you're never certain doing that, either, as you don't formally tie the code-level specification to the high-level specification. That's OK, though, because end-to-end specification is neither required for most software nor currently possible for anything other than small, relatively simple software.
Languages that truly admit full automatic verification (and are also limited) -- including rich global correctness properties -- are synchronous languages for safety-critical realtime, like SCADE. BTW, SPARK contracts are not so rich. There are many useful properties that you can't express.
I agree there are some missing links, but checking your model before doing detailed implementation is a good idea regardless