Combining recursive and dynamic types
A denotational semantics of simply typed lambda calculus with a basic type Dynamic, modelling values whose type is to be inspected at runtime, has been given by Abadi e.a.. We extend this interpretation to cover (formally contractive) recursive types as well. Soundness of typing rules and freeness of run-time type errors for well-typed programs hold.
The interpretation works also for implicitly polymorphic languages like ML with Dynamic and recursive types, and for explicitly polymorphic languages under the types-as-ideals interpretation.
KeywordsTyping Rule Denotational Semantic Dynamic Type Closed Type Type Quantifier
Unable to display preview. Download preview PDF.
- 1.M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic typing in a statically-typed language. In 16th POPL, pages 213–227, 1989.Google Scholar
- 2.M. Abadi, L. Cardelli, B. Pierce, and D. Remy. Dynamic typing in polymorphic languages. In ACM SIGPLAN Workshop on ML and its Applications. San Francisco, California, June 20–21, 1992, pages 92–103, 1992.Google Scholar
- 3.L. Cardelli. Amber. In G. Cousineau, P. L. Curien, and B. Robinet, editors, Combinators and Functional Programming Languages. Springer LNCS 242, 1986.Google Scholar
- 4.F. Cardone and M. Coppo. Type inference with recursive types: Syntax and semantics. Information and Computation, 92(1):48–80, May 1991.Google Scholar
- 5.G. Cousineau and G. Huet. The CAML Primer. Version 2.6. Project Formel, INRIA-ENS, April 1989.Google Scholar
- 6.R. Harper, R. Milner, and M. Tofte. The definition on Standard ML — Version 2. LFCS Report Series ECS-LFCS-88-62, Dept. of Computer Science, Univ. of Edinburgh, 1988.Google Scholar
- 7.F. Henglein. Dynamic typing. In European Symposium on Programming (ESOP). Rennes, France, pages 233–253. Springer LNCS, vol. 582, 1992.Google Scholar
- 8.X. Leroy and M. Mauny. Dynamics in ML. In Conf. on Functional Programming Languages and Computer Architecture. Cambridge, Massachusetts, August 1991, pages 406–426. Springer LNCS 523.Google Scholar
- 9.D. MacQueen, G. Plotkin, and R. Sethi. An ideal model for recursive polymorphic types. In Proceedings of the 11th ACM Symposium on Principles of Programming Languages, 1984.Google Scholar
- 10.D. C. J. Matthews. Static and Dynamic Type-Checking. In: Papers on Poly/ML. Technical Report 161, Computer Laboratory, University of Cambridge, February 1989.Google Scholar
- 11.R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348–375, 1978.Google Scholar
- 12.A. Mycroft. Dynamic types in statically typed languages (preliminary draft). Unpublished typescript, December 1983.Google Scholar
- 13.A. Mycroft. Dynamic types in statically typed languages (2nd draft version). Unpublished typescript, August 1984.Google Scholar