Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2502488.2502496acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Histo- and dynamorphisms revisited

Published: 28 September 2013 Publication History

Abstract

Dynamic programming algorithms embody a widely used programming technique that optimizes recursively defined equations that have repeating subproblems. The standard solution uses arrays to share common results between successive steps, and while effective, this fails to exploit the structural properties present in these problems. Histomorphisms and dynamorphisms have been introduced to expresses such algorithms in terms of structured recursion schemes that leverage this structure. In this paper, we revisit and relate these schemes and show how they can be expressed in terms of recursion schemes from comonads, as well as from recursive coalgebras. Our constructions rely on properties of bialgebras and dicoalgebras, and we are careful to consider optimizations and efficiency concerns. Throughout the paper we illustrate these techniques through several worked-out examples discussed in a tutorial style, and show how a recursive specification can be expressed both as an array-based algorithm as well as one that uses recursion schemes.

References

[1]
J. Adámek, D. Lücke, and S. Milius, "Recursive coalgebras of finitary functors," Theoret. Informatics Appl., vol. 41, no. 4, pp. 447--462, 2007. 10.1051/ita:2007028
[2]
R. Bird, Pearls of Functional Algorithm Design. Cambridge University Press, 2010.
[3]
V. Capretta, T. Uustalu, and V. Vene, "Recursive coalgebras from comonads," Information and Computation, vol. 204, no. 4, pp. 437--468, 2006. 10.1016/j.ic.2005.08.005
[4]
M. M. T. Chakravarty, G. Keller, and S. P. Jones, "Associated type synonyms," in phProceedings of the 10th ACM SIGPLAN International Conference on Functional Programming, ser. ICFP '05. ACM, 2005, pp. 241--253. 10.1145/1086365.1086397
[5]
S. Eilenberg and J. C. Moore, "Adjoint functors and triples," Illinois J. Math, vol. 9, no. 3, pp. 381--398, 1965.
[6]
R. Hinze, "Adjoint folds and unfolds--an extended study," Science of Computer Programming, Aug. 2012. 10.1016/j.scico.2012.07.011
[7]
R. Hinze, D. W. James, and T. Harper, "Theory and practice of fusion," in Proceedings of the 22nd Symposium on the Implementation and Application of Functional Languages (IFL '10), ser. Lecture Notes in Computer Science, vol. 6647. Springer Berlin / Heidelberg, Sep. 2011, pp. 19--37. 10.1007/978-3-642-24276-2_2
[8]
R. Hinze, N. Wu, and J. Gibbons, "Unifying structured recursion schemes," in Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ser. ICFP '13. ACM, 2013. 10.1145/2500365.2500578
[9]
P. J. Huber, "Homotopy theory in general categories," Mathematische Annalen, vol. 144, pp. 361--385, 1961. 10.1007/BF01396534
[10]
J. Kabanov and V. Vene, "Recursion schemes for dynamic programming," in Mathematics of Program Construction, 8th International Conference, MPC 2006. Springer Berlin / Heidelberg, 2006, pp. 235--252. 10.1007/11783596_15
[11]
H. Kleisli, "Every standard construction is induced by a pair of adjoint functors," Proceedings of the American Mathematical Society, vol. 16, no. 3, pp. 544--546, Jun. 1965. 10.1090/S0002-9939-1965-0177024-4
[12]
J. Lambek, "A fixpoint theorem for complete categories," Math. Zeitschr., vol. 103, pp. 151--161, 1968. 10.1007/BF01110627
[13]
Has S. Peyton Jones, Haskell 98 Language and Libraries. Cambridge University Press, 2003.
[14]
T. Uustalu and V. Vene, "Primitive (co)recursion and course-of-value (co)iteration, categorically," Informatica, Lith. Acad. Sci., vol. 10, no. 1, pp. 5--26, 1999.
[15]
T. Uustalu, V. Vene, and A. Pardo, "Recursion schemes from comonads," Nordic J. of Computing, vol. 8, no. 3, pp. 366--390, Sep. 2001.

Cited By

View all
  • (2022)Fantastic Morphisms and Where to Find ThemMathematics of Program Construction10.1007/978-3-031-16912-0_9(222-267)Online publication date: 22-Sep-2022
  • (2020)Staged selective parser combinatorsProceedings of the ACM on Programming Languages10.1145/34090024:ICFP(1-30)Online publication date: 3-Aug-2020
  • (2020)Easily solving dynamic programming problems in Haskell by memoization of hylomorphismsSoftware: Practice and Experience10.1002/spe.288750:12(2193-2211)Online publication date: 17-Sep-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
WGP '13: Proceedings of the 9th ACM SIGPLAN workshop on Generic programming
September 2013
92 pages
ISBN:9781450323895
DOI:10.1145/2502488
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 September 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. dynamic programming
  2. dynamorphisms
  3. histomorphisms
  4. recursion schemes

Qualifiers

  • Research-article

Conference

ICFP'13
Sponsor:

Acceptance Rates

WGP '13 Paper Acceptance Rate 8 of 14 submissions, 57%;
Overall Acceptance Rate 30 of 43 submissions, 70%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)0
Reflects downloads up to 26 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2022)Fantastic Morphisms and Where to Find ThemMathematics of Program Construction10.1007/978-3-031-16912-0_9(222-267)Online publication date: 22-Sep-2022
  • (2020)Staged selective parser combinatorsProceedings of the ACM on Programming Languages10.1145/34090024:ICFP(1-30)Online publication date: 3-Aug-2020
  • (2020)Easily solving dynamic programming problems in Haskell by memoization of hylomorphismsSoftware: Practice and Experience10.1002/spe.288750:12(2193-2211)Online publication date: 17-Sep-2020
  • (2018)The systems engineering of consistent pure language with effect type system for certified applications and higher languages10.1063/1.5045439(020033)Online publication date: 2018
  • (2015)Conjugate Hylomorphisms -- OrACM SIGPLAN Notices10.1145/2775051.267698950:1(527-538)Online publication date: 14-Jan-2015
  • (2015)Conjugate Hylomorphisms -- OrProceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2676726.2676989(527-538)Online publication date: 14-Jan-2015

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media