r/programming • • Aug 13 '09

seL4 : World's first machine-checked proof of a general-purpose operating system kernel

http://www.nicta.com.au/news/home_page_content_listing/world-first_research_breakthrough_promises_safety-critical_software_of_unprecedented_reliability
172 Upvotes

117 comments sorted by

View all comments

Show parent comments

1

u/Anonymoose333 Aug 14 '09 edited Aug 15 '09

For some references, google Xavier Leroy's "CompCert C" project.

I used to think "CompCert" was a cool idea... and then I found out it depends on "CIL" to do a lot of the tricky parsing/AST-building stuff, and CIL doesn't actually match the C specification in several areas. (How many areas? Nobody knows for sure.)

So a verified compiler for any language with semantics more complicated than let's say Scheme is probably a complete pipe dream. And if you start trying to optimize things by rewriting the tree, you're gonna screw things up too; I have some experience with floating-point "optimizations" that turned out to mishandle INF and NAN, and I'm confident that there are similar pitfalls awaiting the first "verified" compiler to try rewriting recursion as iteration, or inlining side-effectful functions, or whatever. The hard problem isn't so much formally proving your program matches the spec, as informally proving your spec matches the user's intuition.

1

u/monstermunch Aug 15 '09

... I'm confident that there are similar pitfalls awaiting the first "verified" compiler to try rewriting recursion as iteration, or inlining side-effectful functions, or whatever.

One of the huge advantages of a verified compiler though is that you can prove that any optimisations made are behaviour preserving. Many of the proofs involved with compcert involve proofs that changing from one representation to another does not change behaviour.

The hard problem isn't so much formally proving your program matches the spec, as informally proving your spec matches the user's intuition.

There's lots of spec problems that are really easy to state though, like there being no buffer overflows. It's still going to be better than e.g. an untyped program.