skip to main content
research-article

Synthesis of first-order dynamic programming algorithms

Published:22 October 2011Publication History
Skip Abstract Section

Abstract

To solve a problem with a dynamic programming algorithm, one must reformulate the problem such that its solution can be formed from solutions to overlapping subproblems. Because overlapping subproblems may not be apparent in the specification, it is desirable to obtain the algorithm directly from the specification. We describe a semi-automatic synthesizer of linear-time dynamic programming algorithms. The programmer supplies a declarative specification of the problem and the operators that might appear in the solution. The synthesizer obtains the algorithm by searching a space of candidate algorithms; internally, the search is implemented with constraint solving. The space of candidate algorithms is defined with a program template reusable across all linear-time dynamic programming algorithms, which we characterize as first-order recurrences. This paper focuses on how to write the template so that the constraint solving process scales to real-world linear-time dynamic programming algorithms. We show how to reduce the space with (i)~symmetry reduction and (ii)~domain knowledge of dynamic programming algorithms. We have synthesized algorithms for variants of maximal substring matching, an assembly-line optimization, and the extended Euclid algorithm. We have also synthesized a problem outside the class of first-order recurrences, by composing three instances of the algorithm template.

References

  1. D. Andre and S. J. Russell. State abstraction for programmable reinforcement learning agents. In AAAI/IAAI, pages 119--125, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. e. a. Armando Solar-Lezama. The Sketch synthesizer. http://sketch1.csail.mit.edu/demo/.Google ScholarGoogle Scholar
  3. R. Bellman. The theory of dynamic programming. Bull. Amer. Math. Soc., 60:503--515, 1954.Google ScholarGoogle ScholarCross RefCross Ref
  4. R. Bird and O. de Moor. The Algebra of Programming. Prentice-Hall, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. Bodık, S. Chandra, J. Galenson, D. Kimelman, N. Tung, S. Barman, and C. Rodarmor. Programming with angelic nondeterminism. In Hermenegildo and Palsberg DBLP:Conf. POPL 2010, pages 339--352. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. The MIT Press, New York, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Gulwani, S. Srivastava, and R. Venkatesan. Program analysis as constraint solving. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. Gulwani, S. Srivastava, and R. Venkatesan. Constraint-based invariant inference over predicate abstraction. In VMCAI '09: Proceedings of the 2009 Conference on Verification Model Checking and Abstract Interpretation, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. V. Hermenegildo and J. Palsberg, editors. Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, Spain, January 17--23, 2010. ACM, 2010. Google ScholarGoogle Scholar
  10. S. Itzhaky, S. Gulwani, N. Immerman, and M. Sagiv. A simple inductive synthesis methodology and its applications. In OOPSLA, pages 36--46, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Itzhaky, S. Gulwani, N. Immerman, and M. Sagiv. A simple inductive synthesis methodology and its applications. In W. R. Cook, S. Clarke, and M. C. Rinard, editors, OOPSLA, pages 36--46. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. T. A. Lau, S. A. Wolfman, P. Domingos, and D. S. Weld. Programming by demonstration using version space algebra. Machine Learning, 53(1--2):111--156, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. U. Manber. Introduction to Algorithms: A Creative Approach. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Nedunuri and W. R. Cook. Synthesis of fast programs for maximum segment sum problems. In J. G. Siek and B. F. 0002, editors, GPCE, pages 117--126. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Nedunuri, D. R. Smith, and W. R. Cook. A class of greedy algorithms and its relation to greedoids. In A. Cavalcanti, D. Déharbe, M.-C. Gaudel, and J. Woodcock, editors, ICTAC, volume 6255 of Lecture Notes in Computer Science, pages 352--366. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Paige. Symbolic finite differencing - part i. In N. D. Jones, editor, ESOP, volume 432 of Lecture Notes in Computer Science, pages 36--56. Springer, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. I. Sasano, Z. Hu, M. Takeichi, and M. Ogawa. Make it practical: A generic linear-time algorithm for solving maximum-weightsum problems. In In Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming (ICFP'00, pages 137--149. ACM Press, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. I. Shlyakhter. Generating effective symmetry-breaking predicates for search problems. Discrete Applied Mathematics, 155(12):1539--1548, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. D. Smith. Structure and design of global search algorithms. Technical report, Kestrel Institute, 1998.Google ScholarGoogle Scholar
  20. A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI, pages 167--178, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Solar-Lezama, C. G. Jones, and R. Bodik. Sketching concurrent data structures. In PLDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Solar-Lezama, L. Tancau, R. Bodik, S. Seshia, and V. Saraswat. Combinatorial sketching for finite programs. In ASPLOS-XII: Proceedings of the 12th international conference on Architectural support for programming languages and operating systems, pages 404--415. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. Srivastava and S. Gulwani. Program verification using templates over predicate abstraction. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. S. Srivastava, S. Gulwani, and J. S. Foster. VS3: SMT solvers for program verification. In CAV, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. S. Srivastava, S. Gulwani, and J. S. Foster. From program verification to program synthesis. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. S. Srivastava, S. Gulwani, and J. S. Foster. From program verification to program synthesis. In Hermenegildo and Palsberg DBLP:Conf. POPL 2010, pages 313--326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Wikipedia. Dynamic programming, Aug. 2011.Google ScholarGoogle Scholar
  28. F. F. Yao. Efficient dynamic programming using quadrangle inequalities. In Proceedings of the twelfth annual ACM symposium on Theory of computing, STOC '80, pages 429--435, New York, NY, USA, 1980. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Synthesis of first-order dynamic programming algorithms

    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 10
      OOPSLA '11
      October 2011
      1063 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2076021
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
        October 2011
        1104 pages
        ISBN:9781450309400
        DOI:10.1145/2048066

      Copyright © 2011 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 22 October 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!