| Luis Manuel Martins Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, Edinburgh, Scotland, April 1985. |
....This allows integer and boolean values to be applied to the identity function in the same context. Hence, a polymorphic type system allows more programs to be typed than a monomorphic type system. 2. 2 The Hindley Milner System I give a description of the Hindley Milner type system following [Dam85, Mil78]. The Hindley Milner system is divided into three parts. The logical system describes the valid type judgments, the semantic model gives a meaning to valid judgments, and nally the inference system which allows to infer a type for a given untyped program. It should be noted that standard ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, Edinburgh University, 1985.
....Mitchell s but which also treats let bound variables in a compositional way and computes principal typings. Based on the results of the inference algorithm Chitil defines an explanation graph and provides the means to navigate it. A similar algorithm has also be proposed by Damas as algorithm T [10]. Principal typings have been investigated separately, Wells [37] gives a good overview of their use in theory and practice. 6.2 Type Errors Wand [34] instruments unification in a type inference algorithm for an implicitly typed lambda calculus. Each substitution created during a unification is ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, Computer Science Department, Edinburgh University, 1985. report CST-33-85.
....trying to show the soundness and completeness of W directly. It is just proving that the result of W and Match is equivalent to the result of W. Proving this kind of equivalence is relatively easier. From the soundness and completeness of the algorithm W(which is proved in Damas s Ph.D thesis [6]) and the above theo rem 2.1, we can easily get the following soundness and completeness results for our algorithm W . Corollary 2.2 (Soundness of W ) Given a type environment TE and an ML expression e, if both (r ,A) W (e) and S = Match(TS,A) succeed, then S (TE ) e: Corollary 2.3 ....
....theorem 2.1. Because their system allows mutually recursive top level declarations, it cannot fully recover the correct type information by simply using our assumption inference and matching algorithm. In the SML module language, however, top level declarations cannot be mutually recursive. Damas [6] gave an inference algorithm called T which is very similar to our W in section 2. His type system permits that a variable can be bound to several distinct types in the type environment (just like our assumption environment) However since he mainly used the system to handle overloading, he did ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, Department of Computer Science, Edinburgh, UK, 1985.
....by a simple type. In Core ML, a value expression may inhabit more than one simple type. This judgement should be clearly distinguished from the judgement (required by Hypothesis 3.19) that classifies an expression by a value type, i.e. a universally quantified simple type. As for ordinary ML [41, 16], it is a property of Core ML that every typable value expression has a principal,ormost general, value type. The judgements are defined by the following rules: Simple types denote semantic simple types. # a#u (C 1) C#u#u C#u # #u # # #u#u # (C 2) # #( # a 0 , # a k 1 ) u #i#[k] ....
....infinite supply of currently unused variables. For the moment, we shall follow Milner and Tofte [41, 55] and be vague about what it means to choose a fresh variable. We shall be more precise about this in our own algorithms. satisfies the following theorem: Theorem 8. 5 (Correctness of [41, 16]) For every context and expression e: C#e# value type and a substitution, or failure. C#e#v,#, then #(C) e:v. Completeness If # 1 (C) e:v 1 then for some v , # and # 2 , # = # 1 and # 2 (v) v 1 . Indeed, the termination, soundness and completeness properties of are ....
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, University of Edinburgh, April 1985.
....explored in ML [15, 28, 29] This style of polymorphism, called implicit polymorphism, is based on the idea that programs are type free, with types interpreted as predicates expressing properties of programs under evaluation. Numerous extensions of these ideas have been explored in the literature ([7, 25, 31, 45], to name just a few) Although implicit polymorphism is appealingly simple and natural, it does not scale well to more sophisticated language features such as modularity and abstract types [20] Recent languages, notably Quest [4] and LEAP [35] are based instead on the notion of explicit ....
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Edinburgh University, 1985.
....overloaded identifiers, and to specify the implementation function to use for each argument type. Object oriented languages, especially, have sophisticated support for user defined overloading. Compile time overloading resolution and MLstyle polymorphic type inference do not work well together [10]. In processing a function definition such as fun double(x) x x it is impossible to know at compile time whether is to be implemented as integer or floating point addition. This is not a dangerous trap for the programmer, since any ambiguous function such as double will be caught at ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, University of Edinburgh, 1985.
....Top down type inference (Figure 2. 5) answers the question What restriction must be made to type variables for expression e to have type t in environment G (It takes an expression, environment and target type and returns a substitution) W satisfies two theorems, which are proved in [Dam85] similar theorems can be shown for M [LY98] Theorem 1 (Soundness of W ) If W then there is a derivation of Theorem 2 (Completeness of W ) Given let G be an instance of G and h be a type scheme such that G e : h. Then 1. W G 144 P Theorem 3 (Soundness of M) ....
....to the usual most general types) Again this type could be of use to programmers wishing to understand the types in their program by removing unnecessary polymorphic types. Xavier Leroy has tackled the problem of typing references and continuations [Ler93] Damas also dealt with this problem [Dam85] To show the difficulty with with polymorphic references, consider for example val r = ref [ fun f r = r : 1, 2, 3] val p = f r, r) From the first line, it looks like r should have the polymorphic type scheme a. a list ref (according to the semantics in Figure 2.3. In the last line, ....
[Article contains additional citation context not shown here]
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, The University of Edinburgh, James Clerk Maxwell Building, The Kings Buildings, Mayfield Road, Edinburgh EH9 3JZ, U.K., April 1985. CST--33--85.
.... : 0 P j A s MN : I ) s P j A x ; x : 0 s M : P j A s x :M : 0 (let) s P j A s M : P 0 j A x ; x : oe s N : 0 P 0 j A s (let x = M in N ) 0 oe = Gen(A; P ) Figure 4: Syntax directed inference system A similar result is established in [Dam85] where it is shown that for any derivation A M : in the usual (non deterministic) ML type system and any substitution S , there is a derivation SA M : S which can be chosen in such a way that the height of the latter is bounded by the height of the former. This additional condition is needed ....
Luis Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, CST-33-85, 1985.
....But Property B principal typings is more useful still. We believe this has been overlooked because ML and its extensions completely dominate current research on type inference; and we know of no sense in which ML has principal typings. This was already noted by Damas in his dissertation [6], but there have been subsequent claims that ML has the principal typing property, indicating that the distinction between principal types and principal typings is not widely appreciated. We examine ML s lack of principal typings more closely in x6. In this paper, we demonstrate the usefulness of ....
....system with the following property: for any ML typable term M , there is a judgement in the Shao Appel system that encodes all of the ML typings for M , in an appropriate sense. They did not prove a principal typing property for their system, but it is essentially identical to a system of Damas [6]. Damas proved a principal typing theorem for his system, and showed that it types exactly the same terms as ML. The systems P 2 and 2 are a second example of this phenomenon. We have shown that P 2 has principal typings and types exactly the same terms as 2 . However, 2 does not have ....
[Article contains additional citation context not shown here]
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, 1984.
....for the applicative one, even though they have exactly the same semantics. As demonstrated here, the programming style (imperative vs. applicative) interferes with the type specifications. This clearly goes against modular programming. Some enhancements to the ML type system have been proposed [4, 16, 17, 1], that weaken the restrictions over polymorphic mutable data. Standard ML [11] incorporates some of these ideas. These enhanced type systems make it possible to define many useful generic functions over mutable data structures, such as the function that copies a vector. However, these systems are ....
....= infer(oeE; b; Delta) let = mgu(aeA; B ref ) in (B; aeoe; Theta) This algorithm enjoys the good properties of the Damas Milner algorithm: it is correct and complete with respect to the typing rules, and the inferred type is the most general one. The proof is very similar to Damas proof [4]. 3.6 Relation to ML We have introduced closure typing as a way to keep track of mutable values embedded in functions. As a consequence, two expressions having the same functional type in ML may now be distinguished 3.6 Relation to ML 11 by their closure type, and we may fear that this leads to ....
[Article contains additional citation context not shown here]
Luis Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, 1985.
.... Hindley Milner type system A discussion of type systems in general can be found in [Car97] The semantics of the Hindley Milner type system (and the inference algorithm W ) are introduced in Milner s paper [Mil78] The operational presentation of the semantics is given in [DM82] Damas s thesis, [Dam85], proves soundness and completeness of W . The proofs in my work on symmetric type inference, McA98b] are based on the proofs in Damas s thesis. The thesis also describes variants of Hindley Milner inference for imperative features of languages. Other variants of Hindley Milner type systems ....
....questions in which the modified syntax is explicitly given. 5 Progress so far Work so far on this project has concentrated on inference rather than analysis and debugging. Initially time was spent investigating the state of the art: the classical results by Milner and Damas ( DM82] Mil78] [Dam85]) more novel forms of type inference ( LY98] BS95] and work related to mine (in explanation ( DB96] BS93] debugging ( Rit93] and programming environments ( RT97] WBL97] In addition to studying related material, I have produced two technical reports and am working on a third paper ....
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, The University of Edinburgh, April 1985. CST--33--85.
.... type schemes and types, OE, is such that oe OE ioe there exist some simple types 0 and , and variables ff such that oe = 8 ff: 0 and = 0 [ ff] We present a syntax directed type inference system (see table 2 on the next page) in the same vein as [12] Note that, contrary to [14], we give simple types to processes and not type schemes. An enjoyable propriety of such system is that the structure of a valid typing sequent Gamma P : is P . For convenience, we neglect to give a typing rule for multiple replicated declarations (hu = P i) since, like in B , it is ....
....over variables. We refer the reader to the note in page 4 and to [28, 8] where the same discussion appears. Terms of core ML are dened by the grammar M : x fi fi (MM) fi fi x:M fi fi let x = N in M fi fi rec x:M A type inference system, based on the one given by Damas in his thesis [14], is presented in Table 4. A characteristic of the Damas Milner Calculus is that occurrences of a function inside the body of its (recursive) denition can only be used monomorphically. To overtake this limitation, Mycroft [29] suggested a typing rule for polymorphic recursive denitions INRIA ....
[Article contains additional citation context not shown here]
Luis Manuel Martins Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, 1984.
....atomic, C is regular, and that all flows occurring in are flow variables. We will also need to demonstrate that K; C; TE e : is a valid derivation in L2 . We present the inference algorithm in inference rule format in Figure 4. The algorithm is in a style reminiscent of Damas Algorithm T [5]. The following notations are used: Notation: TE x denotes the type environment TE with all occurrences of x deleted; further, TE 1 TE 2 ) x) 8 : TE 1 (x ) x 2 dom(TE 1 ) x 62 dom(TE 2 ) TE 2 (x ) x 2 dom(TE 2 ) x 62 dom(TE 1 ) TE 1 (x ) TE 2 (x ) x 2 dom(TE 1 ) and x 2 ....
Luis Manuel Martins Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, Edinburgh, Scotland, April 1985.
....Finally, extensions of the results presented here indicate ways to resolve instances of overloading resolution, i.e. determining the types of overloaded operators ( and resolving flex records. A full version of this extended abstract is found in [2] The type inference algorithm W presented by [4, 3] generates most general type schemes for ML programs, allowing maximal flexibility in program composition. As a side effect, W also provides a typing derivation or, equivalently, a type annotation. However, the type schemes associated with let bound variables generally will contain type ....
....substitution theorem is now immediate: If the judgement TE e : is a well formed, then TE e : is well formed too. We take e to be the expression where typing information has been erased, i.e. e : x j (e; e 0 ) j e e 0 j x:e j let x = e in e 0 Type schemes are ordered as in [3]: let oe = 8 ff: and oe 0 = 8 ff 0 : 0 be type schemes, and let be a substitution with dom ff 0 , then: oe oe 0 iff = 0 and ff does not contain variables free in oe 0 . This ordering is generalized to an ordering over annotations e; e 0 with the same erasure ....
[Article contains additional citation context not shown here]
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, 1984.
....des unificandes simplifie egalement les preuves de correction des algorithmes en les s eparant des etapes el ementaires. 1 Introduction The ML language introduced by R. Milner in 1978 has become very poplular, which is partly due to the possibility of inferring principal types for programs [DM82, Dam85]. This is a consequence of the restriction of arbitrary quantification as in the polymorphic lambda calculus to prenex quantification in ML. However, viewing ML as a restriction of the polymorphic lambda calculus is sometimes misleading: ML terms are untyped terms (Church s view) while terms of ....
Luis Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, 1985.
....Kit [BRTT93] and in the conclusion we discuss some possible future work. The type inference algorithm for the ML type discipline (Algorithm W) was presented by Damas and Milner in the paper, Principal Type Schemes for Functional Programs [DM82] and was proven correct in Damas PhD dissertation [Dam85]. Most of the research in this area has concentrated on improving the diagnostic messages generated by the type inference algorithm. Wand [Wan86] presented a type inference algorithm that keeps a record of the pieces of code that contribute to each type deduction. This information is then used to ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, Edinburgh, U.K., 1985.
....to show the soundness and completeness of W directly. It is just proving that the result of W and Match is equivalent to the result of W . Proving this kind of equivalence is relatively easier. From the soundness and completeness of the algorithm W (which is proved in Damas s Ph.D thesis [6]) and the above theorem 2.1, we can easily get the following soundness and completeness results for our algorithm W . Corollary 2.2 (Soundness of W ) Given a type environment TE and an ML expression e, if both ( A) W (e) and S = Match(TE ; A) succeed, then S (TE 0 ) e ....
....theorem 2.1. Because their system allows mutually recursive top level declarations, it cannot fully recover the correct type information by simply using our assumption inference and matching algorithm. In the SML module language, however, top level declarations cannot be mutually recursive. Damas [6] gave an inference algorithm called T which is very similar to our W in section 2. His type system permits that a variable can be bound to several distinct types in the type environment (just like our assumption environment) However since he mainly used the system to handle overloading, he did ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, Department of Computer Science, Edinburgh, UK, 1985.
....to show the soundness and completeness of W directly. It is just proving that the result of W and Match is equivalent to the result of W . Proving this kind of equivalence is relatively easier. From the soundness and completeness of the algorithm W(which is proved in Damas s Ph.D thesis [6]) and the above theorem 2.1, we can easily get the following soundness and completeness results for our algorithm W . Corollary 2.2 (Soundness of W ) Given a type environment TE and an ML expression e, if both ( A) W (e) and S = Match(TE ; A) succeed, then S (TE 0 ) ....
....theorem 2.1. Because their system allows mutually recursive top level declarations, it cannot fully recover the correct type information by simply using our assumption inference and matching algorithm. In the SML module language, however, top level declarations cannot be mutually recursive. Damas [6] gave an inference algorithm called T which is very similar to our W in section 2. His type system permits that a variable can be bound to several distinct types in the type environment (just like our assumption environment) However since he mainly used the system to handle overloading, he ....
Luis Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, Department of Computer Science, Edinburgh, UK, 1985.
....message. The next section explains where in the type inference algorithm these problems arise. 3 Type Systems and the Inference Algorithm An introductory discussion of the type systems and the inference algorithm can be found in [Car87] Proofs of the algorithm W s correctness can be found in [Dam85]. 3.1 Types, Type Schemes and Type Environments In this paper we will consider types which are built from type variables (ff; fi : hence types are polymorphic) type constants (int, real and others) and the function type constructor . The form of polymorphism in Hindley Milner ....
....Given ( Gamma; e) let Gamma 0 be an instance of Gamma and j be a typescheme such that Gamma 0 e : j. Then 1. W ( Gamma; e) succeeds 2. If W ( Gamma; e) P; then for some R: Gamma 0 = RP Gamma, and j is a generic instance of RP Gamma( Proofs of these theorems can be found in [Dam85]. We will revisit these theorems after the algorithm is modified later in the paper. 4 New Algorithm We have already seen some examples demonstrating the left to right bias of W and have seen how the algorithm works, so we now know why the bias arises (in the case of application) the problem ....
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, The University of Edinburgh, April 1985. CST--33--85.
.... T 4 T 1 T 2 T 3 T 4 Fix2: t 1 t 2 T 1 [x t 1 ] T 2 [x t 2 ] fix x:T 1 fix x:T 2 The inference rules assume that operator is associative, commutative, and idempotent. The final step in defining our type language is adding the notion of universal quantification. As in ML[8, 7], we restrict universal quantification to the outside of type terms. In this restricted setting, type terms containing quantifiers are called type schemes. A type scheme is defined by the grammar: oe : j8t:oe where denotes the set of tidy terms. The types of polymorphic operations are ....
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, 1985.
....bias rejection must be delayed until the entire expression e 0 e 1 is being examined. 3 Type Systems and the Classic Inference Algorithm An introductory discussion of type systems and the inference algorithms can be found in [Car87] Proofs of algorithm W s correctness can be found in [Dam85]. This section begins by summarising the language and type system used in the remainder of the paper. 3.1 Types, Type Schemes and Type Environments In this paper we will consider types which are built from type variables (ff; fi : hence types are polymorphic) type constants (int, real and ....
....e1) let (S0 ; 0) W ( Gamma; e0) S1 ; 1) W (S0 Gamma x [ fx : S0 Gamma ( 0 )g; e1) in (S1S0 ; 1) 1. W ( Gamma; e) succeeds 2. If W ( Gamma; e) P; then for some R: Gamma 0 = RP Gamma , and j is a generic instance of RP Gamma ( Proofs of these theorems can be found in [Dam85]. We will revisit these theorems after the algorithm is modified later in the paper. 3.5 Source of Left to Right Bias The left to right bias arises because the first substitution, S 0 , is applied to the type environment, Gamma , before type checking e 1 . This means that if an identifier is ....
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Department of Computer Science, The University of Edinburgh, April 1985. CST--33--85.
....bound in an outer scope and within the scope of its binding is treated as a constant type. Exception declarations raise similar problems, which are handled by an analogous use of weak type variables. The Cardelli and Edinburgh compilers used an earlier form of this treatment proposed by Damas[14]. This earlier version was looser in one respect (it allowed unbound weak type variables in types) and more restrictive in another (multiple levels of lambda abstraction were not allowed) and it had some rather counterintuitive effects. 3.6. Modules The simplest kind of module in Standard ML is ....
Luis Damas, "Type Assignment in Programming Languages," PhD Thesis, Department of Computer Science, University of Edinburgh, 1985.
No context found.
Luis Manuel Martins Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, Edinburgh, Scotland, April 1985.
No context found.
Luis Manuel Martins Damas. Type assignment in programming languages. PhD thesis, University of Edinburgh, Edinburgh, Scotland, April 1985.
No context found.
Luis Manuel Martins Damas. Type Assignment in Programming Languages. PhD thesis, Edinburgh University, 1985.
First 50 documents
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC