## Principal Type Schemes for Functional Programs with Overloading and Subtyping (1994)

### Cached

### Download Links

- [www.cs.fiu.edu]
- [www.cs.fiu.edu]
- [users.cis.fiu.edu]
- [users.cs.fiu.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | Science of Computer Programming |

Citations: | 44 - 1 self |

### BibTeX

@INPROCEEDINGS{Smith94principaltype,

author = {Geoffrey S. Smith},

title = {Principal Type Schemes for Functional Programs with Overloading and Subtyping},

booktitle = {Science of Computer Programming},

year = {1994}

}

### Years of Citing Articles

### OpenURL

### Abstract

We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and prove its soundness and completeness. We find that it is necessary in practice to simplify the inferred types, and we describe techniques for type simplification that involve shape unification, strongly connected components, transitive reduction, and the monotonicities of type formulas.

### Citations

936 | A theory of type polymorphism in progra.mming
- Milner
- 1978
(Show Context)
Citation Context ... system supports polymorphism by allowing some programs to have multiple types, thereby allowing them to be used with greater generality. The popular polymorphic type system due to Hindley and Milner =-=[7, 10, 3]-=- uses universally quantified type formulas to describe the types of polymorphic programs. Each program has a best type, called the principal type, that captures all possible types for the program. For... |

358 |
Principal type-schemes for functional programs
- Damas, Milner
- 1982
(Show Context)
Citation Context ... system supports polymorphism by allowing some programs to have multiple types, thereby allowing them to be used with greater generality. The popular polymorphic type system due to Hindley and Milner =-=[7, 10, 3]-=- uses universally quantified type formulas to describe the types of polymorphic programs. Each program has a best type, called the principal type, that captures all possible types for the program. For... |

344 | How to make ad-hoc polymorphism less ad hoc
- Wadler, Blott
- 1989
(Show Context)
Citation Context ...ll a program well typed unless we can give it a type with a satisfiable constraint set. 1.1 Related Work Overloading (without subtyping) has also been investigated by Kaes [8] and by Wadler and Blott =-=[19]-=-. Kaes' work restricts overloading quite severely; for example he does not permit constants to be overloaded. Both Kaes' and Wadler/Blott's systems ignore the question of whether a constraint set is s... |

267 |
Semantics of Programming Languages: Structures and Techniques. Foundations of Computing
- Gunter
- 1992
(Show Context)
Citation Context ...ed. ffl Efficient methods for testing the satisfiability of constraint sets need to be developed. ffl Because our type system can derive a typing in more than one way, the semantic issue of coherence =-=[6]-=- should be addressed. ffl It would be nice to extend the language to include record types, which obey interesting subtyping rules, but which would appear to complicate type simplification. 7.1 Acknowl... |

158 |
The transitive reduction of a directed graph
- Aho, Garey, et al.
- 1972
(Show Context)
Citation Context ...ause this definition of close satisfies Lemmas 10 and 11, W os remains correct if this new close is used. One important aspect of close that has not been mentioned is its use of transitive reductions =-=[1]-=-. As we perform monotonicity-based instantiations, we maintain the set of inclusion constraints E i in reduced form. This provides an efficient implementation of the guard of the while loop in the cas... |

142 |
The principal type-scheme of an object in combinatory logic
- Hindley
- 1969
(Show Context)
Citation Context ... system supports polymorphism by allowing some programs to have multiple types, thereby allowing them to be used with greater generality. The popular polymorphic type system due to Hindley and Milner =-=[7, 10, 3]-=- uses universally quantified type formulas to describe the types of polymorphic programs. Each program has a best type, called the principal type, that captures all possible types for the program. For... |

103 |
Transformational systems and the algebraic structure of atomic formulas
- Reynolds
- 1970
(Show Context)
Citation Context ...in e as well as all the subtyping assumptions made, and S is a substitution that contains refinements to the typing assumptions in A. Case 1 of W os makes use of the least common generalization (lcg) =-=[12]-=- of an overloaded identifier x, as a means of capturing any common structure among the overloadings of x. For example, the lcg ofsis 8ff:ff ! ff ! ff. Case 3 of W os is the greatest departure from alg... |

71 |
Three approaches to type structure
- Reynolds
- 1985
(Show Context)
Citation Context ... assumptions to be used, and rules (reflex) and (trans) assert that ` is reflexive and transitive. The remaining inclusion rules express the well-known monotonicities of the various type constructors =-=[13]-=-. For example, ! is antimonotonic in its first argument and monotonic in its second argument. The name ((\Gamma) ! (+)) compactly represents this information. Finally, rule (`) links the inclusion sub... |

48 |
Parametric overloading in polymorphic programming languages
- Kaes
- 1988
(Show Context)
Citation Context ...e care, therefore, not to call a program well typed unless we can give it a type with a satisfiable constraint set. 1.1 Related Work Overloading (without subtyping) has also been investigated by Kaes =-=[8]-=- and by Wadler and Blott [19]. Kaes' work restricts overloading quite severely; for example he does not permit constants to be overloaded. Both Kaes' and Wadler/Blott's systems ignore the question of ... |

37 |
Coercion and type inference (summary
- Mitchell
- 1984
(Show Context)
Citation Context ...ession true + true is well typed, even though + does not work on booleans. Kaes' system has similar difficulties. Subtyping (without overloading) has been investigated by (among many others) Mitchell =-=[11]-=-, Stansifer [15], Fuh and Mishra [4, 5], and Curtis [2]. Mitchell, Stansifer, and Fuh and Mishra consider type inference with subtyping, but their 1 Throughout this paper, we write functions in currie... |

35 |
Subtype inequalities
- Tiuryn
- 1992
(Show Context)
Citation Context ...g but no overloading, it is shown in [20] and [9] that testing the satisfiability of a set of atomic inclusions is NP-complete. Testing the satisfiability of a set of arbitrary inclusions is shown in =-=[16]-=- to be PSPACE-hard, and [17] gives a DEXPTIME algorithm. 6 In our system, which has both overloading and subtyping, the restriction to overloading by constructors is enough to make the satisfiability ... |

26 |
Type inference with subtypes
- Stansifer
- 1988
(Show Context)
Citation Context ...ue is well typed, even though + does not work on booleans. Kaes' system has similar difficulties. Subtyping (without overloading) has been investigated by (among many others) Mitchell [11], Stansifer =-=[15]-=-, Fuh and Mishra [4, 5], and Curtis [2]. Mitchell, Stansifer, and Fuh and Mishra consider type inference with subtyping, but their 1 Throughout this paper, we write functions in curried form. 2 langua... |

25 | Algorithmic aspects of type inference with subtypes
- Lincoln, Mitchell
- 1992
(Show Context)
Citation Context ..., the restriction to overloading by constructors allows the satisfiability problem to be solved efficiently. On the other hand, for a system with subtyping but no overloading, it is shown in [20] and =-=[9]-=- that testing the satisfiability of a set of atomic inclusions is NP-complete. Testing the satisfiability of a set of arbitrary inclusions is shown in [16] to be PSPACE-hard, and [17] gives a DEXPTIME... |

23 |
Constrained quantification in polymorphic type analysis
- Curtis
- 1990
(Show Context)
Citation Context ... work on booleans. Kaes' system has similar difficulties. Subtyping (without overloading) has been investigated by (among many others) Mitchell [11], Stansifer [15], Fuh and Mishra [4, 5], and Curtis =-=[2]-=-. Mitchell, Stansifer, and Fuh and Mishra consider type inference with subtyping, but their 1 Throughout this paper, we write functions in curried form. 2 languages do not include a let expression; we... |

20 | Polymorphic Type Inference for Languages with Overloading and Subtyping
- Smith
- 1991
(Show Context)
Citation Context ...s not needed in a derivation: Lemma 4 If A[fx : oeg ` y :s, x does not occur in A, and x and y are distinct identifiers, then A ` y :s. If A [ fx : oeg `s`s0 , then A `s`s0 . 3 Proofs can be found in =-=[14]-=-. 9 Extra assumptions never cause problems: Lemma 5 If A ` e : oe then A [ B ` e : oe. If A `s`s0 then A [ B `s`s0 . More substantially, there is a normal form theorem for derivations. Let (8-elim 0 )... |

19 |
Type reconstruction with recursive types and atomic subtyping
- Tiuryn, Wand
- 1993
(Show Context)
Citation Context ...shown in [20] and [9] that testing the satisfiability of a set of atomic inclusions is NP-complete. Testing the satisfiability of a set of arbitrary inclusions is shown in [16] to be PSPACE-hard, and =-=[17]-=- gives a DEXPTIME algorithm. 6 In our system, which has both overloading and subtyping, the restriction to overloading by constructors is enough to make the satisfiability problem decidable [14]. But ... |

14 |
On the complexity of type inference with coercion
- Wand, O’Keefe
- 1989
(Show Context)
Citation Context ...subtyping, the restriction to overloading by constructors allows the satisfiability problem to be solved efficiently. On the other hand, for a system with subtyping but no overloading, it is shown in =-=[20]-=- and [9] that testing the satisfiability of a set of atomic inclusions is NP-complete. Testing the satisfiability of a set of arbitrary inclusions is shown in [16] to be PSPACE-hard, and [17] gives a ... |

12 |
On the complexity of ML typability with overloading
- Volpano, Smith
- 1991
(Show Context)
Citation Context ...nt set B is satisfiable with respect to an assumption set A if there is a substitution S such that A ` BS. Unfortunately, this turns out to be an undecidable problem, even in the absence of subtyping =-=[14, 18]-=-. This forces us to impose restrictions on overloading and/or subtyping. In practice, overloadings come in fairly restricted forms. For example, the overloadings ofswould typically bes: char ! char ! ... |