Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
ReCursive

ReCursive

Ratings: (0)|Views: 569|Likes:

More info:

Published by: Genaro Alberto Gómez Chi on Aug 28, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

10/06/2011

pdf

text

original

 
Recursive Functions of Symbolic Expressionsand Their Computation by Machine, Part I
John McCarthy, Massachusetts Institute of Technology, Cambridge, Mass.
April 1960
1 Introduction
A programming system called LISP (for LISt Processor) has been developedfor the IBM 704 computer by the Artificial Intelligence group at M.I.T. Thesystem was designed to facilitate experiments with a proposed system calledthe Advice Taker, whereby a machine could be instructed to handle declarativeas well as imperative sentences and could exhibit “common sense” in carryingout its instructions. The original proposal [1] for the Advice Taker was madein November 1958. The main requirement was a programming system formanipulating expressions representing formalized declarative and imperativesentences so that the Advice Taker system could make deductions.In the course of its development the LISP system went through severalstages of simplification and eventually came to be based on a scheme for rep-resenting the partial recursive functions of a certain class of symbolic expres-sions. This representation is independent of the IBM 704 computer, or of anyother electronic computer, and it now seems expedient to expound the systemby starting with the class of expressions called S-expressions and the functionscalled S-functions.
Putting this paper in L
A
TEXpartly supported by ARPA (ONR) grant N00014-94-1-0775to Stanford University where John McCarthy has been since 1962. Copied with minor nota-tional changes from
CACM 
, April 1960. If you want the exact typography, look there. Cur-rent address, John McCarthy, Computer Science Department, Stanford, CA 94305, (email: jmc@cs.stanford.edu), (URL: http://www-formal.stanford.edu/jmc/ )
1
 
In this article, we first describe a formalism for defining functions recur-sively. We believe this formalism has advantages both as a programminglanguage and as a vehicle for developing a theory of computation. Next, wedescribe S-expressions and S-functions, give some examples, and then describethe universal S-function
apply
which plays the theoretical role of a universalTuring machine and the practical role of an interpreter. Then we describe therepresentation of S-expressions in the memory of the IBM 704 by list structuressimilar to those used by Newell, Shaw and Simon [2], and the representationof S-functions by program. Then we mention the main features of the LISPprogramming system for the IBM 704. Next comes another way of describ-ing computations with symbolic expressions, and finally we give a recursivefunction interpretation of flow charts.We hope to describe some of the symbolic computations for which LISPhas been used in another paper, and also to give elsewhere some applicationsof our recursive function formalism to mathematical logic and to the problemof mechanical theorem proving.
2 Functions and Function Definitions
We shall need a number of mathematical ideas and notations concerning func-tions in general. Most of the ideas are well known, but the notion of conditionalexpression is believed to be new
1
, and the use of conditional expressions per-mits functions to be defined recursively in a new and convenient way.a.
Partial Functions
. A partial function is a function that is defined onlyon part of its domain. Partial functions necessarily arise when functions aredefined by computations because for some values of the arguments the com-putation defining the value of the function may not terminate. However, someof our elementary functions will be defined as partial functions.b.
Propositional Expressions and Predicates
. A propositional expression isan expression whose possible values are
(for truth) and
(for falsity). Weshall assume that the reader is familiar with the propositional connectives
(“and”),
(“or”), and
¬
(“not”). Typical propositional expressions are:
1
reference Kleene
2
 
x < y
(
x < y
)
(
b
=
c
)x is primeA predicate is a function whose range consists of the truth values T and F.c.
Conditional Expressions
. The dependence of truth values on the valuesof quantities of other kinds is expressed in mathematics by predicates, and thedependence of truth values on other truth values by logical connectives. How-ever, the notations for expressing symbolically the dependence of quantities of other kinds on truth values is inadequate, so that English words and phrasesare generally used for expressing these dependences in texts that describe otherdependences symbolically. For example, the function
|
x
|
is usually defined inwords. Conditional expressions are a device for expressing the dependence of quantities on propositional quantities. A conditional expression has the form(
 p
1
e
1
,
···
,p
n
e
n
)where the
p
’s are propositional expressions and the
e
’s are expressions of anykind. It may be read, “If 
p
1
then
e
1
otherwise if 
p
2
then
e
2
,
···
, otherwise if 
 p
n
then
e
n
,” or “
 p
1
yields
e
1
,
···
,p
n
yields
e
n
.”
2
We now give the rules for determining whether the value of (
 p
1
e
1
,
···
,p
n
e
n
)is defined, and if so what its value is. Examine the
p
’s from left to right. If a
p
whose value is
is encountered before any p whose value is undefined isencountered then the value of the conditional expression is the value of thecorresponding
e
(if this is defined). If any undefined
p
is encountered before
2
I sent a proposal for conditional expressions to a
CACM 
forum on what should beincluded in Algol 60. Because the item was short, the editor demoted it to a letter to theeditor, for which
CACM 
subsequently apologized. The notation given here was rejected forAlgol 60, because it had been decided that no new mathematical notation should be allowedin Algol 60, and everything new had to be English. The
if 
...
then
...
else
that Algol 60adopted was suggested by John Backus.
3

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->