Skip to main content

Dynamic Programming via Thinning and Incrementalization

  • Conference paper
Functional and Logic Programming (FLOPS 2014)

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

Included in the following conference series:

Abstract

We demonstrate that it is useful to combine two independently studied methods, thinning and incrementalization, to develop programs that use dynamic programming. While dynamic programming is a fundamental algorithmic pattern, its development is often difficult for average programmers. There are several methods for systematically developing dynamic programming from plain problem descriptions by program transformations. We show that by combining two known methods, thinning and incrementalization, we can systematically derive efficient dynamic-programming implementations from high-level descriptions. The derivations cannot be achieved by using only one of them. We illustrate our approach with the 0-1 knapsack problem, the longest common subsequence problem, and association rule mining from numeric data.

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

Access this chapter

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. de Moor, O.: Categories, Relations and Dynamic Programming. PhD thesis, Oxford University Computing Laboratory, Technical Monograph PRG-98 (1992)

    Google Scholar 

  2. Bird, R.S., de Moor, O.: Algebra of Programming. Prentice Hall (1997)

    Google Scholar 

  3. Bird, R.S.: Maximum marking problems. J. Funct. Program. 11(4), 411–424 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  4. de Moor, O.: A generic program for sequential decision processes. In: Swierstra, S.D. (ed.) PLILP 1995. LNCS, vol. 982, pp. 1–23. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  5. Pettorossi, A., Proietti, M.: Rules and strategies for transforming functional and logic programs. ACM Computing Surveys 28(2), 360–414 (1996)

    Article  Google Scholar 

  6. Sasano, I., Hu, Z., Takeichi, M., Ogawa, M.: Make it practical: a generic linear-time algorithm for solving maximum-weightsum problems. In: Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming, ICFP 2000, pp. 137–149. ACM Press (2000)

    Google Scholar 

  7. Liu, Y.A., Stoller, S.D.: Dynamic programming via static incrementalization. Higher-Order and Symbolic Computation 16(1-2), 37–62 (2003)

    Article  MATH  Google Scholar 

  8. Giegerich, R., Meyer, C., Steffen, P.: A discipline of dynamic programming over sequence data. Sci. Comput. Program. 51(3), 215–263 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  9. Liu, Y.A., Stoller, S.D., Li, N., Rothamel, T.: Optimizing aggregate array computations in loops. ACM Trans. Program. Lang. Syst. 27(1), 91–125 (2005)

    Article  Google Scholar 

  10. Sasano, I., Ogawa, M., Hu, Z.: Maximum marking problems with accumulative weight functions. In: Van Hung, D., Wirsing, M. (eds.) ICTAC 2005. LNCS, vol. 3722, pp. 562–578. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  11. Puchinger, J., Stuckey, P.J.: Automating branch-and-bound for dynamic programs. In: Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation, PEPM 2008, pp. 81–89. ACM Press (2008)

    Google Scholar 

  12. Morihata, A.: A short cut to optimal sequences. New Generation Comput. 29(1), 31–59 (2011)

    Article  MATH  Google Scholar 

  13. Pu, Y., Bodík, R., Srivastava, S.: Synthesis of first-order dynamic programming algorithms. In: Lopes, C.V., Fisher, K. (eds.) Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2011, pp. 83–98. ACM Press (2011)

    Google Scholar 

  14. Sauthoff, G., Janssen, S., Giegerich, R.: Bellman’s gap: a declarative language for dynamic programming. In: Proceedings of the 13th International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, pp. 29–40. ACM Press (2011)

    Google Scholar 

  15. Paige, R., Koenig, S.: Finite differencing of computable expressions. ACM Trans. Program. Lang. Syst. 4(3), 402–454 (1982)

    Article  MATH  Google Scholar 

  16. Cai, J., Paige, R.: Program derivation by fixed point computation. Sci. Comput. Program. 11(3), 197–261 (1989)

    Article  MATH  MathSciNet  Google Scholar 

  17. Liu, Y.A., Teitelbaum, T.: Systematic derivation of incremental programs. Sci. Comput. Program. 24(1), 1–39 (1995)

    Article  MATH  Google Scholar 

  18. Liu, Y.A., Stoller, S.D., Teitelbaum, T.: Static caching for incremental computation. ACM Trans. Program. Lang. Syst. 20(3), 546–585 (1998)

    Article  Google Scholar 

  19. Cormen, T.H., Stein, C., Rivest, R.L., Leiserson, C.E.: Introduction to algorithms. MIT Press, Cambridge (2001)

    MATH  Google Scholar 

  20. Kleinberg, J., Tardos, É.: Algorithm Design Pearson Education Inc. (2006)

    Google Scholar 

  21. Fukuda, T., Morimoto, Y., Morishita, S., Tokuyama, T.: Mining optimized association rules for numeric attributes. J. Comput. Syst. Sci. 58(1), 1–12 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  22. Fukuda, T., Morimoto, Y., Morishita, S., Tokuyama, T.: Data mining with optimized two-dimensional association rules. ACM Trans. Database Syst. 26(2), 179–213 (2001)

    Article  MATH  Google Scholar 

  23. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  24. Agrawal, R., Imielinski, T., Swami, A.N.: Mining association rules between sets of items in large databases. In: Proceedings of the 1993 ACM SIGMOD International Conference on Management of Data, pp. 207–216. ACM Press (1993)

    Google Scholar 

  25. Koishi, M.: Derivation of two-dimensional maximum weighted sum problems using program transformations. Master’s thesis, Graduate School of Information Science, Tohoku University (2013) (in Japanese)

    Google Scholar 

  26. Mu, S.C.: Maximum segment sum is back: deriving algorithms for two segment problems with bounded lengths. In: Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation, PEPM 2008, pp. 31–39. ACM Press (2008)

    Google Scholar 

  27. Schwartz, J.T.: Automatic data structure choice in a language of very high level. Commun. ACM 18(12), 722–728 (1975)

    Article  MATH  Google Scholar 

  28. Schonberg, E., Schwartz, J.T., Sharir, M.: An automatic technique for selection of data structures in SETL programs. ACM Trans. Program. Lang. Syst. 3(2), 126–143 (1981)

    Article  MATH  Google Scholar 

  29. Paige, R., Henglein, F.: Mechanical translation of set theoretic problem specifications into efficient ram code—a case study. J. Symb. Comput. 4(2), 207–232 (1987)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Morihata, A., Koishi, M., Ohori, A. (2014). Dynamic Programming via Thinning and Incrementalization. In: Codish, M., Sumii, E. (eds) Functional and Logic Programming. FLOPS 2014. Lecture Notes in Computer Science, vol 8475. Springer, Cham. https://doi.org/10.1007/978-3-319-07151-0_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-07151-0_12

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-07150-3

  • Online ISBN: 978-3-319-07151-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics