skip to main content
10.1145/1133981.1134003acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Context-sensitive domain-independent algorithm composition and selection

Published:11 June 2006Publication History

ABSTRACT

Progressing beyond the productivity of present-day languages appears to require using domain-specific knowledge. Domain-specific languages and libraries (DSLs) proliferate, but most optimizations and language features have limited portability because each language's semantics are related closely to its domain. We explain how any DSL compiler can use a domain-independent AI planner to implement algorithm composition as a language feature. Our notion of composition addresses a common DSL problem: good library designers tend to minimize redundancy by including only fundamental procedures that users must chain together into call sequences. Novice users are confounded by not knowing an appropriate sequence to achieve their goal. Composition allows the programmer to define and call an abstract algorithm (AA) like a procedure. The compiler replaces an AA call with a sequence of library calls, while considering the calling context. Because AI planners compute a sequence of operations to reach a goal state, the compiler can implement composition by analyzing the calling context to provide the planner's initial state. Nevertheless, mapping composition onto planning is not straightforward because applying planning to software requires extensions to classical planning, and procedure specifications may be incomplete when expressed in a planning language. Compositions may not be provably correct, so our approach mitigates semantic incompleteness with unobtrusive programmer-compiler interaction. This tradeoff is key to making composition a practical and natural feature of otherwise imperative languages, whose users eschew complex logical specifications. Compositions satisfying an AA may not be equal in performance, memory usage, or precision and require selection of a preferred solution. We examine language design and implementation issues, and we perform a case study on the BioPerl bioinformatics library.

References

  1. T. Ball et al. Automatic Predicate Abstraction of C Programs. In Proceedings of the Conference on Programming Language Design and Implementation, June 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Balzer. A 15-year Perspective on Automatic Programming. IEEE Transactions on Software Engineering, 11(11):1257--1268, November 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. R. Barstow. Domain-Specific Automatic Programming. IEEE Transactions on Software Engineering, 11(11):1321--1336, November 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Batory. The Road to Utopia: A Future for Generative Programming. In C. Lengauer et al., editors, Domain-Specific Program Generation (Dagstuhl), pages 1--18, 2004.Google ScholarGoogle Scholar
  5. A. W. Biermann. Approaches to Automatic Programming. Advances in Computers, 15:1--63, 1976.Google ScholarGoogle ScholarCross RefCross Ref
  6. J. Blythe et al. The Role of Planning in Grid Computing. In Proceedings of the International Conference on Automated Planning and Scheduling, June 2003.Google ScholarGoogle Scholar
  7. A. Borgida, J. Mylopoulos, and R. Reiter. On the Frame Problem in Procedure Specifications. IEEE Transactions on Software Engineering, 21(10):785--798, October 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. L. C. Briand, T. Langley, and I.Wieczorek. A Replicated Assessment and Comparison of Common Software Cost Modeling Techniques. In Proceedings of the International Conference on Software Engineering, pages 377--386, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. R. Buchanan and D. C. Luckham. On Automating the Construction of Programs. Technical report, Stanford Artificial Intelligence Project, 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Cytron et al. Efficiently Computing Static Single Assignment Form and the Program Dependence Graph. ACM Transactions on Programming Languages and Systems, 13(4):451--490, October 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. E. Fikes and N. J. Nilsson. STRIPS: A New Approach to the Application of Theorem Proving to Problem Solving. Artificial Intelligence, 2(3-4):189--208, 1971.Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Flanagan and S. Qadeer. Predicate Abstraction for Software Verification. In Proceedings of the ACM Symposium on Principles of Programming Languages, January 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Ghallab et al. PDDL - the Planning Domain Definition Language, Version 1.2. Technical Report DCS TR-1165, Yale Center for Computational Vision and Control, 1998.Google ScholarGoogle Scholar
  14. M. Ghallab, D. Nau, and P. Traverso. Automated Planning Theory and Practice. Morgan Kaufmann Publishers, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Givan. Inferring Program Specifications in Polynomial-Time. In Proceedings of the Static Analysis Symposium, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. K. Golden. A Domain Description Language for Data Processing. In Proceedings of the International Conference on Automated Planning and Scheduling, Workshop on the Future of PDDL, 2003.Google ScholarGoogle Scholar
  17. A. Gomez-Perez, O. Corcho, and M. Fernandez-Lopez. Ontological Engineering: with Examples from the Areas of Knowledge Management, e-Commerce and the Semantic Web. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Gribskov. President, International Society for Computational Biology; Professor of Biological Sciences and Computer Science, Purdue University. Personal communication, September 2005.Google ScholarGoogle Scholar
  19. J. V. Guttag and J. Homing. Larch: Languages and Tools for Formal Specification. Texts and Monographs in Computer Science, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Z. Guyer and C. Lin. Broadway: A Compiler for Exploiting the Domain-Specific Semantics of Software Libraries. Proceedings of the IEEE, 93(2):342--357, February 2005Google ScholarGoogle ScholarCross RefCross Ref
  21. J. E. Hopcroft and J. D. Ullman. Formal Languages and Their Relation to Automata. Addison-Wesley, 1969. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. N. Houstis et al. PYTHIA-II: a Knowledge/Database System for Managing Performance Data and Recommending Scientific Software. ACM Transactions on Mathematical Software, 26(2):227--253, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Jefferson and S. Riddle. Towards a Formal Semantics of a Composition Language. In Proceedings of the Workshop on Composition Languages at ECOOP, 2003.Google ScholarGoogle Scholar
  24. K. Kennedy et al. Telescoping Languages: A System for Automatic Generation of Domain Languages. Proceedings of the IEEE, 93(3):387--408, 2005.Google ScholarGoogle ScholarCross RefCross Ref
  25. K. Kennedy, C. Koelbel, and R. Schreiber. Defining and Measuring the Productivity of Programming Languages. International Journal of High Performance Computing Applications, 18(4):441--448, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Kim, M. Sparagen, and Y. Gil. An Intelligent Assistant for Interactive Workflow Composition. In Proceedings of the International Conference on Intelligent User Interfaces, pages 125--131, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. C.W. Krueger. Software Reuse. ACMComputing Surveys, 24(2):131--183, June 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. S. Lerner, T. Millstein, and C. Chambers. Automatically Proving the Correctness of Compiler Optimizations. In Proceedings of the Conference on Programming Language Design and Implementation, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Mandelin et al. Jungloid Mining: Helping to Navigate the API Jungle. In Proceedings of the Conference on Programming Language Design and Implementation, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Z. Manna and R. Waldinger. Fundamentals of Deductive Program Synthesis. IEEE Transactions on Software Engineering, 18(8):674--704, August 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. B. D. Martino, G. Iannello, and H. P. Zima. An Automated Algorithmic Recognition Technique to Support Parallel Software Development. In Proceedings of the International Workshop on Parallel and Distributed Software Engineering, May 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. V. Menon and K. Pingali. A Case for Source-Level Transformations in MATLAB. In Proceedings of the 2nd USENIX Conference on Domain-Specific Languages, pages 53--65, October 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. V. Menon and K. Pingali. High-Level Semantic Optimization of Numerical Codes. In International Conference on Supercomputing, pages 434--443, June 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. R. Metzger and Z. Wen. Automatic Algorithm Recognition and Replacement. MIT Press, 2000.Google ScholarGoogle ScholarCross RefCross Ref
  35. D. S. Nau, Y. Cao, A. Lotem, and H. Muñoz-Avila. The SHOP planning system. AI Magazine, Fall 2001.Google ScholarGoogle Scholar
  36. G. C. Necula. Translation Validation for an Optimizing Compiler. In Proceedings of the Conference on Programming Language Design and Implementation, June 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. E. P. D. Pednault. ADL and the State-Transition Model of Action. Journal of Logic and Computation, 4(5):467--512, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  38. E. S. Raymond. The Art of Unix Programming, chapter 8: Minilanguages. Addison-Wesley, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. J. R. Rice. The Algorithm Selection Problem. Advances in Computers, 15:65--118, 1976.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. C. Rich and R. C. Waters. Automatic Programming: Myths and Prospects. IEEE Computer, 21(8):40--51, August 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. P. Schnorf, M. Ganapathi, and J. L. Hennessy. Compile-Time Copy Elimination. Software Practice and Experience, 23(11):1175--1200, November 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. U. P. Schultz, J. L. Lawall, and C. Consel. Automatic Program Specialization for Java. ACM Transactions on Programming Languages and Systems, 25(4):452--499, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. J. M. Siskind and D. A. McAllester. Screamer: A Portable Efficient Implementation of Nondeterministic Common Lisp. Technical Report IRCS-93-03, Institute for Research in Cognitive Science, University of Pennsylvania, 1993.Google ScholarGoogle Scholar
  44. J. E. Stajich et al. The Bioperl Toolkit: Perl Modules for the Life Sciences. Genome Research, 12(10):1611--1618, October 2002.Google ScholarGoogle Scholar
  45. M. Stickel et al. Deductive Composition of Astronomical Software from Subroutine Libraries. In Proceedings of the International Conference on Automated Deduction, pages 341--355, June 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. N. Thomas et al. A Framework for Adaptive Algorithm Selection in STAPL. In Proceedings of the Symposium on the Principles and Practice of Parallel Programming, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. M. T. Vandevoorde. Exploiting Specifications to Improve Program Performance. PhD thesis, MIT, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. S.Weerawarana et al. PYTHIA: a Knowledge-Based System to Select Scientific Algorithms. ACM Transactions on Mathematical Software, 22(4):447--468, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. D. S. Weld. Recent Advances in AI Planning. AI Magazine, pages 93--123, Summer 1999.Google ScholarGoogle Scholar
  50. S. Woods and Q. Yang. The Program Understanding Problem: Analysis and a Heuristic Approach. In Proceedings of the InternationalConference on Software Engineering, pages 6--15, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. H. Yu, D. Zhang, and L. Rauchwerger. An Adaptive Algorithm Selection Framework. In Proceedings of the International Conference on Parallel Architectures and Compilation Techniques (PACT), September 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. A. M. Zaremski and J. M. Wing. Specification Matching of Software Components. ACM Transactions on Software Engineering and Methodology, 6(4):333--369, October 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Context-sensitive domain-independent algorithm composition and selection

      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

      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!