Skip to main content

Exploring the Regular Tree Types

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3839))

Abstract

In this paper we use the Epigram language to define the universe of regular tree types—closed under empty, unit, sum, product and least fixpoint. We then present a generic decision procedure for Epigram’s in-built equality at each type, taking a complementary approach to that of Benke, Dybjer and Jansson [7]. We also give a generic definition of map, taking our inspiration from Jansson and Jeuring [21]. Finally, we equip the regular universe with the partial derivative which can be interpreted functionally as Huet’s notion of ‘zipper’, as suggested by McBride in [27] and implemented (without the fixpoint case) in Generic Haskell by Hinze, Jeuring and Löh [18]. We aim to show through these examples that generic programming can be ordinary programming in a dependently typed language.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abbott, M.: Categories of Containers. PhD thesis, University of Leicester (2003)

    Google Scholar 

  2. Abbott, M., Altenkirch, T., Ghani, N.: Categories of containers. In: Proceedings of Foundations of Software Science and Computation Structures (2003)

    Google Scholar 

  3. Abbott, M., Altenkirch, T., Ghani, N., McBride, C.: \(\partial\) for data: derivatives of data structures. Fundamenta Informaticae 65(1,2), 1–128 (2005)

    MATH  MathSciNet  Google Scholar 

  4. Altenkirch, T., McBride, C.: Generic programming within dependently typed programming. In: Generic Programming, Proceedings of the IFIP TC2 Working Conference on Generic Programming, Schloss Dagstuhl, July 2002 (2003)

    Google Scholar 

  5. Altenkirch, T., Reus, B.: Monadic presentations of lambda-terms using generalized inductive types. In: Flum, J., Rodríguez-Artalejo, M. (eds.) CSL 1999. LNCS, vol. 1683, pp. 453–468. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  6. Backhouse, R., Jansson, P., Jeuring, J., Meertens, L.: Generic Programming—An Introduction. In: Doaitse Sweierstra, S., Henriques, P.R., Oliveira, J.N. (eds.) AFP 1998. LNCS, vol. 1608, pp. 28–115. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  7. Benke, M., Dybjer, P., Jansson, P.: Universes for generic programs and proofs in dependent type theory. Nordic Journal of Computing 10, 265–269 (2003)

    MATH  MathSciNet  Google Scholar 

  8. Brady, E.: Practical Implementation of a Dependently Typed Functional Programming Language. PhD thesis, University of Durham (2005)

    Google Scholar 

  9. Brady, E., McBride, C., McKinna, J.: Inductive families need not store their indices. In: Berardi, S., Coppo, M., Damiani, F. (eds.) TYPES 2003. LNCS, vol. 3085, pp. 115–129. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  10. Clarke, D., Hinze, R., Jeuring, J., Löh, A., de Wit, J.: The Generic Haskell user’s guide. Technical Report UU-CS-2001-26, Utrecht University (2001)

    Google Scholar 

  11. L’Équipe Coq. The Coq Proof Assistant Reference Manual (2001), http://pauillac.inria.fr/coq/doc/main.html

  12. Coquand, C., Coquand, T.: Structured Type Theory. In: Workshop on Logical Frameworks and Metalanguages (1999)

    Google Scholar 

  13. Coquand, T.: Pattern Matching with Dependent Types. In: Nordström, B., Petersson, K., Plotkin, G. (eds.) Electronic Proceedings of the Third Annual BRA Workshop on Logical Frameworks, Båstad, Sweden (1992)

    Google Scholar 

  14. de Bruijn, N.G.: Lambda Calculus notation with nameless dummies: a tool for automatic formula manipulation. Indagationes Mathematicæ 34, 381–392 (1972)

    Article  Google Scholar 

  15. de Bruijn, N.G.: Telescopic Mappings in Typed Lambda-Calculus. Information and Computation 91, 189–204 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  16. Dybjer, P.: Inductive Sets and Families in Martin-Löf’s Type Theory. In: Huet, G., Plotkin, G. (eds.) Logical Frameworks, CUP (1991)

    Google Scholar 

  17. Dybjer, P., Setzer, A.: Indexed induction-recursion. In: Kahle, R., Schroeder-Heister, P., Stärk, R.F. (eds.) PTCS 2001. LNCS, vol. 2183, pp. 93–113. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  18. Hinze, R., Jeuring, J., Löh, A.: Type-indexed data types. Science of Computer Programmming 51, 117–151 (2004)

    Article  MATH  Google Scholar 

  19. Hosoya, H., Vouillon, J., Pierce, B.C.: Regular Expression Types for XML. In: Proceedings of the International Conference on Functional Programming (2000)

    Google Scholar 

  20. Huet, G.: The Zipper. Journal of Functional Programming 7(5), 549–554 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  21. Jansson, P., Jeuring, J.: PolyP—a polytypic programming language extension. In: Proceedings of POPL 1997, pp. 470–482. ACM, New York (1997)

    Chapter  Google Scholar 

  22. Leibniz, G.: Nova methodus pro maximis et minimis, itemque tangentibus, qua nec irrationals quantitates moratur. Acta Eruditorum (1684)

    Google Scholar 

  23. Luo, Z.: Computation and Reasoning: A Type Theory for Computer Science. Oxford University Press, Oxford (1994)

    MATH  Google Scholar 

  24. Luo, Z., Pollack, R.: LEGO Proof Development System: User’s Manual. Technical Report ECS-LFCS-92-211, Laboratory for Foundations of Computer Science, University of Edinburgh (1992)

    Google Scholar 

  25. Magnusson, L., Nordström, B.: The ALF proof editor and its proof engine. In: Barendregt, H., Nipkow, T. (eds.) TYPES 1993. LNCS, vol. 806. Springer, Heidelberg (1994)

    Google Scholar 

  26. Martin-Löf, P.: Intuitionistic Type Theory. Bibliopolis, Napoli (1984)

    MATH  Google Scholar 

  27. McBride, C.: The Derivative of a Regular Type is its Type of One-Hole Contexts (2001), Available at: http://www.dur.ac.uk/c.t.mcbride/diff.ps

  28. McBride, C.: Elimination with a Motive. In: Callaghan, P., Luo, Z., McKinna, J., Pollack, R. (eds.) TYPES 2000. LNCS, vol. 2277, p. 197. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  29. McBride, C.: Epigram: Practical programming with dependent types. In: Vene, V., Uustalu, T. (eds.) AFP 2004. LNCS, vol. 3622, pp. 130–170. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  30. McBride, C., McKinna, J.: The view from the left. Journal of Functional Programming 14(1) (2004)

    Google Scholar 

  31. McBride, F.: Computer Aided Manipulation of Symbols. PhD thesis, Queen’s University of Belfast (1970)

    Google Scholar 

  32. Milner, R., Tofte, M., Harper, R., MacQueen, D.: The Definition of Standard ML, revised edition. MIT Press, Cambridge (1997)

    Google Scholar 

  33. Pfeifer, H., Rueß, H.: Polytypic Proof Construction. In: Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C., Théry, L. (eds.) TPHOLs 1999. LNCS, vol. 1690, pp. 55–72. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  34. Nordström, B., Petersson, K., Smith, J.: Programming in Martin-Löf’s type theory: an introduction. Oxford University Press, Oxford (1990)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Morris, P., Altenkirch, T., McBride, C. (2006). Exploring the Regular Tree Types. In: Filliâtre, JC., Paulin-Mohring, C., Werner, B. (eds) Types for Proofs and Programs. TYPES 2004. Lecture Notes in Computer Science, vol 3839. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11617990_16

Download citation

  • DOI: https://doi.org/10.1007/11617990_16

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-31428-8

  • Online ISBN: 978-3-540-31429-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics