12.07.2015 Views

number-theory

number-theory

number-theory

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3A Principal types and their history 333A6 Principal Type (PT) Theorem Every typable term has a principal deductionand a principal type in TA2. Further, there is an algorithm that will decide whether agiven A-term M is typable in TAx, and if the answer is "yes" will output a principaldeduction and principal type for M.Proof See the PT algorithm and correctness-proof in 3E.3A6.1 Exercise* Let B - The type assigned to B in Example 2A8.2 was(a-*b)-> (c-+a)->c-+b.Using the subject-construction theorem (2B2), show that this type is principal for B.That is, show that every type assigned to B in TA2 must have formwhere p, U, T are arbitrary types.(P- x)-(t-P)->Q-*t,3A7 Historical Comment The PT problem, that of deciding whether a term istypable and finding its principal type if it is, is one that is crucial to many typesystems,and several different PT algorithms have appeared in the literature overthe years. One of the best known is probably Algorithm W of Damas and Milner1982. This was devised originally by Robin Milner for the language MLwhich includes the present system and a version first appeared in print in Milner1978.But the history of PT algorithms goes back a long way before 1978. There seem tohave been two mainly independent strands of development, one in A-calculus withcombinatory logic and the other in propositional logic. We shall leave the latteruntil Chapter 7, but it is almost certainly the older of the two; indeed what amountsto the core of a PT algorithm was formulated in propositional logic as long ago as1957 and was actually run on a computer at that date, and the informal idea behindsuch algorithms may go back as far as the 1920's (see 7D3).The first informal use of a PT algorithm in combinatory logic or A-calculuswas probably due to Haskell Curry in the 1950's. Particular examples of typecomputationsoccur in Curry and Feys 1958 (§9B2, pp.284-293) and show veryclearly the equation-solving method on which several later formal algorithms werebased. But, as mentioned earlier, Curry was mainly interested in stronger systemsat that time and only afterwards began to look at simple type-assignment on itsown. When he did, he wrote up his earlier methods as a formal equation-solving PTalgorithm for TAc and added a proof of its correctness; these survive in his notesCurry 1966 and were published in Curry 1969.A PT algorithm and a correctness-proof were also included in an account of TAcin Hindley 1969, but these differed from Curry's in that the algorithm made explicituse of the unification algorithm of Robinson 1965 to save itself some work.'The preparation of Curry 1969 and Hindley 1969 took place in about 1967 with the authors discussingmatters frequently but deliberately keeping their approaches different.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!