Hostname: page-component-7479d7b7d-jwnkl Total loading time: 0 Render date: 2024-07-12T14:08:22.765Z Has data issue: false hasContentIssue false

Deciding type isomorphisms in a type-assignment framework

Published online by Cambridge University Press:  07 November 2008

Roberto Di Cosmo
Affiliation:
LIENS (CNRS) - DMI, Ecole Normale Supérieure, 45 Rue d'Ulm, 75005 Paris, France and Dipartimento di Informatica, Corso Italia 40, 56100 Pisa, Italy (e-mail: dicosmo@dmi.ens.fr)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

This paper provides a formal treatment of isomorphic types for languages equipped with an ML style polymorphic type inference mechanism. The results obtained make less justified the commonplace feeling that (the core of) ML is a subset of second order λ-calculus: we can provide an isomorphism of types that holds in the core ML language, but not in second order λ-calculus. This new isomorphism allows to provide a complete (and decidable) axiomatization of all the types isomorphic in ML style languages, a relevant issue for the type as specifications paradigm in library searches. This work is a very extended version of Di Cosmo (1992): we provide both a thorough theoretical treatment of the topic and describe a practical implementation of a library search system so that the paper can be used as a reference both by those interested in the formal theory of ML style languages, and by those simply concerned with implementation issues. The new isomorphism can also be used to extend the usual ML type-inference algorithm, as suggested by Di Cosmo (1992). Building on that proposal, we introduce a better type-inference algorithm that behaves well in the presence of non-functional primitives like references and exceptions. The algorithm described here has been implemented easily as a variation to the Caml-Light 0.4 system.

Type
Articles
Copyright
Copyright © Cambridge University Press 1993

References

Abadi, M., Cardelli, L. and Curien, P.L. (1993) Formal parametric polymorphism. In Ann. ACM Symp. on Principles of Programming Languages (POPL). ACM Press.Google Scholar
Barendregt, H. (1984) The Lambda Calculus; Its syntax and Semantics (revised edition). North Holland.Google Scholar
Basin, D. (1990) Equality of Terms Containing Associative-Commutative Functions and Commutative Binding Operators is Isomorphism Complete in 10th Int. Conf. on Automated Deduction. Lecture Notes in Computer Science, 449, 07.CrossRefGoogle Scholar
Bruce, K., Di Cosmo, R. and Longo, G. (1990) Provable isomorphisms of types. Technical Report 90–14, LIENS - Ecole Normale Supérieure, 1990. To appear in Proc. of Symposium on Symbolic Computation, ETH, Zurich, March 1990, Mathematical Structures in Computer Science, 2(2).Google Scholar
Bruce, K., Di Cosmo, R. and Longo, G. (1990) Provable isomorphisms of types. Mathematical Structures in Computer Science, 2(2), 1992. Proc. of Symposium on Symbolic Computation, ETH, Zurich, 03.Google Scholar
Bruce, K. and Longo, G. (1985) Provable isomorphisms and domain equations in models of typed languages. ACM Symposium on Theory of Computing (STOC 85), 05.CrossRefGoogle Scholar
Curien, P.L. and Di Cosmo, R. (1991) A confluent reduction system for the λ-calculus with surjective pairing and terminal object. In Leach, , Monien, , and Artalejo, , editors, Intern. Conf. on Automata, Languages and Programming (ICALP), pages 291302. Springer-Verlag.CrossRefGoogle Scholar
Cousineau, G and Huet, G. (1988) The caml primer. Technical report, LIENS - Ecole Normale Supérieure.Google Scholar
Damas, L. (1985) Types Disciplines in Programming Languages. PhD thesis, Computer Science Dept., University of Edimburgh, 04.Google Scholar
Di Cosmo, R. (1991) Invertibility of terms and valid isomorphisms. a proof theoretic study on second order λ-calculus with surjective pairing and terminal object. Technical Report 91–10, LIENS - Ecole Normale Supérieure, 1991. Submitted to Information and Computation.Google Scholar
Di Cosmo, R. (1992) Type isomorphisms in a type assignment framework. In Ann. ACM Symp. on Principles of Programming Languages (POPL), pages 200210. ACM.Google Scholar
Di Cosmo, R. and Longo, G. (1989) Constuctively equivalent propositions and isomorphisms of objects (or terms as natural transformations). Workshop on Logic for Computer Science - MSRI, Berkeley, 11.Google Scholar
Dezani-Ciancaglini, M. (1976) Characterization of normal forms possessing an inverse in the λβη calculus. Theoretical Computer Science, 2:323337.CrossRefGoogle Scholar
Damas, L. and Milner, R. (1982) Principal type schemes for functional programs. In Ann. ACM Symp. on Principles of Programming Languages (POPL), pages 207212. ACM.Google Scholar
Hindley, R. (1969) The principal type-scheme of a an object in combinatory logic. Transactions of the American Mathematical Society, 146.Google Scholar
Hindley, R. and Seldin, J.P. (1980) Introduction to Combinators and λ-calculus. London Mathematical Society.Google Scholar
Jay, C.B. (1991) Strong normalisation for simply-typed lambda-calculus as in lambek-scott. LFCS, University of Edimburgh, 02.Google Scholar
Kirchner, C. (1985) Methodes et utiles de conception systematique d'algoritmes d'unification dans les theories equationnelles. PhD thesis, Université de Nancy.Google Scholar
Krivine, J.L. (1990) Lambda calculus. Types et Modéles. Masson.Google Scholar
Leroy, X. (1990) The ZINC experiment: an economical implementation of the ML language. Technical report 117, INRIA.Google Scholar
Longo, G., Milsted, K. and Soloviev, S.V. (1992) The genericity theorem and the notion of parametericity in the polimorphic λ-calculus. E-mail: and ., 08.Google Scholar
Martin, C.F. (1972) Axiomatic bases for equational theories of natural numbers. Notices of the Am. Math. Soc., 19(7):778.Google Scholar
Matthews, B. (1992) Reusing functional code using type classes for library search. Dept. Comput. Sci, University of Glasgow, Scotland. E-mail: .Google Scholar
Mauny, M. (1991) Functional programming using Caml Light. INRIA, 1991. Included in the Caml Light distribution.Google Scholar
Milner, R. (1978) A theory of type polymorphism in programming. Journal of Computer and System Science, 17(3):348375.CrossRefGoogle Scholar
Mitchell, J.C. (1988) Polymorphic type inference and containment. Information and Computation, 76:211249.CrossRefGoogle Scholar
Morgan, R. (1991) Component Library Retrieval using property models. PhD thesis, University of Durham - England, .Google Scholar
Meertens, L. and Siebes, A. (1990) Universal type isomorphisms in cartesian closed categories. Centrum voor Wiskunde en Informatica, Amsterdam, the Netherlands. E-mail: .Google Scholar
Milner, R. and Tofte, M. (1991) Commentary on Standard ML. The MIT Press.Google Scholar
Milner, R., Tofte, M. and Harper, R. (1990) The Definition of Standard ML. The MIT Press.Google Scholar
Nipkow, T. (1990) A critical pair lemma for higher-order rewrite systems and its application to λ*. First Annual Workshop on Logical Frameworks.Google Scholar
Narendran, P., Pfenning, F. and Statman, R. (1992) On the unification problem for cartesian closed categories. E-mail: dran@cs.albany.edu.Google Scholar
Reynolds, J.C. (1983) Types, abstraction and parametric polymorphism. In R.E.A., Mason, editor, Information Processing '83. North Holland.Google Scholar
Rittri, M. (1990) Retrieving library identifiers by equational matching of types in 10th Int. Conf. on Automated Deduction. Lecture Notes in Computer Science, 449, 07.CrossRefGoogle Scholar
Rittri, M. (1990) Searching program libraries by type and proving compiler correctness by bisimulation. PhD thesis, University of Göteborg, Göteborg, Sweden.Google Scholar
Rittri, M. (1991) Using types as search keys in function libraries. Journal of Functional Programming, 1(1):7189.CrossRefGoogle Scholar
Rittri, M. (1992) Retrieving library functions by unifying types modulo linear isomorphisms. Technical Report 66, Chalmers University of Technology and University of Göteborg 1992. Programming Methodology Group.Google Scholar
Runciman, C. and Toyn, I. (1991) Retrieving re-usable software components by polymorphic type. Journal of Functional Programming, 1(2):191211.CrossRefGoogle Scholar
Rollins, E.J. and Wing, J. M. (1991) Specifications as search keys for software libraries. In K., Furukawa, editor, Eighth International Conference on Logic Programming, pages 173187. MIT Press.Google Scholar
Soloviev, S.V. (1983) The category of finite sets and cartesian closed categories. Journal of Soviet Mathematics, 22(3):13871400.CrossRefGoogle Scholar
Weis, P., Aponte, M.V., Laville, A., Mauny, M. and Suárez, A. (1990) The CAML reference manual. Technical Report 121, INRIA, Roquencourt B.P.105 - 78153 Le Chesnay Cedex - France, 09.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.