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.
- The Coq proof assistant, reference manual. https://coq. inria.fr/refman.Google Scholar
- Bellmania repository on github. https://github.com/ corwin-of-amber/bellmaniac/.Google Scholar
- R. E. Bellman. Dynamic Programming. Dover Publications, Incorporated, 2003. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- L. Blaine and A. Goldberg. DTRE — a semi-automatic transformation system. In Constructing Programs from Specifications, pages 165–204. Elsevier, 1991.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- R. Chowdhury and V. Ramachandran. Cache-oblivious dynamic programming. In Proceedings of the ACM-SIAM Symposium on Discrete Algorithms, pages 591–600, 2006. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. The MIT Press, third edition, 2009. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- E. Kneuss, V. Kuncak, I. Kuraj, and P. Suter. Synthesis modulo recursive functions. In OOPSLA, 2013. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348–375, 1978.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- D. R. Smith. Top-down synthesis of divide-and-conquer algorithms. Artificial Intelligence, 27(1):43–96, 1985. Google Scholar
Digital Library
- D. R. Smith. KIDS: A semiautomatic program development system. IEEE Trans. Software Eng., 16(9):1024–1043, 1990. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- A. Solar-Lezama. Program sketching. STTT, 15(5-6):475–495, 2013.Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Recommendations
Deriving divide-and-conquer dynamic programming algorithms using solver-aided transformations
OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsWe 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-...
Program synthesis from polymorphic refinement types
PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present a method for synthesizing recursive functions that provably satisfy a given specification in the form of a polymorphic refinement type. We observe that such specifications are particularly suitable for program synthesis for two reasons. ...
Algorithmic program synthesis: introduction
Program synthesis is a process of producing an executable program from a specification. Algorithmic synthesis produces the program automatically, without an intervention from an expert. While classical compilation falls under the definition of ...







Comments