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.
Access this article
Rent this article via DeepDyve
Similar content being viewed by others
References
Abadi, M., Cardelli, L., Curien, P.-L., and Lévy, J.-J. Explicit substitutions. Journal of Functional Programming 1(4) (1991) 375–416.
Barendregt, H.P. The Lambda Calculus. Elsevier, 1984.
Clinger, W. and Rees, J. Revised4 report on the algorithmic language Scheme. ACMLisp Pointers 4(3) (1991) 1–55.
Curien, P.-L. Categorical combinators. Information and Control 69 (1986) 188–254.
Curien, P.-L. An abstract framework for environment machines. Theoretical Computer Science 82 (1991) 389–402.
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.
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.
Felleisen, M., Friedman, D.P., Kohlbecker, E., and Duba, B. A syntactic theory of sequential control. Theoretical Computer Science 52(3) (1987) 205–237.
Gallesio, E. STk Reference Manual Version 3.99. 1998.
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.
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.
Girard, J.-Y., Taylor, P., and Lafont, Y. Cambridge Tracts in Computer Science, Vol. 7: Proofs and Types. Cambridge University Press, 1989.
Hanson, C. MIT Scheme Reference Manual, 1.62 ed. MIT, 1996.
Hardin, T. Confluence results for the pure strong categorical logic ccl, λ-calculi as subsystems of ccl. Theoretical Computer Science 65 (1989) 291–342.
Jagannathan, S. Metalevel building blocks for modular systems.ACMTransaction of Programming Languages and Systems 16(3) (1994) 456–492.
Jategaonkar, L.A. and Mitchell, J.C. Type inference with extended pattern matching and subtypes. Fundamenta Informaticae 19 (1993) 127–166.
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.
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.
Klop, J.W. Term rewriting systems. In Handbook of Logic in Computer Science, Vol. 2. Clarendon Press, 1992, pp. 1–116.
Lampson, B. and Burstall, R. Pebble, a kernel language for modules and abstract data types. Information and Computation 76 (1988) 278-346.
Laumann, O. Elk—The Extension Language Kit Scheme Reference. 1995.
Miller, J.S. and Rozas, G.J. Free variables and first-class environments. Lisp and Symbolic Computation 4(2) (1991) 107–141.
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.
Nishizaki, S. Simply typed lambda calculus with first-class environments. Publication of Research Institute for Mathematical Sciences Kyoto University 30(6) (1995) 1055–1121.
Nishizaki, S. Type inference for simply-typed environment calculus with shadowing. In Proceedings of the Fuji International Workshop on Functional and Logic Programming, 1995.
Nishizaki, S. and Akama, Y. Translations of first-class environments to records. In 1st International Workshop on Explicit Substitutions, 1998.
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.
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.
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.
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.
Seaman, J. and Iyer, S.P. An operational semantics of sharing in lazy evaluation. Science of Computer Programming 27(3) (1996) 286–322.
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.
Talpin, J.-P. and Jouvelot, P. Polymorphic type, region and effect inference. Journal of Functional Programming 2(3) (1992) 245–271.
Tofte, M. Type inference for polymorphic references. Information and Computation 89(1) (1990) 1–34.
Wand, M. Type inference for record concatenation and multiple inheritance. Information and Computation 93 (1991) 1–15.
Author information
Authors and Affiliations
Rights 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
Issue Date:
DOI: https://doi.org/10.1023/A:1010010314528