| Geoffrey S. Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, 1991. Also available as TR 91--1230. |
....but only if a version of f exists that applies to T . In the absence of any other definitions of f, this instantiation continues indefinitely. This defect is not specific to the particular algorithm chosen however satisfaction of assertions in the Cforall type system is undecidable. Smith [34] shows that an arbitrary Horn clause logic program can be embedded in a similar type system, and presents a reduction of the Post Correspondence Problem to the problem of satisfying assertions . The formation of infinite assertion sets can be prevented simply by setting a limit on the number of ....
.... and Blott [37] show how resolving uses of type classes can be implemented as a preprocessor before an application of Algorithm W to infer principal types, although their overloading rules result in the same sort of undecidability as is found in the assertion satisfaction algorithm presented here [34]. Expression analysis is decidable in Haskell, however, because the set of allowable overloadings are restricted compared to Cforall. In particular: the types of all overloads must be instances of the same generic type this type is defined in the class declaration using a type parameter. ....
Geoffrey S. Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, 1991. Also available as TR 91--1230.
....a b and hence acts as a generic coercion function. No attempt has been made to deal with systems including the rule of subsumption in the development of the type inference algorithm in Section 6, which is therefore only suitable for languages using explicit coercions. The results of [FM89] and [Smi91] are likely to be particularly useful in extending the present system to support the use of implicit coercions. 19 Acknowledgements I am very grateful for conversations with members of the Department of Computing Science, Glasgow whose suggestions prompted me to investigate the ideas presented ....
Geoffrey Smith. Polymorphic type inference for languages with overloading and subtyping. Ph.D. thesis, Department of Computer Science, Cornell University, August 1991.
....in type expressions and leads to a particularly simple implementation. In addition, this permits further useful extensions such as the possibility of defining overlapping instances. Several researchers, including this author, have investigated the theory and formal properties of type classes [8, 30, 29, 36, 44, 45, 50, 53] and there has 27 also been some experience with practical implementations [14, 28, 46, 5] and applications [27, 38, 13] Since these topics are so well documented, we will concentrate here only on the special features in the implementation of Gofer. We will also assume that the reader is ....
Geoffrey Seward Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Department of Computer Science, Cornell University, Ithaca, New York, August 1991.
....style type systems has been extensively studied in the last couple of years. We only mention a selected number of papers which extend the expressiveness of the Hindley Milner type system, such as record systems [Oho95, R em89, Wan89] overloading [Kae92, VHJW96, CHO92, OWW95, NP95] and subtyping [AW93, EST95b, Smi91]. Variations of the Hindley Milner system are also popular to perform certain kind of program analysis, such as [Ken94, DHM95, TJ92] More general frameworks have been introduced by Jones [Jon92] and Odersky Sulzmann Wehr [OSW99] In our own work we introduced a general framework for ....
Geoffrey S. Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Cornell University, Ithaca, NY, August 1991.
....systems give rise to a principal typing property for object expressions, using subtype qualified type schemes with relatively few subtype qualifications. Principal typings and their simplification by both syntactic and semantic entailment are the subject of a substantial number of papers; see e.g. [9, 5, 15, 29, 28, 6, 13, 23, 31, 24, 8]. All of these, however, operate in a context where co or contravariant subtyping is admitted and exploited during simplification. Since these simplifications are, in principle, unsound for invariant subtyping, principal typings with invariant object subtyping and their simplification is another ....
Geoffrey Seward Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, August 1991.
....Abstract. This article presents a type system based on the DamasMilner system[DM82] that supports overloading. Types of overloaded symbols are constrained polymorphic types. The work is related to Haskell type classes[Wad89,NP93,HHJW96] System O[OWW95] and other similar type systems[Kae88,Smi91,Jon94,DCO96] Restrictions imposed in these systems with respect to overloading are eliminated. User defined global and local overloading is supported without restrictions. There is no need for declarations or annotations of any sort. No language construct is added in order to cope with ....
....only context independent overloading. This means that constants cannot be overloaded, nor function symbols with types like, for example, read : String a, even though they could be used in contexts that resolve the overloading (e.g. read str = foo ) The type systems presented in [Kae88,Smi91,DCO96] also support only context independent overloading. System O requires explicit annotation of the type of each overloaded function symbol. Thus, there is no type inference for overloaded symbols. System O requires all type constructors of the arguments of overloaded functions to be pairwise ....
[Article contains additional citation context not shown here]
Geoffrey Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, 1991.
.... type t can be used to represent collections of values of type s [1] t Dual s Values of types t and s represent the elements of dual lattices [9] s t s is a subtype of t ; in practice, this usually means that values of type s can be treated as values of type t by applying a suitable coercion [16, 17, 4, 3, 19]. r has l : t r is a record type containing an field labelled l of type t [6] r lacks l r is a record type, not including a field labelled l [6] r1#r2 The record types r1 and r2 do not have any fields in common [5] Figure 1: Examples of individual predicates and their informal interpretation ....
....: Int Int) z : Bool g, but there is no derivable typing for the expression f z using the assignment A 0 . We avoid this problem in the completeness theorem below by including an assumption of the form A sat P 0 SA 0 as an extra hypothesis. A similar technique is used in Smith s thesis [19]. In the remaining part of this section, we will describe a replacement for the Completeness W result in Figure 4 that allows the use of the rules (Simp) and (Imp) at arbitrary points during type inference. Combined with Completeness s , we will show how this can be used to establish Theorem ....
[Article contains additional citation context not shown here]
Geoffrey Seward Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Department of Computer Science, Cornell University, Ithaca, New York, August 1991.
....where even empty classes, which do not have any instances at all, are considered legal. This approach works well in a system with separate compilation, where the type checker does not have complete knowledge of instance declarations. By contrast, the closed world approach of e.g. Rou90, Smi91, Kae92] rules out empty type schemes. Duggan and Ophel [DO94] support both approaches by distinguishing between open and closed kinds. Volpano [Vol93] has argued that many previously known open world systems are unsound. Volpano s negative results arise because he works with an untyped dynamic ....
....type variable constraint o : ff , where o does not have any explicitly declared instances at all. Consequently, there is no need to rule out such a type scheme statically. This corresponds to Haskell s open world approach to type checking, as opposed to the closed world approach of e.g. Smi91] Interestingly, the only thing that distinguishes those two approaches in the semantics of type schemes is the absence or presence of the bottom type . We now show that System O is sound, i.e. that syntactic type judgements Gamma p : oe are reflected by semantic type judgements Gamma j= p ....
Geoffrey S. Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Cornell University, Ithaca, NY, August 1991.
....from monomorphic subtyping become immediately applicable (see introduction) We have admitted type schemes that have no simple type instances. Our results carry over to a system where this is forbidden, for example in a system with added premise C C 0 [ ff] in rule [GEN] in Figure 2 [Smi91]. 4 Conclusion and related work 4.1 Conclusion We have studied fundamental syntactic properties of polymorphic subtyping with simple types and subtype qualified type schemes. We have introduced the halbstark instance relation on typing judgements, which is a hybrid of Mitchell s weak instance ....
.... of such transformations are simplifications that primarily seek to reduce the size and number of coercions in typing judgements and type schemes, such as Fuh and Mishra s G simplification and a somewhat restricted S simplification [FM89] as well as the simplifications Smith describes in his thesis [Smi91]. Finally we have shown that typing judgements are closed under j reduction, let folding and unfolding, but not generally under fi reduction, unless the subtyping theory obeys the decomposition property : C ( 0 ) AE AE 0 ) only if C AE and C 0 AE 0 . The invariance of ....
[Article contains additional citation context not shown here]
Geoffrey Seward Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, August 1991.
....basic building block in the design of type systems for various programming languages. A number of extensions have been proposed to increase the expressiveness of the Hindley Milner type system, such as record systems [Oho95,R em89,Wan89] overloading [Kae92,VHJW96,CHO92,OWW95,NP95] and subtyping [AW93,EST95,Smi91]. A general theory of qualified types has been studied by Jones [Jon92] He used his system to study record and overloading systems. Based on these approaches, some even more advanced systems [Nis98,JJM97,Weh97] have recently been proposed. The first systems deals with dynamic messages and the ....
....to a closed world approach. There we need full knowledge about the whole world at type checking time. In case of the the above example we need to provide an actual instance of class Eq in order to trade the constraint Eq ff from the left hand side to the right hand side of the turnstile. Smith [Smi91] gave a formulation of a quantifier introduction rule that models a closed world approach: 8 Intro Smith) C D; Gamma e : oe ff 62 fv( Gamma ) C e [ ff]D C; Gamma e : 8ff:D ) oe We find that the decision for an open or a closed world approach is fixed by the kind of quantifier ....
Geoffrey S. Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Cornell University, Ithaca, NY, August 1991.
....building block in the design of type systems for various programming languages. A number of extensions have been proposed to increase the expressiveness of the Hindley Milner type system, such as record systems [Oho95, R em89, Wan89] overloading [Kae92, VHJW96, NP93, CHO92, OWW95] and subtyping [AW93, EST95, Smi91]. A general theory of qualified types has been studied by Jones [Jon92] He used his system to study record and overloading systems. Based on these approaches, some even more advanced systems [Nis98, JJM97, Weh97] have recently been proposed. All these systems use a syntactic notion of ....
....world approach. There we need full knowledge about the whole world at type checking time. In the above example this would require that we need to provide an actual instance of class Eq in order to trade the constraint Eq ff from the left hand side to the right hand side of the turnstile. Smith [Smi91] gave a formulation of a quantifier introduction rule that models a closed world approach: 8 Intro Smith) C D; Gamma e : oe ff 62 fv( Gamma) C e [ ff]D C; Gamma e : 8ff:D ) oe But it turns out that both approaches can be modeled within the HM(X) framework. Recall the (8 ....
Geoffrey S. Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Cornell University, Ithaca, NY, August 1991.
.... type t can be used to represent collections of values of type s [1] t Dual s Values of types t and s represent the elements of dual lattices [11] s t s is a subtype of t ; in practice, this usually means that values of type s can be treated as values of type t by applying a suitable coercion [17, 18, 5, 4, 20]. r has l : t r is a record type containing an field labelled l of type t [7] r lacks l r is a record type, not including a field labelled l [7] r 1 #r 2 The record types r 1 and r 2 do not have any fields in common [6] Figure 1: Examples of individual predicates and their informal ....
....(Int Int) z : Bool g, but there is no derivable typing for the expression f z using the assignments in A 0 . We avoid this problem in the completeness theorem below by including an assumption of the form A sat P 0 SA 0 as an extra hypothesis. A similar technique is used in Smith s thesis [20]. In the remaining part of this section, we will describe a replacement for the Completeness W result in Figure 4 that allows the use of the rules (Simp) and (Imp) at arbitrary points during type inference. Combined with Completeness s , we will show how this can be used to establish Theorem ....
[Article contains additional citation context not shown here]
Geoffrey Seward Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Department of Computer Science, Cornell University, Ithaca, New York, August 1991.
....If A , then AS S S. Next we give conditions under which an assumption is not needed in a derivation: Lemma 4 If A[fx : oeg y : x does not occur in A, and x and y are distinct identifiers, then A y : If A [ fx : oeg , then A . Proofs can be found in [14]. Extra assumptions never cause problems: Lemma 5 If A e : oe then A [ B e : oe. If A then A [ B . More substantially, there is a normal form theorem for derivations. Let (8 elim be the following weakened (8 elim) rule: 8 elim ) x : 8ff with C : 2 A A C[ff ....
....fseq( seq(i) bool bool ; bool ffl; seq( seq( g and the body seq(ffi 1 ) seq(fl 1 ) fi 1 : We have made progress; we can now see that lexicographic is a function that takes two sequences as input and returns some output. Algorithms for shape unification are given in [14] and in [5] 23 body: seq(ffi 1 ) seq(fl 1 ) fi 1 ff 1 OE AE i bool oe fi 1 ffl j Figure 6: Atomic Inclusions for lexicographic The new constraint set contains the inclusion seq( seq(i) By our restrictions on subtyping, this constraint is equivalent to the simpler ....
[Article contains additional citation context not shown here]
Geoffrey S. Smith. Polymorphic Type Inference for Languages with Overloading and Subtyping. PhD thesis, Cornell University, August 1991. Also available as TR 91--1230.
No context found.
Smi91. Geoffrey S. Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Cornell University, Ithaca, NY, August 1991.
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