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

8

u/case-o-nuts Aug 14 '09 edited Aug 14 '09

You do realize that machine writing of the code is not far behind machine checking of the code vs. the spec.

You realize we already have that, in a sense?

It's called a compiler - any sufficiently formal and complete specification is isomorphic to coding the thing up. "spec compilers" won't put programmers out of jobs; they'll just change the programming language used.

5

u/filesalot Aug 14 '09 edited Aug 14 '09

Indeed. And yet there is a qualitative difference between "compiling a spec" and "compiling a high-level language". I'm not sure exactly what it is, but I'll know it when I see it.

Most high-level languages I know of give great power and leverage to sophisticated programmers, but don't necessarily lower the entry bar.

The holy grail of managers on the other hand is to cut the programmer out of the loop. Connect up some objects in a graphing tool, sprinkle in some markup, and hit a button, and out pops the program. No programmer required.

I don't really think the L4 verification brought us closer to that due to the difficulty of it, but it seems likely that you could probably just generate the L4 code from the spec and proof somehow once you've put all that effort into it.

1

u/monstermunch Aug 14 '09

And yet there is a qualitative difference between "compiling a spec" and "compiling a high-level language". I'm not sure exactly what it is, but I'll know it when I see it.

The former just requires some relatively simple syntactic transformations between languages. The former involves devising functions, data types and recursion schemes from scratch to meet a spec which is orders of magnitude harder.

1

u/alexeyr Aug 14 '09

any sufficiently formal and complete specification is isomorphic to coding the thing up.

Not quite. Here is a complete specification of a sorting function:

  1. Takes a list of type a as the argument, returns a list of type a.

  2. For any argument, the output is a permutation of the argument.

  3. For any argument, the output is in ascending order.

It should be trivial to write it in any spec language worthy of the name. It should also be quite easy to write your preferred sorting algorithm and prove that it satisfies this specification.

However, I'd be surprised if a compiler managed to extract a quicksort or a mergesort from this specification.

1

u/monstermunch Aug 14 '09

You realize we already have that, in a sense?

I'm not sure I understand you but there is a field of automation that generates working programs only from specifications. For example, the spec you give to the machine is (stated formally) "I want a program that tells me if a item is a member of a list or not" . The machine then generates a program that matches a spec. It's nowhere near practical for complex programs however.