comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Verified compilers?
Date: Wed, 7 Mar 2012 19:06:28 -0600
Date: 2012-03-07T19:06:28-06:00	[thread overview]
Message-ID: <jj90mm$ciq$1@munin.nbi.dk> (raw)
In-Reply-To: 15276255.3865.1331124143041.JavaMail.geo-discussion-forums@vbze11

"Stuart" <google_news@palin-26.freeserve.co.uk> wrote in message 
news:15276255.3865.1331124143041.JavaMail.geo-discussion-forums@vbze11...
On Tuesday, 6 March 2012 01:27:25 UTC, Randy Brukardt  wrote:
...
> I admit I have not read the report yet - so I am unaware of the scope of 
> the 'formal verification';
> and Randy's post does point out other areas where errors creep into the 
> compilation process.
> That said, there is still an issue in safety-critical applications of 
> constructing a robust and
> compelling safety case, particularly covering the compilation process. 
> This would seem to be
> something that would aid in such cases.

I thought about that some after posting my reply. I probably was a bit too 
flippant. The real problem is that the only languages that can practically 
be verified are extremely simple, and I suspect it usually would be a bad 
idea to code large systems in such languages. (All of the advantages of a 
language like Ada -- or even C++ -- would be thrown away. After all, that's 
my complaint about SPARK, and this would be many times worse.)

...
> Whichever stage of the compilation process is at fault, [in my experience] 
> there are usually
> a number of target code faults associated with fairly mature compilers and 
> these cases have
> to be managed by the safety case and development processes.

True enough. But I don't think that it would be all that practical to verify 
an entire compiler for a real programming language. Moreover, I doubt that 
it would take any special architecture to do so, just a reasonable 
partitioning of concerns. It surely would be "easy" to verify the 
translation of our intermediate code to machine code (particularly if small 
simplifications were made in both; a formal definition would be needed for 
the intermediate code, but that would not be hard to do - it's already 
defined by Ada source code and carefully documented in English). It probably 
would be practical to verify the intermediate code transformations of an 
optimizer (not ours, however). Verifying the translation of raw syntax to 
intermediate code would be harder, and would mainly depend on a formal 
definition of the source language (which as noted, would be impossible to 
provide for any real language; part of the problem being that no human could 
understand it well enough to know if it is right -- so would verifying that 
it is translated properly really provide any benefit??).

> Getting people with the experience at both the high-level source and 
> low-level target code
> to review compilation issues is becoming increasingly difficult.  A 
> technique that provides
> alternatives in verifying the compilation process are attractive.

Understood, but as noted I'm dubious that this would really help. You could 
verify *some* language, but whether it really was the same language that you 
wanted would be impossible to tell. I suppose if you could hook up a 
SPARK-like verifier to it, you could see if your program did what you want 
based on the formal description  -- whether that actually matched the 
expected semantics or not -- but that would require describing the intended 
outputs of your program in the language of the formal description, and I'm 
dubious that you could understand *that* well enough to tell if it really 
did what you want.

And if you succeeded in doing that, you no longer need the program itself --  
it's just an artifact, you might as well directly translate the formal 
specification into code -- at which point you have to start the entire cycle 
again. (Can you tell that I think trying to verify everything is a waste of 
time, not matter what it is??)

Anyway, it's certainly true that some programming problems need 
extraordinary measures. And I suppose for those people, this sort of thing 
will appear to be a new silver bullet. But of course there is no silver 
bullet for programming - it's hard, it is going to remain hard, and worrying 
too much about the compiler when the source program is hardly verified at 
all makes little sense.

                                                        Randy.





  reply	other threads:[~2012-03-08  1:06 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-21 15:42 Verified compilers? Yannick Duchêne (Hibou57)
2012-02-24  1:41 ` Shark8
2012-02-24  8:52   ` Georg Bauhaus
2012-02-24 17:36   ` Peter C. Chapin
2012-03-06  1:27 ` Randy Brukardt
2012-03-06 17:24   ` Shark8
2012-03-06 17:43     ` Dmitry A. Kazakov
2012-03-06 19:03       ` Shark8
2012-03-07  5:33       ` Yannick Duchêne (Hibou57)
2012-03-07  9:12         ` Dmitry A. Kazakov
2012-03-07 17:49           ` Niklas Holsti
2012-03-07 20:17             ` Dmitry A. Kazakov
2012-03-07 23:28               ` Usefulness of Formal Notions in Programming (was: Verified compilers?) Georg Bauhaus
2012-03-08  9:24                 ` Usefulness of Formal Notions in Programming Dmitry A. Kazakov
2012-03-08 10:30                   ` Nasser M. Abbasi
2012-03-08 12:37                     ` Dmitry A. Kazakov
2012-03-08  0:42               ` Verified compilers? Randy Brukardt
2012-03-08  9:25                 ` Dmitry A. Kazakov
2012-03-08 18:10                   ` Niklas Holsti
2012-03-08 20:41                     ` Dmitry A. Kazakov
2012-03-08 18:02               ` Niklas Holsti
2012-03-08 20:40                 ` Dmitry A. Kazakov
2012-03-09  0:44                   ` Georg Bauhaus
2012-03-09 22:13                   ` Niklas Holsti
2012-03-10 10:36                     ` Dmitry A. Kazakov
2012-03-10 20:35                       ` Niklas Holsti
2012-03-11  9:47                         ` Dmitry A. Kazakov
2012-03-11 22:22                           ` Niklas Holsti
2012-03-12  5:12                             ` Niklas Holsti
2012-03-12  9:43                             ` Dmitry A. Kazakov
2012-03-14  8:36                               ` Niklas Holsti
2012-03-14  9:24                                 ` Georg Bauhaus
2012-03-14 11:14                                   ` REAL (was: Verified compilers?) stefan-lucks
2012-03-14 12:59                                     ` REAL Dmitry A. Kazakov
2012-03-14 13:30                                       ` REAL Georg Bauhaus
2012-03-14 13:51                                         ` REAL Dmitry A. Kazakov
2012-03-14 20:37                                           ` REAL Brian Drummond
2012-03-14 21:52                                             ` REAL Dmitry A. Kazakov
2012-03-14 13:52                                         ` REAL georg bauhaus
2012-03-14 17:42                                         ` REAL Jeffrey Carter
2012-03-14 10:14                                 ` Verified compilers? Dmitry A. Kazakov
2012-03-14 20:13                                   ` Niklas Holsti
2012-03-11 10:55                         ` Georg Bauhaus
2012-03-10 13:46                     ` Brian Drummond
2012-03-07  1:00     ` Randy Brukardt
2012-03-07 12:42   ` Stuart
2012-03-08  1:06     ` Randy Brukardt [this message]
2012-03-08  9:04       ` Jacob Sparre Andersen
2012-03-08  9:37         ` Dmitry A. Kazakov
2012-03-08 11:23           ` Simon Wright
2012-03-08 12:27             ` Dmitry A. Kazakov
2012-03-08 10:23         ` Brian Drummond
2012-03-08 23:38           ` Bill Findlay
2012-03-09 13:56             ` Brian Drummond
2012-03-09 14:43               ` Shark8
2012-03-09 21:51                 ` Brian Drummond
2012-03-09 15:49               ` Bill Findlay
2012-03-09 20:34                 ` Brian Drummond
2012-03-09 19:40               ` Jeffrey Carter
2012-03-09 20:39                 ` Brian Drummond
2012-03-09 23:59               ` phil.clayton
2012-03-08 15:23         ` Peter C. Chapin
2012-03-09  2:04         ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox