Abstract
We present a framework of dynamic programming combinators that provides a high-level environment to describe the recursions typical of dynamic programming over sequence data in a style very similar to algebraic dynamic programming (ADP). Using a combination of type-level programming and stream fusion leads to a substantial increase in performance, without sacrificing much of the convenience and theoretical underpinnings of ADP.
We draw examples from the field of computational biology, more specifically RNA secondary structure prediction, to demonstrate how to use these combinators and what differences exist between this library, ADP, and other approaches.
The final version of the combinator library allows writing algorithms with performance close to hand-optimized C code.
- R. E. Bellman. On the Theory of Dynamic Programming. Proceedings of the National Academy of Sciences, 38 (8): 716--719, 1952.Google Scholar
Cross Ref
- A. F. Bompfünewerer, R. Backofen, S. H. Bernhart, J. Hertel, I. L. Hofacker, P. F. Stadler, and S. Will. Variations on RNA folding and alignment: lessons from Benasque. Journal of Mathematical Biology, 56 (1): 129--144, 2008.Google Scholar
- M. M. Chakravarty, G. Keller, and S. Peyton Jones. Associated Type Synonyms. In Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, ICFP'05, pages 241--253. ACM, 2005. Google Scholar
Digital Library
- M. M. Chakravarty, R. Leshchinskiy, S. Peyton Jones, G. Keller, and S. Marlow. Data Parallel Haskell: a status report. In Proceedings of the 2007 workshop on Declarative aspects of multicore programming, DAMP'07, pages 10--18. ACM, 2007. Google Scholar
Digital Library
- K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In Proceedings of the fifth ACM SIGPLAN international conference on Functional programming, ICFP'00, pages 268--279. ACM, 2000. Google Scholar
Digital Library
- T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. The MIT press, 2001. Google Scholar
Digital Library
- D. Coutts, R. Leshchinskiy, and D. Stewart. Stream Fusion: From Lists to Streams to Nothing at All. In Proceedings of the 12th ACM SIGPLAN international conference on Functional programming, ICFP'07, pages 315--326. ACM, 2007. Google Scholar
Digital Library
- R. Durbin, S. Eddy, A. Krogh, and G. Mitchison. Biological sequence analysis. Cambridge Univ. Press, 1998.Google Scholar
Cross Ref
- R. Giegerich and C. Höner zu Siederdissen. Semantics and Ambiguity of Stochastic RNA Family Models. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 8 (2): 499--516, 2011. Google Scholar
Digital Library
- R. Giegerich and C. Meyer. Algebraic Dynamic Programming. In Algebraic Methodology And Software Technology, volume 2422, pages 243--257. Springer, 2002. Google Scholar
Digital Library
- R. Giegerich and P. Steffen. Challenges in the compilation of a domain specific language for dynamic programming. In Proceedings of the 2006 ACM symposium on Applied computing, pages 1603--1609. ACM, 2006. Google Scholar
Digital Library
- R. Giegerich, C. Meyer, and P. Steffen. Towards a Discipline of Dynamic Programming. Informatik bewegt, GI-Edition-Lecture Notes in Informatics, pages 3--44, 2002. Google Scholar
Digital Library
- R. Giegerich, C. Meyer, and P. Steffen. A Discipline of Dynamic Programming over Sequence Data. Science of Computer Programming, 51 (3): 215--263, 2004. Google Scholar
Digital Library
- R. Giegerich et al. Algebraic Dynamic Programming Website. http://bibiserv.techfak.uni-bielefeld.de/adp/, 2004. Google Scholar
Digital Library
- D. Grune and C. J. Jacobs. Parsing techniques: a practical guide. Springer-Verlag New York Inc, 2008.Google Scholar
Cross Ref
- I. L. Hofacker, W. Fontana, P. F. Stadler, L. S. Bonhoeffer, M. Tacker, and P. Schuster. Fast Folding and Comparison of RNA Secondary Structures. Monatshefte für Chemie/Chemical Monthly, 125 (2): 167--188, 1994.Google Scholar
Cross Ref
- C. Höner zu Siederdissen and I. L. Hofacker. Discriminatory power of RNA family models. Bioinformatics, 26 (18): 453--459, 2010. Google Scholar
Digital Library
- C. Höner zu Siederdissen, S. H. Bernhart, P. F. Stadler, and I. L. Hofacker. A folding algorithm for extended RNA secondary structures. Bioinformatics, 27 (13): 129--136, 2011. Google Scholar
Digital Library
- P. Hudak, J. Hughes, S. Peyton Jones, and P. Wadler. A History of Haskell: Being Lazy with Class. In Proceedings of the third ACM SIGPLAN conference on History of programming languages, HOPL III, pages 1--55. ACM, 2007. Google Scholar
Digital Library
- G. Hutton. Higher-order functions for parsing. Journal of Functional Programming, 2 (3): 323--343, 1992.Google Scholar
Cross Ref
- M. P. Jones. Type Classes with Functional Dependencies. Programming Languages and Systems, pages 230--244, 2000. Google Scholar
Digital Library
- G. Keller, M. M. Chakravarty, R. Leshchinskiy, S. Peyton Jones, and B. Lippmeier. Regular, Shape-polymorphic, Parallel Arrays in Haskell. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, ICFP'10, pages 261--272. ACM, 2010. Google Scholar
Digital Library
- K. Lari and S. J. Young. The estimation of stochastic context-free grammars using the Inside-Outside algorithm. Computer Speech & Language, 4 (1): 35--56, 1990.Google Scholar
Cross Ref
- C. Lattner and V. Adve. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Code Generation and Optimization, 2004. CGO 2004. International Symposium on, pages 75--86. IEEE, 2004. Google Scholar
Digital Library
- R. Leshchinskiy. Recycle Your Arrays! Practical Aspects of Declarative Languages, pages 209--223, 2009. Google Scholar
Digital Library
- R. Lorenz, S. H. Bernhart, C. Höner zu Siederdissen, H. Tafer, C. Flamm, P. F. Stadler, and I. L. Hofacker. ViennaRNA Package 2.0. Algorithms for Molecular Biology, 6 (26), 2011.Google Scholar
- M. Mernik, J. Heering, and A. M. Sloane. When and How to Develop Domain-Specific Languages. ACM Computing Surveys, 37 (4): 316--344, 2005. Google Scholar
Digital Library
- M. Nebel and A. Scheid. Evaluation of a sophisticated SCFG design for RNA secondary structure prediction. Theory in Biosciences, 130: 313--336, 2011. ISSN 1431-7613.Google Scholar
Cross Ref
- R. Nussinov, G. Pieczenik, J. R. Griggs, and D. J. Kleitman. Algorithms for Loop Matchings. SIAM Journal on Applied Mathematics, 35 (1): 68--82, 1978.Google Scholar
Cross Ref
- B. O'Sullivan, D. B. Stewart, and J. Goerzen. Real World Haskell. O'Reilly Media, 2009. Google Scholar
Digital Library
- S. Peyton Jones. Call-pattern Specialisation for Haskell Programs. In Proceedings of the 12th ACM SIGPLAN international conference on Functional programming, ICFP'07, pages 327--337. ACM, 2007. Google Scholar
Digital Library
- E. Rivas, R. Lang, and S. R. Eddy. A range of complex probabilistic models for RNA secondary structure prediction that includes the nearest-neighbor model and more. RNA, 18 (2): 193--212, 2012.Google Scholar
Cross Ref
- G. Sauthoff, S. Janssen, and R. Giegerich. Bellman's GAP - A Declarative Language for Dynamic Programming. In Proceedings of the 13th international ACM SIGPLAN symposium on Principles and practices of declarative programming, PPDP'11, pages 29--40. ACM, 2011. Google Scholar
Digital Library
- R. Sedgewick. Algorithms. Addison-Wesley Publishing Co., Inc., 1983. Google Scholar
Digital Library
- P. Steffen. Compiling a domain specific language for dynamic programming. PhD thesis, Bielefeld University, 2006.Google Scholar
- The GHC Team. The Glasgow Haskell Compiler (GHC). http://www.haskell.org/ghc/, 2012.Google Scholar
Index Terms
Sneaking around concatMap: efficient combinators for dynamic programming
Recommendations
Sneaking around concatMap: efficient combinators for dynamic programming
ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programmingWe present a framework of dynamic programming combinators that provides a high-level environment to describe the recursions typical of dynamic programming over sequence data in a style very similar to algebraic dynamic programming (ADP). Using a ...
The HERMIT in the stream: fusing stream fusion's concatMap
PEPM '14: Proceedings of the ACM SIGPLAN 2014 Workshop on Partial Evaluation and Program ManipulationStream Fusion, a popular deforestation technique in the Haskell community, cannot fuse the concatMap combinator. This is a serious limitation, as concatMap represents computations on nested streams. The original implementation of Stream Fusion used the ...
Rewriting haskell strings
PADL'07: Proceedings of the 9th international conference on Practical Aspects of Declarative LanguagesThe Haskell String type is notoriously inefficient. We introduce a new data type, ByteString, based on lazy lists of byte arrays, combining the speed benefits of strict arrays with lazy evaluation. Equational transformations based on term rewriting are ...







Comments