Skip to main content
Log in

Categorical models for local names

  • Published:
LISP and Symbolic Computation

Abstract

This paper describes the construction of categorical models for thenu-calculus, a language that combines higher-order functions with dynamically creatednames. Names are created with local scope, they can be compared with each other and passed around through function application, but that is all.

The intent behind this language is to examine one aspect of the imperative character of Standard ML: the use of local state by dynamic creation of references. The nu-calculus is equivalent to a certain fragment of ML, omitting side effects, exceptions, datatypes and recursion. Even without all these features, the interaction of name creation with higher-order functions can be complex and subtle; it is particularly difficult to characterise theobservable behaviour of expressions.

Categorical monads, in the style of Moggi, are used to build denotational models for the nu-calculus. An intermediate stage is the use of a computational metalanguage, which distinguishes in the type system between values and computations.

The general requirements for a categorical model are presented, and two specific examples described in detail. These provide a sound denotational semantics for the nu-calculus, and can be used to reason about observable equivalence in the language. In particular a model using logical relations is fully abstract for first-order expressions.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Abramsky, S. The lazy lambda calculus. In Turner, D., editor,Research Topics in Functional Programming, Addison Wesley (1990) 65–117.

  2. Boehm, H.-J.A Logic for the Russell Programming Language. PhD thesis, Cornell University, Ithaca, New York (February 1984). Also published as Technical Report 84–593.

  3. Felleisen, M., and Friedman, D. P. A syntactic theory of sequential state.Theoretical Computer Science, 69 (1989) 243–287.

    Google Scholar 

  4. Felleisen, M., and Hieb, R. The revised report on the syntactic theories of sequential control and state.Theoretical Computer Science, 103 (1992) 235–271.

    Google Scholar 

  5. Gordon, A. D.Functional Programming and Input/Output. PhD thesis, University of Cambridge (August 1992). Also published as Technical Report 285, University of Cambridge Computer Laboratory.

  6. Honsell, F., Mason, I. A., Smith, S., and Talcott, C. A variable typed logic of effects. Submitted toInformation and Computation (1993).

  7. Kock, A. Monads on symmetric monoidal closed categories.Archiv der Mathematik, XXI (1970) 1–10.

    Google Scholar 

  8. Kock, A. Bilinearity and cartesian closed monads.Mathematica Scandinavica, 29 (1971) 161–174.

    Google Scholar 

  9. Lambek,J., and Scott, P. J.Introduction to Higher Order Categorical Logic. Cambridge Studies in Advanced Mathematics 7, Cambridge University Press (1986).

  10. Lent, A. F. The category of functors from state shapes to bottomless CPOs is adequate for block structure. InSIPL '93 [34], 101–119.

  11. Mason, I. A.The Semantics of Destructive Lisp. PhD thesis, Stanford University (1986). Also published as CSLI Lecture Notes Number 5, Center for the Study of Langauge and Information, Stanford University.

  12. Mason, I. A., and Talcott, C. Equivalence in functional languages with effects.Journal of Functional Programming, 1, 3 (July 1991) 297–327.

    Google Scholar 

  13. Mason, I. A., and Talcott, C. Inferring the equivalence of functional programs that mutate data.Theoretical Computer Science, 105 (1992) 167–215.

    Google Scholar 

  14. Meyer, A. R., and Sieber, K. Towards fully abstract semantics for local variables: preliminary report. InConference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages, ACM Press (1988) 191–203.

  15. Milner, R. Fully abstract models of typed λ-calculi.Theoretical Computer Science, 4 (1977) 1–22.

    Google Scholar 

  16. Milner, R., Tofte, M., and Harper, R.The Definition of Standard ML. MIT press (1990).

  17. Moggi, E. Computational lambda-calculus and monads. InProceedings of the Fourth Annual IEEE Symposium on Logic in Computer Science, IEEE Computer Society Press (1989) 14–23.

  18. Moggi, E. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh (April 1990).

  19. Moggi, E. Notions of computation and monads.Information and Computation, 93, 1 (July 1991) 55–92.

    Google Scholar 

  20. Odersky, M. A syntactic theory of local names. Research Report YALEU/DCS/RR-965, Yale University (May 1993).

  21. O'Hearn, P. W., and Riecke, J. G. Fully abstract translations and parametric polymorphism. InProgramming Languages and Systems — ESOP '94, Lecture Notes in Computer Science 788, Springer-Verlag (1994) 454–468.

  22. O'Hearn, P. W., and Riecke, J. G. Kripke logical relations and PCF. Submitted toInformation and Computation (June 1994).

  23. O'Hearn, P. W., and Tennent, R. D. Semantics of local variables. InApplications of Categories in Computer Science, London Mathematical Society Lecture Note Series 177, Cambridge University Press (1992) 217–238.

  24. O'Hearn, P. W., and Tennent, R. D. Relational parametricity and local variables (preliminary report). InConference Record of the Twentieth Annual ACM Symposium on Principles of Programming Languages, ACM Press (1993) 171–184.

  25. Oles, F. J. Type algebras, functor categories and block structure. In Nivat, M., and Reynolds, J., editors,Algebraic Methods in Semantics, Cambridge University Press (1985) 543–573.

  26. Pitts, A. M. Evaluation logic. InIVth Higher Order Workshop, Banff 1990, Workshops in Computing, Springer-Verlag (1991) 162–189. Also published as Technical Report 198, University of Cambridge Computer Laboratory.

  27. Pitts, A. M., and Stark, I. Observable properties of higher order functions that dynamically create local names, or: What'snew? InMathematical Foundations of Computer Science, Lecture Notes in Computer Science 711, Springer-Verlag (1993) 122–141.

  28. Pitts, A. M., and Stark, I. On the observable properties of higher order functions that dynamically create local names (preliminary report). InSIPL '93 [34], 31–45.

  29. Plotkin, G. Call-by-name, call-by-value and the λ-calculus.Theoretical Computer Science, 1 (1975) 125–159.

    Google Scholar 

  30. Plotkin, G., and Abadi, M. A logic for parametric polymorphism. InTyped Lambda Calculi and Applications, Lecture Notes in Computer Science 664, Springer-Verlag (1993) 361–375.

  31. Reynolds, J. C. The essence of Algol. InAlgorithmic Languages, North Holland, Amsterdam (1981) 345–372.

    Google Scholar 

  32. Sieber, K. New steps towards full abstraction for local variables. InSIPL '93 [34], 88–100.

  33. Sieber, K. Full abstraction for the second order subset of an Algol-like language (preliminary report). Technical Report A 01/94, Universität des Saarlandes, Saarbrücken (January 1994).

  34. Proceedings of the ACM SIGPLAN Workshop on State in Programming Languages, Copenhagen, Denmark, June 12, 1993. Research Report YALEU/DCS/RR-968, Yale University Department of Computer Science (1993).

Download references

Author information

Authors and Affiliations

Authors

Additional information

Supported by UK SERC studentship 91307943 and CEC SCIENCE project PL910296

Rights and permissions

Reprints and permissions

About this article

Cite this article

Stark, I. Categorical models for local names. Lisp and Symbolic Computation 9, 77–107 (1996). https://doi.org/10.1007/BF01806033

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01806033

Keywords

Navigation