Lambda the Ultimate

inactiveTopic J. McCarthy: Towards a Mathematical Science of Computation
started 4/3/2003; 3:47:05 AM - last post 4/8/2003; 1:01:18 PM
Ehud Lamm - J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 3:47:05 AM (reads: 2285, responses: 18)
J. McCarthy: Towards a Mathematical Science of Computation
The bulk of the paper introduces denotational semantics of a program as a function from a state vector (the values of registers and other memory locations) to a state vector. However the paper does not mention the phrase "denotational semantics". The paper then argues that the denotational function can be represented as a composition or a conditional expression of primitive operations (such as addition, etc.). The denotational semantics presentation is conventional -- but it is expressed in unconventional language.

An interesting quote:

It should be possible almost to eliminate debugging. Debugging is the testing of a program on cases one hopes are typical, until it seems to work. This hope is frequently vain. Instead of debugging a program, one should prove that it meets its specifications, and this proof should be checked by a computer program. For this to be possible, formal systems are required in which it is easy to write proofs. There is a good prospect of doing this, because we can require the computer to do much more work in checking each step than a human is willing to do. Therefore, the steps can be bigger than with present formal systems. The prospects for this are discussed in [McC62].

The last section "The Limitations of Machines And Men as Problem-Solvers" is the best section. Here's its conclusion:

In conclusion, let me re-assert that the question of whether there are limitations in principle of what problems man can make machines solve for him as compared to his own ability to solve problems, really is a technical question in recursive function theory.

-- Oleg.


Posted to theory by Ehud Lamm on 4/3/03; 3:49:23 AM

Vladimir Ivanovic - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 9:43:04 AM (reads: 1247, responses: 4)
The number of real-world programming methodologies that don't use debugging is precisely zero. This, it seems to me, is a powerful argument that there is no value in being able to prove programs correct.

People who derive economic benefit from programming do not want correct programs. They want their programs completed sooner, at less cost, with more (imperfect) features. Their policies and processes are designed to release programs with known bugs which are also expected to ontain even more undiscovered bugs.

As a theoretician, I'm agast; as a practitioner, it all seems perfectly reasonable. In fact, I'd like to see programming languages explictly include debugging features just as I like it when processors include debugging capabilities.

-- Vladimir

Ehud Lamm - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 11:32:07 AM (reads: 1289, responses: 3)
I'd like to see programming languages explictly include debugging features

Care to elaborate, or will this spoil the troll?

Alex Sauer-Budge - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 12:17:41 PM (reads: 1314, responses: 2)
I do not know what Vladimir was refering to, but I think printf is a great debugging feature!

Well, a bit more seriously, I think that it would help to have language support for pervasive range and bounds checking with as much being done at compile time as possible, the rest being left to run time with an option to leave it out altogether in order to improve efficiency.

One of the greatest difficulties with fixing bugs is finding where they are rooted (oh-oh, mixed metaphor, I guess I should be calling them "weeds" and not "bugs" if I think they have "roots"), so language support for early discovery when things go awry is a good thing. On the other hand, if the language features are too cumbersome and heavy, then they won't get used and the feature is moot-- always a balance!

In this regard, MS Excel has a helpful debugging feature in which it draws the dependency graph for a particular cell on top of your spreadsheet. If nothing else, this allows you to limit the scope of your search for the problem. A general purpose language which allowed you to walk the dependency graph in some manner when things go awry might be useful.

Ehud Lamm - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 12:34:28 PM (reads: 1358, responses: 1)
Static vs. dynamic checks is something we discuss regularly, and indeed this is a classic language design issue. I think most LtU readers know that I like Ada, which does exactly the sort of range checks you describe.

Walking the dependency graph seems like an IDE feture, not something the language can (or should) provide.

Patrick Logan - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 3:29:28 PM (reads: 1168, responses: 0)
In this regard, MS Excel has a helpful debugging feature in which it draws the dependency graph for a particular cell on top of your spreadsheet. If nothing else, this allows you to limit the scope of your search for the problem. A general purpose language which allowed you to walk the dependency graph in some manner when things go awry might be useful.

These kinds of things are possible in languages that have reflection, e.g. Smalltalk, Lisp, Java, C#. For other languages you have to build a parser, add the semantic analysis, etc.

The original Smalltalk refactoring browser uses this information to analyze and automate source-to-source code transformations. The problem with Java and C# with refactoring is the objects only exist "at run time" not during development. And so even though they "have reflection" it cannot be used very well for development-time tools. Each vendor of these tools does the "write the parser, add the semantics" song and dance all over again.

Alex Sauer-Budge - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/3/2003; 3:58:19 PM (reads: 1366, responses: 0)
I do indeed like the range and bounds checking feature of Ada. As far as language vs. IDE, from my perspective, the distinction between IDE and language does not seem as clear-cut in practice as it does in theory, and is, of course, another topic which has come up in the past on LtU with regards to Smalltalk and like environments . While something may be feasible in principle, the practical barriers to it may nullify such theoretical feasibility when it comes to actually implementing it. For example, C++ is very hard to parse, so it doesn't have as rich a set of program transformation and refactoring tools as some other languages (even though it is very widely used), which might be considered an IDE feature. Similarly, a debugger is typically also part of an IDE, but the language determines how easily a roll-back debugger can be implemented (through backtracking or saving the entire state periodically), etc..

Anton van Straaten - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 1:32:12 AM (reads: 1121, responses: 1)
Some more context for a paper like this would be nice! At first, going by the 1996 date on the title page, I was thinking that McCarthy must be really out of touch. But the paper was actually written in 1962...

Ehud Lamm - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 2:30:27 AM (reads: 1152, responses: 0)
McCarthy is, of course, one of the founders of the field (as well as a major figure in AI).

Anton van Straaten - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 3:05:34 AM (reads: 1122, responses: 1)
I do know who McCarthy is - see my post at the bottom of this page for some references to some of my favorite McCarthy-related material. But as I said, based on the date in the paper, I thought McCarthy had perhaps somehow completely failed to keep up with what had happened in the field since his heyday.

My initial conclusion was probably somewhat fed by the fact that McCarthy's own descriptions of the invention of LISP emphasize his attempts to address mathematical issues of computability from the perspective of function application - something Church had already done, more comprehensively and correctly, decades earlier. In addition, although McCarthy used 'lambda' as a keyword in LISP, he apparently used more it as a notational device, without familiarity with Church's calculus, and this showed clearly in the design (and shortcomings!) of LISP. There's some discussion of this here:

This leads to the question of McCarthy's knowledge of the lambda-calculus. McCarthy always pointed out that he did not know much about this. It is obvious that he has read the first pages of Church's paper [C41]. The 'eval' of March 1958 proves that he did know about substitution. However, there is no sign of renaming variables, no sign of normalization. One cannot believe that McCarthy did not study carefully the substitution procedures of the lambda-calculus for his realization, but this is the only explanation for a series of errors that were not apparent in the simple examples of 1958. Today, we all know much better.

I thought perhaps McCarthy still hadn't gotten around to reading Church... ;)

Of course, as it turns out, being from 1962, this paper was rather prescient. I notice it is cited by people like Milner in subsequent papers about denotational semantics.

Frank Atanassow - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 3:09:11 AM (reads: 1116, responses: 0)
I'll bite.

The number of real-world programming methodologies that don't use debugging is precisely zero. This, it seems to me, is a powerful argument that there is no value in being able to prove programs correct.

The number of real-world programming methodologies that produce correct programs is precisely zero. This, it seems to me, is a powerful argument that there is no value in being able to debug programs.

People who derive economic benefit from programming do not want correct programs. They want their programs completed sooner, at less cost, with more (imperfect) features. Their policies and processes are designed to release programs with known bugs which are also expected to [c]ontain even more undiscovered bugs.

People who derive economic benefit from using software do not want incorrect software. They don't want to fiddle with buggy programs, file bug reports or contact customer service; they want to get real work done, sooner and at less cost. Their policies and processes are built on the assumption that the software they purchase actually does what the seller claims it does and it's a damn shame that they don't sue the pants off incompetent and even willfully negligent software manufacturers when it doesn't.

As a theoretician, I'm agast; as a practitioner, it all seems perfectly reasonable. In fact, I'd like to see programming languages explictly include debugging features just as I like it when processors include debugging capabilities.

As a practitioner, I'm aghast: writing correct software is harder than I thought, and I thought my customers would be more forgiving about my mistakes, even though I take their money. As a theoretician, it all seems perfectly reasonable. In fact, I'd like to see programming languages explicitly include features which help me prove my programs correct, just as I like it when physics and mathematics textbooks actually support their own claims with evidence and proofs.

Ehud Lamm - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 3:31:44 AM (reads: 1146, responses: 0)
I didn't mean to imply you didn't know who McCarthy is. You are a LtU regular after all..

Anton van Straaten - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 4:09:13 AM (reads: 1105, responses: 0)
Don't worry, I wasn't being sensitive - I just wanted to clarify what I was talking about...

BTW, Frank, I think you should begin work on a calculus of message postings so that in future, at least some of us will be able to prove our own postings correct, thus radically simplifying many of these discussions!

V {postings by Frank} E {truth}

Tim Sweeney - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/4/2003; 4:10:34 PM (reads: 1041, responses: 0)
The problem with proving programs correct is that, in all systems produced to date, the proofs are far larger and more complicated than the programs they're proving correct. Even the proposition (the type of the proof) tends to be more complex than the actual program, for example the proposition that qsort returns its argument stably sorted, compared to the implementation of qsort.

The pattern I've seen informally looking at the research are factors like 1:2:40. For each line of program code, you need 2 lines of specification code, and 40 lines of proof code.

The end result is that it's easier to eyeball your program and guess that it's probably correct, than to eyeball the proposition being proved and guess that it's probably proving the right thing. So, as far as shipping quality code is concerned, you get 40X better cost/benefit from writing code than from trying to prove stuff about it.

Proof techniques would need to come a very, very long way before this situation changes.

Robert Goldman - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/8/2003; 9:57:25 AM (reads: 956, responses: 3)
Regarding Vladimir's first point, arguing that people don't want correct programs versus on-time and functional programs is a very partial view, that is true primarily of commercial office software.

When one moves to considering other kinds of software, such as software that is used to control devices (especially devices like airplanes and medical machinery), one sees a very different perspective!

You may be able to fix the bugs in MS Word in a service pack; you can't fix them in an airliner that way. You're just not allowed to crash a bunch of planes to collect the bug reports!

Ehud Lamm - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/8/2003; 10:18:53 AM (reads: 997, responses: 2)
I continue to wonder when (if ever) will we realize that there is and always will be a large set of goals, and that weighing the tradeoffs is essentially an engineering problem, just like any other engineering problem.

andrew cooke - Re: J. McCarthy: Towards a Mathematical Science of Computati  blueArrow
4/8/2003; 12:35:40 PM (reads: 1024, responses: 1)
Don't we already realise this, largely? The problem is more to do with pushing back the point where you need to make the decision. If it's obvious you must use C without explaining what a Samba server is then choices are being made very early. Writing such a program may require compromises, but surely they should be further down the line (maybe the protocol is ambiguous in a certain way that is difficult to describe using static types, say...)

[oops, example from different thread, but you get my drift, I hope.]

Isaac Gouy - Re: J. McCarthy: Towards a Mathematical Science of Computation  blueArrow
4/8/2003; 1:01:18 PM (reads: 964, responses: 0)
I continue to wonder when...
Is it in the curriculum? Do CS students now learn about QFD as well as time-space trade-offs? Tom Gilb's Design by Objectives?

An interesting quote:

However, there are few debuggers or profilers for strict languages, perhaps because constructing them is not perceived as research. That is a shame, since such tools are sorely needed, and there remains much of interest to learn about their construction and use.
Constructing debuggers and profilers for lazy lan­guages is recognized as difficult. Fortunately, there have been great strides in profiler research, and most imple­mentations of Haskell are now accompanied by usable time and space profiling tools. But the slow rate of progress on debuggers for lazy languages makes us researchers look, well, lazy.
"Why no one uses functional languages" 1998

Ehud Lamm - Re: J. McCarthy: Towards a Mathematical Science of Computati  blueArrow
4/8/2003; 1:08:09 PM (reads: 1078, responses: 0)
Well, in my experience most programmers don't realize this. You often hear students, for example, say "I don't think reliability is important" without realizing that without context such a statement is almost meaningless.