skip to main content
research-article
Public Access

Deriving divide-and-conquer dynamic programming algorithms using solver-aided transformations

Published:19 October 2016Publication History
Skip Abstract Section

Abstract

We introduce a framework allowing domain experts to manipulate computational terms in the interest of deriving better, more efficient implementations.It employs deductive reasoning to generate provably correct efficient implementations from a very high-level specification of an algorithm, and inductive constraint-based synthesis to improve automation. Semantic information is encoded into program terms through the use of refinement types.

In this paper, we develop the technique in the context of a system called Bellmania that uses solver-aided tactics to derive parallel divide-and-conquer implementations of dynamic programming algorithms that have better locality and are significantly more efficient than traditional loop-based implementations. Bellmania includes a high-level language for specifying dynamic programming algorithms and a calculus that facilitates gradual transformation of these specifications into efficient implementations. These transformations formalize the divide-and conquer technique; a visualization interface helps users to interactively guide the process, while an SMT-based back-end verifies each step and takes care of low-level reasoning required for parallelism.

We have used the system to generate provably correct implementations of several algorithms, including some important algorithms from computational biology, and show that the performance is comparable to that of the best manually optimized code.

References

  1. The Coq proof assistant, reference manual. https://coq. inria.fr/refman.Google ScholarGoogle Scholar
  2. Bellmania repository on github. https://github.com/ corwin-of-amber/bellmaniac/.Google ScholarGoogle Scholar
  3. R. E. Bellman. Dynamic Programming. Dover Publications, Incorporated, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. M. A. Bender, R. Ebrahimi, J. T. Fineman, G. Ghasemiesfeh, R. Johnson, and S. McCauley. Cache-adaptive algorithms. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’14, pages 958–971, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. L. Blaine and A. Goldberg. DTRE — a semi-automatic transformation system. In Constructing Programs from Specifications, pages 165–204. Elsevier, 1991.Google ScholarGoogle Scholar
  6. M. Butler and T. Långbacka. Program derivation using the refinement calculator. In Theorem Proving in Higher Order Logics, volume 1125 of Lecture Notes in Computer Science, pages 93–108. Springer Verlag, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. W.-N. Chin, J. Darlington, and Y. Guo. Parallelizing conditional recurrences. In Proceedings of the Second International Euro-Par Conference on Parallel Processing - Volume I, Euro-Par ’96, pages 579–586, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Chowdhury and V. Ramachandran. Cache-oblivious dynamic programming. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, pages 591–600, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. R. Chowdhury and V. Ramachandran. Cache-efficient dynamic programming algorithms for multicores. In Proceedings of the ACM Symposium on Parallelism in Algorithms and Architectures, pages 207–216, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Chowdhury and V. Ramachandran. The cache-oblivious Gaussian elimination paradigm: theoretical framework, parallelization and experimental evaluation. Theory of Computing Systems, 47(4):878–919, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. Chowdhury, H.-S. Le, and V. Ramachandran. Cacheoblivious dynamic programming for bioinformatics. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 7(3):495–510, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. R. Chowdhury, P. Ganapathi, J. J. Tithi, C. Bachmeier, B. C. Kuszmaul, C. E. Leiserson, A. Solar-Lezama, and Y. Tang. Autogen: Automatic discovery of cache-oblivious parallel recursive algorithms for solving dynamic programs. In Proceedings of the 21st ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’16, page 10, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. The MIT Press, third edition, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. B. Delaware, C. Pit-Claudel, J. Gross, and A. Chlipala. Fiat: Deductive synthesis of abstract data types in a proof assistant. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2015, Mumbai, India, January 15-17, 2015, pages 689–700, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Durbin, S. R. Eddy, A. Krogh, and G. J. Mitchison. Biological Sequence Analysis: Probabilistic Models of Proteins and Nucleic Acids. Cambridge University Press, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  16. J.-C. Filliâtre and A. Paskevich. Why3 - where programs meet provers. In ESOP, Lecture Notes in Computer Science, pages 125–128. Springer, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. L. Fisher and A. M. Ghuloum. Parallelizing complex scans and reductions. In Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, PLDI ’94, pages 135–146, 1994. ISBN 0- 89791-662-X. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Frigo, C. E. Leiserson, H. Prokop, and S. Ramachandran. Cache-oblivious algorithms. In Proceedings of the 40th Annual Symposium on Foundations of Computer Science, FOCS ’99, pages 285–, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Gulwani, S. Jha, A. Tiwari, and R. Venkatesan. Synthesis of loop-free programs. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, June 4-8, 2011, pages 62–73, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. R. M. Karp, R. E. Miller, and S. Winograd. The organization of computations for uniform recurrence equations. J. ACM, 14 (3):563–590, July 1967. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. E. Kneuss, V. Kuncak, I. Kuraj, and P. Suter. Synthesis modulo recursive functions. In OOPSLA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. M. D. Lam, E. E. Rothberg, and M. E. Wolf. The cache performance and optimizations of blocked algorithms. In Proceedings of the Fourth International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS IV, pages 63–74, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348–375, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  24. Y. Pu, R. Bodík, and S. Srivastava. Synthesis of first-order dynamic programming algorithms. In Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2011, part of SPLASH 2011, Portland, OR, USA, October 22–27, 2011, pages 83–98, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. P. M. Rondon, M. Kawaguci, and R. Jhala. Liquid types. In Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’08, pages 159–169, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. D. R. Smith. Top-down synthesis of divide-and-conquer algorithms. Artificial Intelligence, 27(1):43–96, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. D. R. Smith. KIDS: A semiautomatic program development system. IEEE Trans. Software Eng., 16(9):1024–1043, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. Solar-Lezama. The sketching approach to program synthesis. In Programming Languages and Systems, 7th Asian Symposium, APLAS 2009, Seoul, Korea, December 14-16, 2009. Proceedings, pages 4–13, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Solar-Lezama. Program sketching. STTT, 15(5-6):475–495, 2013.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Solar-Lezama, R. Rabbah, R. Bodík, and K. Ebcio˘glu. Programming by sketching for bit-streaming programs. In Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’05, pages 281–294, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Y. M. Teo, W.-N. Chin, and S. H. Tan. Deriving efficient parallel programs for complex recurrences. In Proceedings of the Second International Symposium on Parallel Symbolic Computation, PASCO ’97, pages 101–110, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. J. J. Tithi, P. Ganapathi, A. Talati, S. Agarwal, and R. Chowdhury. High-performance energy-efficient recursive dynamic programming using matrix-multiplication-like flexible kernels. In Proceedings of the IEEE International Parallel & Distributed Processing Symposium, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. E. Torlak and R. Bodik. Growing solver-aided languages with rosette. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software, Onward! 2013, pages 135–152, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library

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 51, Issue 10
    OOPSLA '16
    October 2016
    915 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/3022671
    Issue’s Table of Contents
    • cover image ACM Conferences
      OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
      October 2016
      915 pages
      ISBN:9781450344449
      DOI:10.1145/2983990

    Copyright © 2016 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 19 October 2016

    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!