The semantics of Miranda's algebraic types

  • Kim B. Bruce
  • Jon G. Riecke
Part V Implementation Issues
Part of the Lecture Notes in Computer Science book series (LNCS, volume 298)


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.


Ideal Model Constructor Expression Semantic Model Semantic Function Denotational Semantic 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [ABL86]
    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.Google Scholar
  2. [BMM85]
    Kim B. Bruce, Albert R. Meyer, and John C. Mitchell. The semantics of second-order lambda calculus. 1985. To appear, Information and Computation.Google Scholar
  3. [BMS80]
    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.Google Scholar
  4. [DD85]
    Alan Demers and James Donahue. Data types are values. ACM Transactions on Programming Languages and Systems, 7:426–445, July 1985.CrossRefGoogle Scholar
  5. [DoD83]
    U.S. Department of Defense. Reference Manual for the Ada Programming Language, Springer-Verlag, New York, 1983.Google Scholar
  6. [Gir71]
    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.Google Scholar
  7. [Jon87]
    Simon L. Peyton Jones. The Implementation of Functional Programming Languages, Prentice-Hall, Englewood Cliffs, NJ, 1987.Google Scholar
  8. [KS85]
    Matthew Kaufmann and Douglas Surber. Syntax, Semantics, and a Formal Logic for SASL. Technical Report ARC 85-03, Burroughs Austin Research Center, January 1985.Google Scholar
  9. [McC79]
    Nancy McCracken. An Investigation of a Programming Language with a Polymorphic Type Structure. PhD thesis, Syracuse University, 1979.Google Scholar
  10. [Mil78]
    Robin Milner. A theory of type polymorphism. Journal of Computer and System Sciences, 17:348–375, 1978.CrossRefGoogle Scholar
  11. [MPS84]
    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.Google Scholar
  12. [MPS86]
    D. B. MacQueen, Gordon Plotkin, and Ravi Sethi. An ideal model for recursive polymorphic types. Information and Control, 71, 1986.Google Scholar
  13. [MS82]
    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.Google Scholar
  14. [Rey74]
    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.Google Scholar
  15. [Rie86]
    Jon G. Riecke. A denotational approach to the semantics of polymorphic languages. B.A. Honors Thesis, Department of Computer Science, Williams College. 1986.Google Scholar
  16. [Sco82]
    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.Google Scholar
  17. [Str67]
    Christopher Strachey. Fundamental concepts in programming languages. Lecture notes for International Summer School in Computer Programming, Copenhagen. August 1967.Google Scholar
  18. [Tho87]
    Simon Thompson. Lawful types in Miranda. Unpublished manuscript. 1987.Google Scholar
  19. [Tur85a]
    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.Google Scholar
  20. [Tur85b]
    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.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1988

Authors and Affiliations

  • Kim B. Bruce
    • 1
  • Jon G. Riecke
    • 1
  1. 1.Department of Computer ScienceWilliams CollegeWilliamstown

Personalised recommendations