Skip to main content
Log in

A Polymorphic Environment Calculus and its Type-Inference Algorithm

  • Published:
Higher-Order and Symbolic Computation

Abstract

The polymorphic environment calculus is a polymorphic lambda calculus which enables us to treat environments as first-class citizens. In the calculus, environments are formalized as explicit substitutions, and the substitutions are included in the set of terms of the calculus. First, we introduce an untyped environment calculus, and we present a semantics of the calculus as a translation into the lambda calculus. Second, we propose a polymorphic type system for the environment calculus based on Damas-Milner's ML-polymorphic type system. In ML, polymorphism is allowed only in let-expressions; in the polymorphic environment calculus, polymorphism is provided with environment compositions. We prove a subject-reduction theorem for the type system. Third, a type-inference algorithm is given to the polymorphic environment calculus, and we establish its soundness, termination, and principal-typing theorem.

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.

Institutional subscriptions

Similar content being viewed by others

References

  1. Abadi, M., Cardelli, L., Curien, P.-L., and Lévy, J.-J. Explicit substitutions. Journal of Functional Programming 1(4) (1991) 375–416.

    Google Scholar 

  2. Barendregt, H.P. The Lambda Calculus. Elsevier, 1984.

  3. Clinger, W. and Rees, J. Revised4 report on the algorithmic language Scheme. ACMLisp Pointers 4(3) (1991) 1–55.

    Google Scholar 

  4. Curien, P.-L. Categorical combinators. Information and Control 69 (1986) 188–254.

    Google Scholar 

  5. Curien, P.-L. An abstract framework for environment machines. Theoretical Computer Science 82 (1991) 389–402.

    Google Scholar 

  6. Curien, P.-L., Hardin, T., and Lévy, J.-J. Confluence properties of weak and strong calculi of explicit substitutions. Journal of the ACM 43(2) (1996) 362-397.

    Google Scholar 

  7. Dowek, G., Hardin, T., and Kirchner, C. Higher-order unification via explicit substitutions, extended abstract. In Proceedings of the Symposium on Logic in Computer Science, 1995, pp. 366–374.

  8. Felleisen, M., Friedman, D.P., Kohlbecker, E., and Duba, B. A syntactic theory of sequential control. Theoretical Computer Science 52(3) (1987) 205–237.

    Google Scholar 

  9. Gallesio, E. STk Reference Manual Version 3.99. 1998.

  10. Gelernter, D., Jagannathan, S., and London, T. Environments as first-class objects. In Conference Record of the Fourteenth Annual ACM Symposium on Principles of Programming Languages, 1987, pp. 98–110.

  11. Girard, J.-Y. Interprétation fonctionnelle et élimination des coupures dans l'arithmétique d'ordre supérieur. Thèse d' État, Université de Paris VII, Paris, France, 1972.

    Google Scholar 

  12. Girard, J.-Y., Taylor, P., and Lafont, Y. Cambridge Tracts in Computer Science, Vol. 7: Proofs and Types. Cambridge University Press, 1989.

  13. Hanson, C. MIT Scheme Reference Manual, 1.62 ed. MIT, 1996.

  14. Hardin, T. Confluence results for the pure strong categorical logic ccl, λ-calculi as subsystems of ccl. Theoretical Computer Science 65 (1989) 291–342.

    Google Scholar 

  15. Jagannathan, S. Metalevel building blocks for modular systems.ACMTransaction of Programming Languages and Systems 16(3) (1994) 456–492.

    Google Scholar 

  16. Jategaonkar, L.A. and Mitchell, J.C. Type inference with extended pattern matching and subtypes. Fundamenta Informaticae 19 (1993) 127–166.

    Google Scholar 

  17. Jouvelot, P. and Gifford, D.K. Algebraic reconstruction of types and effects. In Conference Record of the Seventeenth Annual ACM Symposium on Principles of Programming Languages, 1991, pp. 303–310.

  18. Kelsey, R., Clinger, W., and Rees, J. (Eds.). Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1) (1998) 7–105. Also appears in ACM SIGPLAN Notices 33(9), September dy1998.

  19. Klop, J.W. Term rewriting systems. In Handbook of Logic in Computer Science, Vol. 2. Clarendon Press, 1992, pp. 1–116.

    Google Scholar 

  20. Lampson, B. and Burstall, R. Pebble, a kernel language for modules and abstract data types. Information and Computation 76 (1988) 278-346.

    Google Scholar 

  21. Laumann, O. Elk—The Extension Language Kit Scheme Reference. 1995.

  22. Miller, J.S. and Rozas, G.J. Free variables and first-class environments. Lisp and Symbolic Computation 4(2) (1991) 107–141.

    Google Scholar 

  23. Nishizaki, S. ML with first-class environments and its type inference algorithm. In Lecture Notes in Computer Science, Vol. 792: Logic, Language and Computation. Springer, 1994, pp. 95–116.

    Google Scholar 

  24. Nishizaki, S. Simply typed lambda calculus with first-class environments. Publication of Research Institute for Mathematical Sciences Kyoto University 30(6) (1995) 1055–1121.

    Google Scholar 

  25. Nishizaki, S. Type inference for simply-typed environment calculus with shadowing. In Proceedings of the Fuji International Workshop on Functional and Logic Programming, 1995.

  26. Nishizaki, S. and Akama, Y. Translations of first-class environments to records. In 1st International Workshop on Explicit Substitutions, 1998.

  27. Ohori, A. A compilation method for ML-style polymorphic record calculi. In Conference Record of the Nineteenth Annual ACM Symposium on Principles of Programming Languages, 1992, pp. 154–165.

  28. Queinnec, C. and De Roure, D. Sharing code through first-class environments. In Proceedings of the 1996 ACM SIGPLAN International Conference on Functional Programming, 1996, pp. 251–261.

  29. Rémy, D. Typechecking records and variants in a natural extention of ML. In Conference Record of the Sixteenth Annual ACM Symposium on Principles of Programming Languages, 1989, pp. 60–67.

  30. Sato, M., Sakurai, T., and Burstall, R. Explicit environments. In Proceedings of the 4th International Conference on Typed Lambda Calculi and Applications, Jean-Yves Girard (Ed.). Springer-Verlag, L'Aquila, Italy, 1999. Lecture Notes in Computer Science 1581.

    Google Scholar 

  31. Seaman, J. and Iyer, S.P. An operational semantics of sharing in lazy evaluation. Science of Computer Programming 27(3) (1996) 286–322.

    Google Scholar 

  32. Talcott, C. Reasoning about functions with effects. In Higher-Order Operational Techniques in Semantics, A.D. Gordon and A.M. Pitts, (Eds). Cambridge University Press, 1996, pp. 347–390.

  33. Talpin, J.-P. and Jouvelot, P. Polymorphic type, region and effect inference. Journal of Functional Programming 2(3) (1992) 245–271.

    Google Scholar 

  34. Tofte, M. Type inference for polymorphic references. Information and Computation 89(1) (1990) 1–34.

    Google Scholar 

  35. Wand, M. Type inference for record concatenation and multiple inheritance. Information and Computation 93 (1991) 1–15.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Nishizaki, SY. A Polymorphic Environment Calculus and its Type-Inference Algorithm. Higher-Order and Symbolic Computation 13, 239–278 (2000). https://doi.org/10.1023/A:1010010314528

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1010010314528

Navigation