ebook img

Towards a Mathematical Science of Computation PDF

8 Pages·1962·2.511 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Towards a Mathematical Science of Computation

TOWARDS A MATHEMATICAL SCIENCE OF COMPUTATION J. McCARTHY Computation Center, Stanford University, Stanford, CaL, USA and computability relative to a given collection of initial I. INTRODUCTION functions is easy to define. In this paper I shall discuss the prospects for a Procedures operate on members of certain data spaces mathematicalscience of computation. In a mathematical and produce members of other data spaces, using in science,it is possible to deduce from the basic assump- general still other data spaces asintermediates. A number tions, the important propel ties of the entities treated of operations are known for constructing new data bythescience. Thus, from Newton's Jaw of gravitation spaces from simpler ones, but there is asyet no general andhislaws of motion, one can deduce that the planetary theory of representable data spaces comparable to the orbits obey Kepler's laws. theory of computable functions. Some results are What are the entities with which the science of given in 1). computation deals? Programs are symbolic expressions representing proce- What kinds of facts about these entities would we dures. The same procedure may be represented by like to derive? different programs in different programming languages. Whatare the basic assumptions from which we should We shall discuss the problem of defining aprogramming start? language semantically by stating what procedures the What important results have already been obtained? programs represent. As for the syntax of programming Howcan the mathematical science help in the solution languages, the rules which allow us to determine whether of practical problems? an expression belongs to the language have been I would like to propose some partial answers to these formalized, but the parts of the syntax which relate questions.These partial answers suggest some problems closely to the semantics have not been so well studied. for future work. First I shall give some very sketchy The problem of translating procedures from one general answers to the questions. Then I shall present programming language to another bas been much somerecent results on three specific questions. Finally, studied, and we shall try to give a definition of the [ shall try to draw some conclusions about practical correctness of the translation. applications and problems for future work. . Computers are finite automata. From our point of This paper should be considered together WIth my view, a computer is defined by the effect of executing a earlier paper 1). The main results of the prese';'t paper program with given input on the state of its memory are new but there is some overlap so that this paper and on its outputs. Computer science must study the would heself-contained. However some of the topics in various ways elements of data spaces are represented this paper such as conditional expressio:ns,. recurs,ive in the memory of the computer and how procedures definitionof functions, and proof by recursion luductl?n are represented by computer programs. From this point are considered in much greater detail in the earlier of view, most of the current work on automata theory paper. is beside the point. 3. WHAT KINDS OF FACTS AnOUT PROBLEMS, 2. WHAT ARE THE ENTITIES WITH WHICH COMPUTER PROCEDURES, DATA SPACES, PROGRAMS, AND SClENCE DEALS? COMPUTERS WOULD WE LIKE TO DERIVE? Primarily, we would like to be able to prove that Theseareproblems, procedures, data spaces, progra.ms given procedures solve given problems. However, representing procedures in particular programming proving this may involve proving a whole host of other languages, and computers. kinds of statement such as: Problems and procedures are often confused .. A 1. Two procedures are equivalent, i.e, compute the problem is defined by the criterion which deternunes same function. whether a proposed solution is accepted. One can 2. A number of computable functions satisfy a understand a problem completely WIthout having any certain relationship, such as an algebraic identity or a method of solution. formula of the functional calculus. Procedures are usually built up from elementary 3. A certain procedure terminates forcertain initial procedures. What these elementary procedures may be, data, or for all initial data, and how more complex procedures are constructed 4. A certain translation procedure correctly trans- fromthem, is one of the first topics in cor;nputerscte~ce. lates procedures between one programming language Thissubject is not hard to understand. since there IS a and another. precisenotion of a computable function to guide us, 21 [II 22 SURVEY SESSION d . ult was the existence of classes 5. One procedure is more efficient. than another The secon maJ~~:~ This keeps all but the most equivalent procedure in the sense of taking fewer steps of unsolvafble prot oe ce'rtain Quixotic enterprises such f or requiring less memory. Jo!!.I1orant0 us.ou t a debugging proce dure tliat can as trying to mven . . d will et into 6. A certain transformation of programs pre~erves infallibly tell if a program being examme g . the function expressed but increases the efficiency, 7. A certain class of problems is unsolvable by any a ~~~~ in this paper we shall discuss the relevance of procedure, or requires procedures of a certam type for the results of mathematical logic on creauve. sets to the its solution. blem of whether it is possible for a machine to be as f:~lligent as ahuman. Inmy opinion it ~svery Import~nt to build a firmer bridge between logic and recursive 4. WHAT ARE THE AxIOMS AND RULES OF INFEREN?CE function theory on the one side, and the practice of OF A MATHEMATICAL SCIENCE OF COMPUTATION. computation on the other. . Ideally we would like a mathematical theory in which M .h f the work on the theory of finite automata uc 0 I' it t every true statement about procedures would have a has been motivated by the hope of app ymg I 0compu- proof and preferably a proof that is easyto find, not too tation. I think this hope is mostly in vain because the long, 'and easy to check. In1931,Godel proved a result, fact of finiteness is used to show that the automaton one of whose immediate consequences IS that.therel~ no will eventually repeat a state. However, anyone who complete mathematical theory of computation. Given waits for an IBM 7090 to repeat a state, solely because any mathematical theory of computation there are true it is a finite automaton, is in for a very long Watt. statements expressible in it which do not have proofs. Nevertheless, wecan hope for atheory which IS adequate for practical purposes, like proving thatcompilers work; 6. How CAN A MATHEMATICAL SCIENCE OF the unprovable statements tend to be of a. rath~r COMPUTATION HELP IN THE SOLUTION OF sweeping character, such as that the system Itself IS PRACTICAL PROBLEMS? consistent. It is almost possible to take over one of the ~yste~s Naturally, the most important applications of a of elementary number theory such as that given In science cannot be foreseen when it IS Just beginning, Mostowski's book "Sentences Undecidable in Forma- However, the following applications can be foreseen. lized Arithmetic" since the content of a theory of I. At present, programming languages are con- computation is quite similar. Unfortunately, this and structed in a very unsystematic way. A number of sim.i.1arsystems were designed to make It easy to prove proposed features are invented, and then we argue about meta-theorems about the system, rather than to prove whether each feature is worth its cost. A better under- theorems in the system. As a result, the integers are standing of the structure of computations and of data given such a special role that the proofs of quite easy spaces will make it easier to see what features are really statements about simple procedureswould be extremely desirable. long. 2. Itshould be possible almost to eliminate debug- Therefore it is necessary to construct a new, though ging. Debugging is the testing of a program on cases similar, theory in wh.ich neither the integers n?f any one hopes are typical, until it seems to work. This other domain, (e.g. strings of symbols) are given a hope is frequently vain. special role. Some partial results in t~isdirection are Instead of debugging a program, one should prove described in this paper. Namely, an Integer-free for- that it meets its specifications, and this proof should be malism for describing computations hasbeen developed checked by a computer program. For this to be possible, and shown to beadequate in the cases where it can be formal systems are required in which it is easy to write compared with other formalisms. Some methods of proofs. There is a good prospect of doing this, because proof have been developed, but there isstill a gap when we can require the computer to do much more work in it comes to methods of proving that a procedure ter- checking each step than a human is willing to do. minates. The theory also requires extension in order to Therefore, the steps can be bigger than with present treat the properties of data spaces. formal systems. The prospects for this are discussed in'). 5. WHAT IMPORTANT REsULTS HAVE BEEN OBTAINED RELEVANT TO A MATHEMATICAL SCIENCE OF 7. USING CoNDITIONAL EXPRESSIONS TO DEFINE COMPUTATION? FUNCTIONS RECURSIVELY In 1936 the notion of a computable function was In ordinary mathematical language, there are certain clarified by Turing, and he showed the existence of tools for defining new functions in terms of old ones. universal computers that, with an appropriate program, These tools are composition and the identification of could compute anything computed by any other com- variables. As it happens, these tools are inadequate puter. Ailourstoredprogram computers, when provided computable ui terms of old ones. It is then customarYj with unlimited auxiliary storage, are universal in to define all functions that can reasonably be regarded as! Turing's sense. In some subconscious sense even the to give a verbal definition. For example, the function sales departments of computer manufacturers are aware Ixl IS usually defined in words. of this, and theydo not advertise magic instructions that If we add a single formal tool, namely conditional cannot be simulated on competitors machines, but only expressions to Our mathematical notation and if we that their machines are faster, cheaper, have more allow conditional expressions to be used recursively in a memory, or are easier to program. manner that Ishall describe, we can define, in a com. a m 23 SURVEY SESSION pletelyformal way, all functions that can reasonably be functions. One of the earliest major results of recursive regardedas computable in terms of an initial set. We will function theory is that there is no formalism that gives usethe ALGOL 60 notation for conditional expressions all the computable total functious and no partial in this paper. ' functions. Weshall use conditional expressions in the simple form We bave proved 1) that the above method of defining computable functions, starting from just the successor if p then a else b function n' and equality, yields all the computable functions of integers. This leads us to assert that we wherep is a propositional expression whose value is have the complete set of tools for defining functions true or false. The valne of the conditional expression which are computable in terms of given base functions. isaifp has the value true and b ifp has the value false. of If we examine the next to last line of our computation When conditional expressions are used, the stock of 2!we seetbat wecannot simply regard the conditional predicates one has available for constructing p's is just expression as important as tbe stock of ordinary functions to be if P then a else b usedin fanning the a's and b's by composition. The following are examples of functions defined by con- as a function of the three quantities p, a, and b. If we ditional expressions°: did so, we would be obliged to compute g(- 1,0) i) Ixl = if x < then -x else x before evaluating the conditional expression, and this ° computation would not converge. What must happen ii) "I ~ if n ~ then I else nx (n~ I)! is that when p is true we take a as the value of the conditional expression without even looking at b. iii) "I = g(n, I) Any reference to recursive functions inthe rest of this where ° paper refers to functions defined by the above methods. g(",s) ~ if n ~ then s else g(n-I,llxs) 8. PROVING STATEMENTS ABOUT RECURSIVE FUNCTIONS iv) ,,! ~ fen, 0, I) ]n the previous section we presented a formalism for where describing functions which are computable ill terms of f(ll, tn,p)~ ifm-r n thenp elsef(n, 111+ I, (tn+ I)xp) given base functions. We would like to have a mathe- v) n: ~ pred (n, 0) matical theory strong enough to admit proofs of those facts about computing procedures that one ordinarily where needs to show that computer programs meet their pred (n, m) ~ if m' = n then m else pred (n, tn') specifications. In 1) we showed that our formalism for expressing computable functions, was strong enough so vi) m+n ~ if n = 0 then In else m'v-n: that all the partial recursive functions ofintegers could be obtained from the successor function and equality. Thefirst of these is the only non-recursive definition Now we would like a theory strong enough so that the in the group. Next, we have three different procedures addition of some form of Peano's axioms would allow for computing nl; they can be shown to be equivalent the proof of all the theorems of one of the forms of hythe methods to be described in this paper. Then we elementary number theory. definethe predecessor fnnction nr for positive integers We do not yet have such a theory. The difficulty is to (3- =2)in terms of the successor function n' (2' = 3). keep the axioms and rules of inference of the theory Finally, we define addition in terms of the successor, free of the integers or other special domain, just as we the predecessor and equality. In all of the definitions, have succeeded in doing with the formalism for con- exceptfor the first, the domain of the variables is taken structing functions. to be the set of non-negative integers. We shall now list the tools we have so far for proving Asan example of tbe use of these definitions, we shall relations between recursive functions. They are dis- showhow to compute 2! by the second definition of nL cussed in rnare detail in '). We have 1. Substitution of expressions for free variables in 2! =g(2, I) equations and other relations. 2. Replacement of a sub-expression in a relation by = if 2 = 0 then I else g(2-1,2xl) an expression which has been proved equal to the sub- =g(1, 2) expression. (This is known in elementary mathematics ~ if I = 0 then 2 else g(l - I, I x 2) as substitution of equals for equals.) When we are dealing with conditional expressions, a stronger form of = g(O, 2) ° this rule than the usual one is valid. Suppose we have = if 0 ~ 0 then 2 else g(O- I, x 2) an expression of the form =2 if p then a else (if q then b else c) Note tbat if we attempted to compute nl for any n and we wish to replace b by d. Under these circum- but a non-negative integer the successive reductions stances we do not have to prove the equation b = d would not terminate. In such cases we say that the in general, but only the weaker statement' computation does not converge. Some recursive func- tionsconverge for a1.1values of their arguments, some ~pAq~b=d convergefor some values of the arguments, and some This is because b affects the value of the conditional never converge. Functions that always converge are calledtotal functions, and the others are called partial expression only in case ,.....p..,A q is true. [ll 24 SURVEY SESSION is not to create yet another programming language, but 3. Conditional expressions satisfy a number of . t ols for provmg facts about programs. identities, and a complete theory of conditional e~- to grve 0 . f . In order to regard programs as recursive unctions, pressions, very similar to propositional calculus, IS we shall define the state veelor ~ of a program at a given thoroughly treated in 1). We shall list a few of the ti t be the set of current assignments of values to the identities taken as axioms here. nne, 0 I f hi variables of the program. In t ie .case 0 a mac ne i) (if true then a else b) = a language program, the state vector IS tbe set of current contents of tbose registers. whose contents change ii) (if false then a else b) = b during the course of execunon o~ the v,fograrn. iii) ifP then(ifqthen aelseb) else(ifqthen celse d) ~ When a block of program havm~ a SLngl~entrance and exit is executed, the e~ect of this exe:utlo~ on the if q then (ifp then aelse c) else(ifp then b else d) state vector may be described by a function ~ = r(~) iv) I (if p then a else b) ~ if p then I(a) else I(b) giving the new state vector in terms of the old. Consider a program described by the flow chart of fig. I. 4. Finally, we have a rule called recursion induction for making arguments that in the usual formulations are made by mathematical induction. This rule may be regarded as taking one of the theorems of recursive r[, I" sII[1,11 function theory and giving it the status of a rule of ,[,I"jj p[1,1then. 'Ill !!11 1191"1 ifnoflelorewnsc:e. Recursion induction may be described as t (,iz l! ql (!oj then r.lhtl.!l!!il q,lli then , I[g[lll Suppose we have a recursion equation defining a function f, namely If, I(XI, ... , Xn)~£ xi, ...,Xn ( (I) Fig. 1 Flow chart for equations shown. where the right hand side will be a conditional expression in all non-trivial cases, and suppose that The two inner computation blocks are described by i) the calculation ofl(xI, ...,Xn) according to this functions I(~) and g(~),telling how these blocks affect rule converges for a certain set A of n-tuples, the state vector. The decision ovals are described by ii) the functions g(Xl, ... ,Xn) and h(X1, ... , Xn) each predicates p(~), q,(~), and q2(~) that give the conditioos satisfy equation (I) when g or h is substituted for f. for taking the various paths. We wish to describe the Then we may conclude thatg(xl, ...,xn) ~ h(Xl,... Xn) function r(~) that gives the effect of the whole block, for all II-tuples (xi, ...,Xn) in the set A. in terms of the functions I and g and the predicates As an example of the use of recursion induction we p, ql, and q2.This is done with the help of two auxiliary shall prove that the function g defined by functions sand t. s(~)describes the change in ~between the point labelled s in the chart and the final exit from g(n, s) ~ if II ~ 0 then s else g(lI- 1,IIX s) the block; I is defined similarly with respect to the satisfies g(n, s) ~ n!xs given the usual facts about nL point labelled t. We can read the following equations We shall take for granted the fact that g(n, s) converges directly from the flow chart: for all non-negative integral nand s. Then we need r(~) ~ s(/(<)) only show that n! x s satisfies the equation for g(n, s). We have s(~)~ if p(~) then rW else I(g(~)) n!xs = if n 0 then n!xs else n!xs = t(~) ~ if qM) then r(~) else if q2(~) then ~ else l(gCm if n ~ 0 then s else (n- l)! x (nx s), In fact, these equations contain exactly the same in- and this has the same form as the equation satisfied by formation as does the flow chart. g(n, s). The steps in this derivation are fairly obvious Consider the function mentioned earlier, given by but also foLlow from the above-mentioned axioms and rules of inference. In particular, the extended rule of g(n, s) = if n = 0 then s else g(n- J, IIXs) replacement is used. A number of additional examples of proof by recursion induction are given in 1), and it It corresponds, as we leave the reader to convince has been used to prove some fairly complicated relations himself, to the Algolic program between computable functions. a: if n ~_O then go to b; 9. RECURSIVE FUNCTIONS, FLOW CHARTS, AND S := nxs; ALGOLIC PROGRAMS n := n-l; go to a; In tltis section I want to establish a relation between the use of recursive functions to define computations, b: the flow chart notation, and programs expressed as sequences of ALGOL-type assignment statements, Its flow chart is given IU fig. 2. together with conditional go to's. The latter we shall call Algolic programs with the idea of later extending This flow chart is described by the function lac W the notation and methods ofproof to cover more of the and the equation language of ALGOL. Remember that our purpose here m lac = if p(~) then ~ else lac (g(fC~))) 25 II] SUR VE Y SESSION In the examples, all the recursive definitions except fa([~l"i!p(~lthenl;else fac.[g(f(~))) n! = if n ~ 0 then I else 11x(11-I)! where are in interative form. In that one, (n-l)! occurs as p(~}={c.(n.E1"0) a term of a product. Non-iterative recursive functions flel=a[s,c(nlJ' c(~,E,l,l;I translate into Algolic programs that use themselves 9ll;}=a(n.c(n,~l-I,~) recursively as procedures. Numerical calculations can lac(~)=a{n,O,a(s,c(n,~! •c(s~lll usually be transformed into iterative form, but compu- tations with symbolic expressions usually cannot, unless quantities playing the role of push-down lists are Fig. 2 Flow chart for fac(~). introduced explicitly. wherep(;) corresponds to the condition 11 = 0, f(;) to 10. RECURSION INDUCTION ON ALGOLIC PROGRAMS the statement 11.:~ 11.- I, and g(;) to the statement s:= lIXS. In this section we extend the principle of recursion We shall regard the state vector as having many induction so that it can be applied directly to Algolic components, but the only components affected by the programs without first transforming them to recursive present program are the s-component and the n- functions. Consider the Algolic program component. In order to compute explicitly with the statevectors, we introduce the function c(var, ~) which a: if 11 ~ 0 then go to b; denotes the value assigned to the variable var in the s:= nx s; state vector ~, and we also introduce the function n:=n-l; a(var,val,;) which denotes the state vector that results go to a; whenthe value assigned to var in ; is changed to val, andthevalues of the other variables are left unchanged. b: The predicates and functions of state vectors men- tioned above then become: We want to prove it equivalent to the program p(~)~ (c(l1,;) ~ 0) a: s:= n!x s g(~)~ ain, c(l1,;)- I, ;) Il :~ 0 1m = a(s, c(l1,;) x c(s, ;), ;) b: Before giving this proof we shall describe the principle We can prove by recursion induction that of recursion induction as it applies to a simple class of n, flow charts. Suppose we have a block of program fac (;) = a(n, 0, a(s, c(n, ;)1x c(s, ;), represented by fig. 3a. Suppose we have proved that this block isequivalent to the flow chart offig. 3b where but in order to do so we must use the following facts the shaded block is the original block again. This about the basic state vector functions: corresponds to the idea of a function satisfying a m i) c(u,a(v, «, = if u = v then", else c(u, ;) functional equation. We may now conclude that the block of fig. 3a is equivalent to the flow chart of fig. 3c Ii) a(v, c(v, ;)l) = ; for those state vectors for which the program does not iii) a(u, a, alv, p, m = if u = v then a(u,"', ;) get stuck in a loop in fig. 3c. ;» else a(v, p, a(u, "', (01 (bl (cl The proof parallels the previous proof that p g(n, s) = III xs, but the formulae are longer. While all flow charts correspond immediately to recursivefunctions of the state vector, the converse is notthe case. The translation from recursive function to flowchart and hence to Algolic program is immediate, only if the recursion equations are in iterative form. Fig. 3 Recursion induction applied to flow charts. Suppose we have a recursion equation This can be seen as follows. Suppose that, for a r(xI, ... ,Xn) = C {r, xi, ... ,Xn,/i, ...,fll~} particnlar input, the program of fig. 30goes around the where C {r,Xl, ...,Xt/,,!l, ... ,/m} is. a conditional lcohoaprt 1t1hattimreessultbsefowrheenitthceomwehsoleouotf.fiCg.o3nbsidisersubtshteitutfelodw efuxnpcretisosnios.nli,d.e..fin.1inmg. Iffthise safiudncttoionbe inr it1eDratitveermsformof Itfher for the shaded block, and then substituted into this fignre again, etc. for a total of 11substitutions. The state neveroccurs as the argument of a function but only lD vector in going through this flow chart will undergo terms of the main conditional expression in the form exactly the same tests and changes as it does in going ... then rl···)· throngh fig. 3c, and therefore wili come out in 11 steps [I[ 26 SURVEY SESSION II. THE DESCRIPTION OF PROGRAMMINGLANGUAGF.'I without ever going through the shaded block. Therefore, it must come out with the same value as ill fig.. 3c. Pro!ITamIDIn.g 1adn"guages must be described. syntTahc- Therefore, for any vectors for whic~ the computation d tically. Here is the istmcnon. e ti.cally 0an sernan of fig. 3c converges, fig. 3a is equivalent to fig. 3c. tactic description includes: Thus, in order to use this principle to prove .the sy~ A description of the morphology,. namely what equivalence of two blocks we prove that they satisfy s ~bolic expressions represent ~rammatlcal progr~ms, the same relation, of type Ja-Sb, and that the corres- y2. The rules for the analysis of a program into ponding 3c converges. . arts and its synthesis from the parts. Thus we must We shall apply this method to showing that the two be able to recognize a term representing a sum and to programs mentioned above are equivalent. The first extract from it tile ter.ms. representmg the summands.U program may be transformed as follows: The semantic descriptton of the language must te what the programs mean. The meaning of a program from is its effect on the state vector III the case of a machine 0: if 11~ 0 then go to b; s: = nxs; n: = n-l; I.nddetpen en Iansg»uage and its eff•ect on the contents of memory in the case of a mach me language program. go to a; b: to 12. AB~TRACT SYNTAXOF PROGRAMMINGLANGUAGF.'I a: if fl ~ 0 then go to b; s: ~ 1IXS; n: = fl-]; The Backus normal form that is used in the ALGOL 01: if n = 0 then go to b; s: = nx s; n: = n-]; report describes the morphology of ALGOL programs in a ;ynthelic manner. Namely,. it describes how the go to a1; b: various kinds of program are built up from their parts. This would be better for translating into ALGOL than The operation used to transform the program is it is for the more usual problem of translating from simply to write separately the first execution of a loop. ALGOL. The form of syntax we shall now describe In the case of the second program we go: differs from the Backus normal form in two ways. from First it is analytic rather than synthetic; it tells how to take a program apart, rather than how to put ittogether. a ; a :s := n! X s ;11 : = b : Second, it is abstract in that it is independent of the notation used to represent, say sums, but only affirms to that they can be recognized and taken apart . a: ifIt = 0 thengo to c; s: = n!xs; n: = 0; Consider a' fragment of the ALGOL arithmetic terms, including constants and variables and sums ~nd f go to b; c: s: ~ n! x s; 11: = 0; b: products. As a further simplification we shall consider to sums and products as having exactly two arguments, although the general case is not much more difficult. a: if11= 0then go to c; s: = (n-I)! x(nx s); 11: ~ 0; Suppose we have a term t. From the point of view of go to b; c:; b: translating it wemust first determine whether itrepresents a constant, a variable, a sum, or a product. Therefore to we postulate the existence of four predicates: isconst(t), isvar(t), issum(t) and isprod(t). We shall suppose that a: ifn = Othengotob;s: = nxs;n: = n-]; s: = each term satisfies exactly one of these predicates. = n!xs; Il: = 0;b: Consider the terms that are variables. A translator will have to be able to tell whether two symbols are The operations used here are: first, the introduction occurrences ofthe same variable, so we need apredicate of a spurious branch, after which the same action is of equality on the space of variables. If the variables will performed regardless of which way the branch goes; have to be sorted an ordering relation is also required. second, a simplification based on the fact that if the Consider the sums. Our translator must be able to branch goes oneway then n ~ 0, together with rewriting pick out the summands, and therefore we postulate one of the right-hand sides of an assignment statement; the existence of functions addefld(l) and augendit) and third, elimination of a label corresponding to a defined on those terms that satisfy issumif]. Similarly, null statement, and what might be called an anti- wehave the functions mplier(t) and mpcandifs defined on simplification of a sequence of assignment statements. the products. Since the analysis of a term must terminate, We have not yet worked out a set of formal rules the recursively defined predicate justifying these steps, but the rules can be obtained from the rules given above for substitution, replacement lerm(t) ~ isvar(t) v iscol1st(t) v issum(t) A term and manipulation of conditional expressions. (addend(l)) A term (ougend(t)) v isprod(t) A term The result of these transformations is to show that the two programs each satisfy a relation of the form: (mpher(I)) A term(mpca1ld(t)) program is equivalent to must converge and have the value true for all terms. The predicates and functions whose existence and a: if n = 0 then go to Ib; s: ~ nxs; n: ~ 0; program. relations define the syntax, are precisely those needed to translate from the language or to define the semantics. The program corresponding to fig. 3c in this case, That is why We need not care whether sums are repre- is precisely the first program which we shaU assume sented by q+b, or +ab, or (PLUS A B), or even by always converges. This completes the proof. Godel numbers 7a11b. 27 II] SURVEY SESSION Itisuseful to consider languages which have both an Translation rules can also be described formally. analytic and a synthetic syntax satisfying certain Namely, relations.Continuing our example of terms, the synthetic 1. A machine is described by a function syntaxis defined by two functions mksum(t, u) and x' = machine (p, x) mkprod(t,u) which, when given two terms t and u yieldtheir sum and product respectively. We shall call giving the effect of operating the machine program p tbe syntax regular if the analytic and the synthetic on a machine vector x. syntaxare related by the plausible relations: . 2. An invertible representation x = rep (1;) of a state vector as a machine vector is given. i)issum(mksum(t, u)) and isprod(mkprod(t, u» 3. A function p ~ trans (n) translating source ii)addend(mksum(t, u)) ~ t; mplier(mkprod(t, u» ~ t programs into machine programs is given. The correctness of the translation is defined by the augend(mksum(l, u» = u; mpcandimkprodit, u» =u equation iii)issum(l) J mksum(addend(I), augend(I» ~ t and m ~ rep(algol (n, machine(trans (n), rep (1;)). isprod(t) J mkprodimplierif), mpcand(l)) = I Itshould be noted that tl"ans(n) is an abstract function Oncethe abstract syntax of a language has been and not a machine program. In order to describe decided,then one can choose the domain of symbolic compilers, we need another abstract invertible function, expressionsto beused. Then onecan define the syntactic u ~ repp(n), which gives a representation of the source functionsexplicitly and satisfy oneself, preferably by program inthe machinememory ready to betranslated. provingit, that they satisfy the proper relations. If both A compiler is then a machine program such that tbe analytic and synthetic functions are given, we trans (n) ~ machineicompiler, repp (n». do not have the difficult and sometimes unsolvable analysisproblems that arise when languages are des- cribedsynthetically only. 14. THB LIMITATIONS OF MACHINES AND MEN AS In ALGOL the relations between the analytic and PROBLEM-SOLVERS thesynthetic functions are not quite regular, namely Can a man make a computer program that is as therelations hold only up to an equivalence. Thus, intelligent as he is?The question has two parts. First, redundantparentheses are allowed, etc. we ask whether itispossible in principle, in view of the mathematical resnits on nndecidability and incom- 13. SEMANTICS pleteness. The secondpart is a question of the state of the programming artasit concerns artificialintelligence. Theanalytic syntactic functions can be used to define thesemantics of a programming language. In order to Even if the answerto the first question is "no", one can still try to goasfar as possible in solvingproblems definethe meaning of the arithmetic terms described above, we need two more functions of a semantic by machine. Myguessisthatthere isnosuchlimitation inprinciple. nature,one analytic and one synthetic. If the term t isaconstant then valet) is the number which t denotes. However, a complete discussion involves the deeper If" isa number mkconstio) is the symbolic expression parts of recursive function theory, and the necessary denotingthis number. We have the obvious relations mathematics has not all been developed. Consider the problem of deciding whether a sentence i) valtmkconstio) = IX of the lower predicate calculus is a theorem. Many problems of actual mathematical or scientific interest ii) isconst(mkconst(IX» can be formulated in this form, and this problem has iii) isconst(t) J mkconstivalit) ~ t been proved equivalent to many other problems including problem ofdetermining whether aprogram on Nowwe can define the meaning of terms by saying a computer with unlimited memory will ever stop. tbatthevalue of a term for a state vector I;is given by According to Post,this is equivalent to decidingwhether an integer is a member of what Post calls a creative set. value(t,Ii) ~ if isvar(t) then c(t, 1;) else if isconstit) It was proved by Myhill that all creative sets are equi- thenval(l) else if issum(t) then value (addend(t), 1;)+ valent in a quite strong sense, so that there is really +value(augend(t),I;) elseif isprod(t) then value(mplier(I), only one class ofproblems at this levelofunsolvability. Concerning this problem the following facts are ii)xvalue(mpcand(t), 1;) known: 1) There is a procedure whichwill dothe following: Wecan go farther and describe the meaning of a Ifthe number is in the creative set, the procedure will program in a programming language as follows: say "yes", and ifthe number is not in the creative set Themeaning of a program is defined by its effect on the the procedure will not say "yes", it may say "no" or statevector. Admittedly, this definition will have to be it may run on indefuaitely. elaborated to take input and output into account. 2) There is no procedure which will always say In the case of ALGOL we should have a function ii'=algol(n, 1;) which gives the value 1;' of the state "yes" when the answer is "yes", and will always say "no" when the answer is "no". If a procedure has vectorafter the ALGOL program n has stopped, given property (I)it mustsometimes run on indefinitely.Thus thatit was started at its beginning and that the state there is no procedure which can alwaysdecidedefinitely vectorwas initially 1;. We expect to publish elsewhere, whether a number is a member of a creative set, or a recursive description of the meaning of a small equivalently, whether a sentence of the lower predicate SUbseotf ALGOL. [II 28 SURVEY SESSION contest in trying to name the largest recurs,iv~ ordinal. calculus is a theorem, or whether an ALGOL program with given input will ever stop. This is the sense in Here we Seem to be stuck, be.causHe the limithiofdthe recursive ordinals is not recurSlve. owe,ver. t ~s oes which these problems are unsolvable. not exclude the possibility that there IS a different 3) Now we come to Post's surprising result. We might try to do as well as possible. Namely, we can try improvement process Q,. such that Qp IS better than to find a procedure that always says "yes" when the P"p for any recursive ordinal ex. .. 5) There is yet another complication, Suppose answer is "yes", and never says "yes" when the answer someone names what he claims is a large recursive is "no", and which says "no" for aslarge a class of the ordinal. We, or our program, can name a larger one by negative cases as possible. thus narrowing down the adding one, but how do we know that the procedure set of cases where the procedure goes on indefinitely as much as we can. Post showed that one cannot even that he claims is a recursive well-ordering, really IS? He says he has proved it in some system of arithmetic. do as well as possible. Namely, Post gave a procedure which, when given any other partial decision procedure, In the first place we may not be confident that his would give a better one. The better procedure decides system of arithmetic is correct or even consistent. But all the cases the first procedure decided, and an infinite even if the system is correct, by Godel's theorem it is class of new ones. At first sight this seems to suggest incomplete. Tn particular, there are recursive ordinals that Emil Post was more intelligent thalli any possible that cannot be proved to be so i.nthat system. Rosen- machine, although Post himself modestly refrained from bloom, in his book "Elements of Mathematical Logic" drawing this conclusion. Whatever program you propose, drew the conclusion that man was in principle superior Post can do better. However, this is unfair to the to machines because, given any formal system of programs. Namely, Post's improvement procedure is arithmetic, he could give a stronger system containing itself mechanical and can be carried out by machine, true and provable sentences that could not be proved so that the machine can improve its own procedure or in the original system. What Rosenbloom missed, can even improve Post, if given a description of Post's presumably for sentimental reasons, is that theimprove- own methods of trying to decide sentences of the lower ment procedure is itself mechanical, and subject to predicate calculus. It is like a contest to see who can iteration through the recursive ordinals, so that we are name the largest number. The fact that I can add one hack in the large ordinal race. Again we face the com- to any number you give, does not prove that I am plication of proving that our large ordinals are reaily better than you are. ordinals. 4) However, the situation is more complicated than 6) These considerations have little practical signi- this. Obviously, the improvement process may be ficance in their present form. Namely, the original carried out any finite number of times and a little improvement process is such that the improved process thought shows that the process can be carried out an is likely to be too slow to get results in a reasonable infinite number of times. Namely, letp be the original time, whether carried out by man or by machine. It procedure, and let Post's improvement procedure be may be possible, however, to put this hierarchy in called P, then Pop represents the original procedure some usable form. improved n times. We can define Prp as a procedure In conclusion, let me re-assert that the question of that applies p for a while, then Pp for a while, then p whether there are limitations in principle of what again, then Pp, then Pep, then p, then Pp, then p2p, problems man can make machines solve for him as then Pep, etc. This procedure will decide any problem compared to his own ability to solve problems, really that any pn will decide, and so may justifiably be IS a technical question in recursive function theory. called poop. However, poop is itself subject to Post's original improvement process and the result may be 15. REFERENCES called PO>+lp. How far can this go? The answer is technical. Namely, given any recursive transfinite 1) M~Cax:thy. J.: A Basisfor a Mathematical Theory of Comou- ordinal one can define Prp, A recursive ordinal is a tation.vn Computer Programming and Formal Systems Edited lX, by P. Braffort and D. Hirshberg North-Holland Am;terdam ~ecursive ordering of the integers that is a well-ordering (1963). ' III the sense that any subset of the integers has a least 2) McCarthy, J.: Checking Mathematical Proofs by Computer, member in the sense of the ordering. Thus, we have a Proc. Symp. on Recursive Function Theory (1961).Amer. Math. Soc. (1962).

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.