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.

34 3 The principal-type algorithmOn the A-calculus side the first PT algorithm was due to James H. Morrisand was written out with a correctness proof in his thesis Morris 1968.This was an equation-solving algorithm and like all such, including Curry's, itautomatically did all the unification it needed without calling on an externalalgorithm.'For about ten years after 1968 type-assignment remained a very specialist topic,then the development of ML by Robin Milner and his group led to a surge of interestin assignment systems and PT algorithms. Milner's own algorithm was invented asa preliminary to this development, and was applied to-types and pair-types in aA-calculus with the extra operator let that is characteristic of ML. It was written outformally in Milner 1978 and rewritten and extended in Damas and Milner 1982.2Milner's algorithm, like Hindley's, depended on Robinson's unification algorithm tosave work.3Since Milner 1978 many modified or extended PT algorithms have been published,some depending on external unification algorithms and others being self-sufficient.See Tiuryn 1990 for a survey.3A7.1 Note The PT algorithm in this chapter will use the method of Hindley 1969and Milner 1978 rather than equation-solving.As mentioned above this method depends on a unification algorithm given inadvance, but unification algorithms are widely available as packages in practice, sothis feature makes a PT algorithm easy to fit into an already given system in apractical implementation.This method will also turn out to be well suited to deal with the case wherethe term whose PT is being computed is a combination of other terms Pt,...,Pwhose PT's are already known. This situation is common in practice, where alibrary of terms and their PT's can be built up and used in determining the PT's ofnew terms, and one of the original motivations for the method was a belief that itwould probably use such accumulated information more efficiently than a straightequation-solving algorithm.However, the account in this chapter will not be concerned with maximizingefficiency, but only with the (usually incompatible) aim of making the PT algorithm'sstructure and motivation as clear as possible.3B Type-substitutionsTo make the statement of the PT algorithm reasonably concise it will help tointroduce some preliminary definitions and lemmas on type-substitutions.Morris 1968 was independent of Curry's 1966-67 work and must have been prepared at about thesame time. Although Morris 1968 was never published there are later accounts of equation-solvingA-calculus algorithms available in the literature; for example there is one with a correctness-proof inWand 1987.2 Milner's algorithm was discovered independently of earlier work. Milner 1978 did not contain acorrectness-proof but there was one in the thesis Damas 1984 to which Damas and Milner 1982referred.3 The history of these early algorithms seems to be a tale of repeated re-discovery of very similar ideas.This is not really very surprising, as the ideas are very simple once they are approached in the rightway; it is their applications that make them important, not any intrinsic subtlety.

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

Saved successfully!

Ooh no, something went wrong!