Abstract
Miranda has two interesting features in its typing system: implicit polymorphism (also known as ML-style polymorphism) and algebraic types. Algebraic types create new types from old and can operate on arbitrary types. This paper argues that functions on types, or type constructors, best represent the meaning of algebraic types. Building upon this idea, we develop a denotational semantics for algebraic types. We first define a typed lambda calculus that specifies type constructors. A semantic model of type constructors is then built, using the ideal model as a basis. (The ideal model gives the most natural semantics for Miranda's implicit polymorphism.) The model is shown to be sound with respect to this lambda calculus. Finally, we demonstrate how to use the model to interpret algebraic types, and prove that the translation produces elements in the model.
Partially supported by NSF Grants MCS-8402700, DCR-8603890, and DCR-8511190. The second author is supported by an NSF Graduate Fellowship.
Preview
Unable to display preview. Download preview PDF.
References
Roberto Amadio, Kim B. Bruce, and Giuseppe Longo. The finitary projection model for second order lambda calculus and solutions to higher order domain equations. In First Annual Symposium on Logic in Computer Science, Cambridge, MA, 1986.
Kim B. Bruce, Albert R. Meyer, and John C. Mitchell. The semantics of second-order lambda calculus. 1985. To appear, Information and Computation.
R. M. Burstall, D. B. MacQueen, and D. T. Sannella. Hope: an experimental applicative language. In Proceedings of the First International LISP Conference, Stanford, CA, 1980.
Alan Demers and James Donahue. Data types are values. ACM Transactions on Programming Languages and Systems, 7:426–445, July 1985.
U.S. Department of Defense. Reference Manual for the Ada Programming Language, Springer-Verlag, New York, 1983.
J.-Y. Girard. Une extension de l'interpretation de Gödel à l'analyse, et son application à l'élimination des coupures dans l'analyse et al théorie des types. In J.E. Fenstad, editor, Second Scandanavian Logic Symposium, pages 63–92, North Holland, Amsterdam, 1971.
Simon L. Peyton Jones. The Implementation of Functional Programming Languages, Prentice-Hall, Englewood Cliffs, NJ, 1987.
Matthew Kaufmann and Douglas Surber. Syntax, Semantics, and a Formal Logic for SASL. Technical Report ARC 85-03, Burroughs Austin Research Center, January 1985.
Nancy McCracken. An Investigation of a Programming Language with a Polymorphic Type Structure. PhD thesis, Syracuse University, 1979.
Robin Milner. A theory of type polymorphism. Journal of Computer and System Sciences, 17:348–375, 1978.
D. B. MacQueen, Gordon Plotkin, and Ravi Sethi. An ideal model for recursive polymorphic types. In Proceedings of the Eleventh ACM Symposium on the Principles of Programming Languages, Salt Lake City, UT, pages 165–174, 1984.
D. B. MacQueen, Gordon Plotkin, and Ravi Sethi. An ideal model for recursive polymorphic types. Information and Control, 71, 1986.
D. B. MacQueen and Ravi Sethi. A semantic model of types for applicative languages. In 1982 ACM Symposium on Lisp and Functional Programming, Pittsburgh, PA, pages 243–252, 1982.
John C. Reynolds. Towards a theory of type structure. In Proceedings Colloque sur la Programmation, Lecture Notes in Computer Science 19, pages 408–425, Springer-Verlag, New York, 1974.
Jon G. Riecke. A denotational approach to the semantics of polymorphic languages. B.A. Honors Thesis, Department of Computer Science, Williams College. 1986.
Dana S. Scott. Domains for denotational semantics. In M. Nielsen and E. M. Schmidt, editors, Automata, Languages, and Programming, Lecture Notes in Computer Science 140, pages 577–613, Springer-Verlag, New York, 1982.
Christopher Strachey. Fundamental concepts in programming languages. Lecture notes for International Summer School in Computer Programming, Copenhagen. August 1967.
Simon Thompson. Lawful types in Miranda. Unpublished manuscript. 1987.
David A. Turner. Functional programs as executable specifications. In Hoare and Shepherdson, editors, Mathematical Logic and Programming Languages, pages 29–54, Prentice-Hall, Englewood Cliffs, NJ, 1985.
David A. Turner. Miranda: a non-strict functional language with polymorhic types. In Proceedings IFIP International Conference on Functional Programming Languages and Computer Architecture, Nancy, Lecture Notes in Computer Science 201, Springer-Verlag, New York, 1985.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1988 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Bruce, K.B., Riecke, J.G. (1988). The semantics of Miranda's algebraic types. In: Main, M., Melton, A., Mislove, M., Schmidt, D. (eds) Mathematical Foundations of Programming Language Semantics. MFPS 1987. Lecture Notes in Computer Science, vol 298. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-19020-1_25
Download citation
DOI: https://doi.org/10.1007/3-540-19020-1_25
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-19020-2
Online ISBN: 978-3-540-38920-0
eBook Packages: Springer Book Archive