Type inference with partial types
This paper introduces a new form of type expressions which represent partial type information. These expressions are meant to capture the type information statically derivable from heterogeneous objects. The new monotypes form a lattice of subtypes and require type inference based on inclusion constraints. We discuss the existence and form of principle types under this extension and present a semi-decision procedure for the well-typing problem which can be restricted to a form that terminates for most practical programs. The partial type information derivable for heterogeneous entities is not sufficient to guarantee type-correctness for many of their uses. We therefore introduce a notion of statically generated dynamic type checks. Finally, all these elements are pulled together to sketch the derivation of a static system for "plausibility checking" which identifies the applications which may require a dynamic check and catches many type errors.
KeywordsNormal Form Inductive Assumption Partial Type Recursive Call Type Expression
Unable to display preview. Download preview PDF.
- Cardelli, L. (1984), A Semantics of Multiple Inheritance, Semantics of Data Types, International Symposium, LNCS 173.Google Scholar
- Cardelli, L. and Wegner, P. (1985), On Understanding Types, Data Abstraction and Polymorphism, Computing Surveys 17 (4).Google Scholar
- Clement, et al (1986), A Simple Applicative Language: Mini-ML, Proceedings of 1986 ACM Conference on LISP and FP, Cambridge, Mass.Google Scholar
- Damas, L. and Milner, R. (1982), Principle Type-schemes for Functional Programs, Proceedings of the 9th POPL, Albuquerque, NM.Google Scholar
- Milner, R. (1978), A Theory of Type Polymorphism in Programming, JCSS 17.Google Scholar
- Fuh, Y.-C. and Mishra, P. (1987), Type Inference with Subtypes, manuscript.Google Scholar
- Mitchell, J. (1984), Lambda Calculus Models of Typed Programming Languages, PhD. Thesis, M.I.T.Google Scholar
- Reynolds, J. (1985), Three Approaches to Type Structure, TAPSOFT 1985, LNCS 186.Google Scholar
- Scott, D. (1982), Domains for Denotational Semantics, Proceedings of ICALP'82.Google Scholar
- Wand, M. (1987), Complete Type Inference for Simple Objects, Proceedings of 1987 IEEE Symposium on Logic in Computer Science.Google Scholar