Thread View: comp.lang.misc
2 messages
2 total messages
Started by Dave Gillett
Mon, 13 May 1991 19:19
Proving correctness of programs in functional languages
Author: Dave Gillett
Date: Mon, 13 May 1991 19:19
Date: Mon, 13 May 1991 19:19
33 lines
2064 bytes
2064 bytes
In <ROCKWELL.91May10205204@socrates.umd.edu> rockwell@socrates.umd.edu (Raul Rockwell) writes:
>This is related to proving a program correct.
>I should note that functional languages seem to be rather promising
>in this regard.
I consider that an extreme understatement.
When we define our domain of discourse to be functions, which accept
inputs and produce (we hope!) results, we are able to express the necessary
properties for verification of each function in terms of predicates linking
properties of the inputs to properties of the results. Composition of
functions leads to combination and simplification of intermediate predicates,
and ultimately to the set of pre- and post-conditions which demonstrates (or,
as appropriate, fails to demonstrate) that our composition has the properties
which we wish it to have.
This exercise is entirely in terms of functions and predicates, which are
mathematical objects, and any well-defined functional notation is sufficient to
allow us to proceed to proof.
By contrast, the majority of the literature that I have seen on the
verification of procedural programs starts, instead, from the notion that
a program is a "text". Resolution of syntactic and semantic issues, in order
to arrive at suitable objects for reasoning, becomes a major task; indeed, there
is rarely time or space left for the actual proof itself.
Formal methods are capable of great (but not infinite!) power. But it
seems to me that they are, so far, only practical when applied to a functional
context.
Dave
Re: Proving correctness of programs in functional languages
Author: Raul Rockwell
Date: Tue, 14 May 1991 04:42
Date: Tue, 14 May 1991 04:42
37 lines
2431 bytes
2431 bytes
Dave Gillett: When we define our domain of discourse to be functions, which accept inputs and produce (we hope!) results, we are able to express the necessary properties for verification of each function in terms of predicates linking properties of the inputs to properties of the results. Composition of functions leads to combination and simplification of intermediate predicates, and ultimately to the set of pre- and post-conditions which demonstrates (or, as appropriate, fails to demonstrate) that our composition has the properties which we wish it to have. This is nice, not only for "proof of correctness", but for things like designing optimizers. I believe everybody is familiar with the way a specific case can often be implemented more efficiently than a general case? This exercise is entirely in terms of functions and predicates, which are mathematical objects, and any well-defined functional notation is sufficient to allow us to proceed to proof. By contrast, the majority of the literature that I have seen on the verification of procedural programs starts, instead, from the notion that a program is a "text". Resolution of syntactic and semantic issues, in order to arrive at suitable objects for reasoning, becomes a major task; indeed, there is rarely time or space left for the actual proof itself. yacc at its finest :-) The way I understand it, the term "functional language" was invented by Backus to describe the deficiencies he saw in the languages he'd helped develop (fortran, algol). Since people don't talk about this much, I should point out that he also talked about Applicative State Transition systems (with formal functional programming as the subsystem used to generate a state). Raul Rockwell
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads