skip to main content
research-article

Generalising and dualising the third list-homomorphism theorem: functional pearl

Published:19 September 2011Publication History
Skip Abstract Section

Abstract

The third list-homomorphism theorem says that a function is a list homomorphism if it can be described as an instance of both a foldr and a foldl. We prove a dual theorem for unfolds and generalise both theorems to trees: if a function generating a list can be described both as an unfoldr and an unfoldl, the list can be generated from the middle, and a function that processes or builds a tree both upwards and downwards may independently process/build a subtree and its one-hole context. The point-free, relational formalism helps to reveal the beautiful symmetry hidden in the theorem.

Skip Supplemental Material Section

Supplemental Material

_talk10.mp4

References

  1. R. S. Bird. An introduction to the theory of lists. In M. Broy, editor, Logic of Programming and Calculi of Discrete Design, volume 36 of NATO ASI Series F, pages 3--42. Springer-Verlag, New York, NY, USA, 1987. Technical Monograph PRG-56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. E. Blelloch. Prefix sums and their applications. In J. E. Reif, editor, Synthesis of Parallel Algorithms. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1993.Google ScholarGoogle Scholar
  3. M. I. Cole. Algorithmic Skeletons: Structural Management of Parallel Computation. MIT Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. E. W. Dijkstra. A Discipline of Programming. Prentice Hall PTR, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Geser and S. Gorlatch. Parallelizing functional programs by generalization. Journal of Functional Programming, 9 (6): 649--673, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Gibbons. The third homomorphism theorem. Journal of Functional Programming, 6 (4): 657--665, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  7. J. Gibbons, G. Hutton, and T. Altenkirch. When is a function a fold or an unfold? Electr. Notes Theor. Comput. Sci., 44 (1), 2001.Google ScholarGoogle Scholar
  8. G. P. Huet. The zipper. Journal of Functional Programming, 7 (5): 549--554, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. Morihata, K. Matsuzaki, Z. Hu, and M. Takeichi. Program parallelization by candidate generation and conformity testing. IPSJ Transaction on Programming, 2 (2): 132--143, 2009. (In Japanese).Google ScholarGoogle Scholar
  10. A. Morihata, K. Matsuzaki, Z. Hu, and M. Takeichi. The third homomorphism theorem on trees: Downward & upward lead to divide-and-conquer. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2009, Savannah, Georgia, USA, January 21--23, 2009, pages 177--185. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. K. Morita, A. Morihata, K. Matsuzaki, Z. Hu, and M. Takeichi. Automatic inversion generates divide-and-conquer parallel programs. In J. Ferrante and K. S. McKinley, editors, Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, San Diego, California, USA, June 10--13, 2007, pages 146--155. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Generalising and dualising the third list-homomorphism theorem: functional pearl

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 46, Issue 9
          ICFP '11
          September 2011
          456 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/2034574
          Issue’s Table of Contents
          • cover image ACM Conferences
            ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
            September 2011
            470 pages
            ISBN:9781450308656
            DOI:10.1145/2034773

          Copyright © 2011 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 19 September 2011

          Check for updates

          Qualifiers

          • research-article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!