Higher-Order and Symbolic Computation

, Volume 19, Issue 2–3, pp 263–282 | Cite as

Explicit substitutions and higher-order syntax

Article

Abstract

Recently there has been a great deal of interest in higher-order syntax which seeks to extend standard initial algebra semantics to cover languages with variable binding. The canonical example studied in the literature is that of the untyped λ-calculus which is handled as an instance of the general theory of binding algebras, cf. Fiore et al. [13].

Another important syntactic construction is that of explicit substitutions which are used to model local definitions and to implement reduction in the λ-calculus. The syntax of a language with explicit substitutions does not form a binding algebra as an explicit substitution may bind an arbitrary number of variables. Thus explicit substitutions are a natural test case for the further development of the theory and applications of syntax with variable binding.

This paper shows that a language containing explicit substitutions and a first-order signature Σ is naturally modelled as the initial algebra of the Id + FΣ∘_ +_ ∘ _ endofunctor. We derive a similar formula for adding explicit substitutions to the untyped λ-calculus and then show these initial algebras provide useful datatypes for manipulating abstract syntax by implementing two reduction machines. We also comment on the apparent lack of modularity in syntax with variable binding as compared to first-order languages.

Keywords

Abstract syntax Variable binding Explicit substitutions Algebras Monads 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abadi, M., Cardelli, L., Curien, P.-L., Levy, J.-J.: Explicit substitutions. J. of Funct. Program. 1(4), 375 – 416 (1991)MATHMathSciNetCrossRefGoogle Scholar
  2. 2.
    Abel, A., Matthes, R., Uustalu, T.: Iteration schemes for higher-order and nested datatypes. Theor. Comput. Sci. 333(1–2), 3–66 (2005)MATHMathSciNetCrossRefGoogle Scholar
  3. 3.
    Aczel, P., Adámek, J., Milius, S., Velebil, J.: Infinite trees and completely iterative theories: A coalgebraic view. Theor. Comput. Sci. 300(1–3), 1–45 (2003)MATHCrossRefGoogle Scholar
  4. 4.
    Adámek, J., Milius, S., Velebil, J.: Free iterative theories: A coalgebraic view. Math. Struct. in Comput. Sci. 13(2), 259–320 (2003)MATHCrossRefGoogle Scholar
  5. 5.
    Adámek, J., Milius, S., Velebil, J.: On rational monads and free iterative theories. In: Blute, R., Selinger, P. (eds.), Proceedings of 9th Conf. on Category Theory and Comput. Sci., CTCS’02,, vol.69 of Electr. Notes in Theor. Comput. Sci., Elsevier (2003)Google Scholar
  6. 6.
    Adámek, J., Rosický, J.: Locally lowercase Presentable and Accessible Categories, vol. 189 of London Math. Soc. Lecture Note Series. Cambridge Univ. Press, (1994)Google Scholar
  7. 7.
    Altenkirch, T., Reus, B.: Monadic presentations of lambda terms using generalized inductive types. In: Flum, J., Rodríguez-Artalejo, M. (eds.), Proceedings of 13th Int. Wksh. on Comput. Sci. Logic, CSL’99, vol. 1683 of Lect. Notes in Comput. Sci., Springer-Verlag, pp. 453–468 (1999)Google Scholar
  8. 8.
    Bird, R., Paterson, R.: De Bruijn notation as a nested datatype. J. of Funct. Program. 9(1), 77–91 (1999)MATHMathSciNetCrossRefGoogle Scholar
  9. 9.
    Bird, R., Paterson, R.: Generalized folds for nested datatypes. Formal Aspects of Comput. 11(2), 200–222 (1999)MATHCrossRefGoogle Scholar
  10. 10.
    Curien, P.-L.: An abstract framework for environment machines. Theor. Comput. Sci. 82(2), 389–402 (1991)MATHMathSciNetCrossRefGoogle Scholar
  11. 11.
    Dubuc, E.J. and Kelly, G.M.: A presentation of topoi as algebraic relative to categories or graphs. J. of Algebra 83, 420–433 (1983)MathSciNetCrossRefGoogle Scholar
  12. 12.
    Fiore, M.: Semantic analysis of normalisation by evaluation for typed lambda calculus. In: Proceedings of 4th Int. ACM SIGPLAN Conf. on Principles and Practice of Declarative Programming, PPDP’02, ACM Press, pp.26–37 (2002)Google Scholar
  13. 13.
    Fiore, M., Plotkin, G.D., Turi, D.: Abstract syntax and variable binding (extended abstract). In: Proceedings of 14th Ann. IEEE Symp. on Logic in Comput. Sci., LICS’99, IEEE CS Press, pp.193–202 (1999)Google Scholar
  14. 14.
    Fiore, M., Turi, D.: Semantics of name and value passing. In: Proceedings of 16th Ann. IEEE Symp. on Logic in Comput. Sci., LICS’01, IEEE CS Press, pp.93–104 (2001)Google Scholar
  15. 15.
    Ghani, N., Lüth, C., deMarchi, F.: Coalgebraic monads. In: Proceedings of 5th Wksh. on Coalgebraic Methods in Comput. Sci., CMCS’02, Moss, L.S. (ed.), vol. 65(1) of Electr. Notes in Theor. Comput. Sci., Elsevier (2002)Google Scholar
  16. 16.
    Ghani, N., Lüth, C., deMarchi, F., Power, J.: Dualising initial algebras. Math. Struct. in Comput. Sci. 13(2), 349–370 (2003)MATHCrossRefGoogle Scholar
  17. 17.
    Ghani, N., Uustalu, T.: Explicit substitutions and higher-order syntax (extended abstract). In: Honsell, F., Miculan, M., Momigliano, A. (eds.), Proceedings of 2nd ACM SIGPLAN Wksh. on Mechanized Reasoning about Languages with Variable Binding, MERIN 2003, ACM Press (2003)Google Scholar
  18. 18.
    Hyland, M., Plotkin, G., Power, J.: Combining computational effects: Commutativity and sum. In: Baeza-Yates, A., Montanari, U., Santoro, N. (eds.), Proceedings of IFIP 17th World Computer Congress, TC1 Stream/2nd IFIP Int. Conf. on Theor. Comput. Sci., TCS 2002, vol. 223 of IFIP Conf. Proc., Kluwer Acad. Publishers, pp.474–484 (2002)Google Scholar
  19. 19.
    Lüth, C., Ghani, N.: Monads and modular term rewriting. In: Moggi, E., Rosolini, G. (eds.), Proceedings of 7th Int. Conf. on Category Theory and Comput. Sci., CTCS’97, vol.1290 of Lect. Notes in Comput. Sci., Springer-Verlag, pp.69–86 (1997)Google Scholar
  20. 20.
    Lüth, C., Ghani, N.: Composing monads using coproducts. In: Proceedings of 7th ACM SIGPLAN Int. Conf. on Functional Programming, ICFP’02, ACM Press, New York, pp.133–144 (2002) [Also: ACM SIGPLAN Notices, 37(9) (2002), pp.133–144.]Google Scholar
  21. 21.
    Lüth, C., Ghani, N.: Monads and modularity. In: Armando, A. (ed.), Proceedings of 4th Int. Wksh. on Frontiers of Combining Systems, FroCoS 2002, vol. 2309 of Lect. Notes in Artif. Intell., Springer-Verlag, pp.18–32 (2002)Google Scholar
  22. 22.
    E.G. Manes. Algebraic Theories, v.26 of Graduate Texts in Math. Springer-Verlag, 1976.Google Scholar
  23. 23.
    Matthes, R., Uustalu, T.: Substitution in non-wellfounded syntax with variable binding. In H.P. Gumm, ed., Proc. of 6th Int. Wksh. on Coalg. Methods in Comput. Sci., CMCS’03, v.82(4) of Electr. Notes in Theor. Comput. Sci. Elsevier, 2003. Theor. Comput. Sci. 327(1–2), 155–174 (2004)Google Scholar
  24. 24.
    McCracken, N.J.: The typechecking of programs with implicit type structure. In: Kahn, G., MacQueen, D.B., Plotkin, G. (eds.), Proceedings of Int. Symp. on the Semantics of Data Types, vol.173 of Lect. Notes in Comput. Sci., Springer-Verlag, pp.301–315 (1984)Google Scholar
  25. 25.
    Miculan, M., Scagnetto, I.: A framework for typed HOAS and semantics. In: Proceedings of 5th Int. ACM SIGPLAN Conf. on Principles and Practice of Declarative Programming, PPDP’03, ACM Press, pp.184–194 (2003)Google Scholar
  26. 26.
    Milius, S.: On iteratable endofunctors. In: Proceedings of 9th Conf. on Category Theory and Comput. Sci., CTCS’02, Blute, R., Selinger, P. (eds.), v.69 of Electr. Notes in Theor. Comput. Sci., Elsevier (2003)Google Scholar
  27. 27.
    Moss, L.S.: Parametric corecursion. Theor. Comput. Sci. 260(1–2), 139–163 (2001)MATHMathSciNetCrossRefGoogle Scholar
  28. 28.
    Peyton Jones, S. (ed.) Haskell 98 language and libraries: The revised report. J. of Funct. Program. 13(1), 1–277 (2003)Google Scholar

Copyright information

© Springer Science + Business Media, LLC 2006

Authors and Affiliations

  1. 1.School of Computer Science and ITUniversity of NottinghamNottinghamUK
  2. 2.Institute of CyberneticsTallinn University of TechnologyTallinnEstonia
  3. 3.Department of Computer ScienceGunma UniversityGunmaJapan

Personalised recommendations