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.
- T. Ball et al. Automatic Predicate Abstraction of C Programs. In Proceedings of the Conference on Programming Language Design and Implementation, June 2001. Google Scholar
Digital Library
- R. Balzer. A 15-year Perspective on Automatic Programming. IEEE Transactions on Software Engineering, 11(11):1257--1268, November 1985. Google Scholar
Digital Library
- D. R. Barstow. Domain-Specific Automatic Programming. IEEE Transactions on Software Engineering, 11(11):1321--1336, November 1985. Google Scholar
Digital Library
- 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 Scholar
- A. W. Biermann. Approaches to Automatic Programming. Advances in Computers, 15:1--63, 1976.Google Scholar
Cross Ref
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. R. Buchanan and D. C. Luckham. On Automating the Construction of Programs. Technical report, Stanford Artificial Intelligence Project, 1974. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- C. Flanagan and S. Qadeer. Predicate Abstraction for Software Verification. In Proceedings of the ACM Symposium on Principles of Programming Languages, January 2002. Google Scholar
Digital Library
- 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 Scholar
- M. Ghallab, D. Nau, and P. Traverso. Automated Planning Theory and Practice. Morgan Kaufmann Publishers, 2004. Google Scholar
Digital Library
- R. Givan. Inferring Program Specifications in Polynomial-Time. In Proceedings of the Static Analysis Symposium, 1996. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- M. Gribskov. President, International Society for Computational Biology; Professor of Biological Sciences and Computer Science, Purdue University. Personal communication, September 2005.Google Scholar
- J. V. Guttag and J. Homing. Larch: Languages and Tools for Formal Specification. Texts and Monographs in Computer Science, 1993. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- J. E. Hopcroft and J. D. Ullman. Formal Languages and Their Relation to Automata. Addison-Wesley, 1969. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- K. Kennedy et al. Telescoping Languages: A System for Automatic Generation of Domain Languages. Proceedings of the IEEE, 93(3):387--408, 2005.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- C.W. Krueger. Software Reuse. ACMComputing Surveys, 24(2):131--183, June 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Z. Manna and R. Waldinger. Fundamentals of Deductive Program Synthesis. IEEE Transactions on Software Engineering, 18(8):674--704, August 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- V. Menon and K. Pingali. High-Level Semantic Optimization of Numerical Codes. In International Conference on Supercomputing, pages 434--443, June 1999. Google Scholar
Digital Library
- R. Metzger and Z. Wen. Automatic Algorithm Recognition and Replacement. MIT Press, 2000.Google Scholar
Cross Ref
- D. S. Nau, Y. Cao, A. Lotem, and H. Muñoz-Avila. The SHOP planning system. AI Magazine, Fall 2001.Google Scholar
- G. C. Necula. Translation Validation for an Optimizing Compiler. In Proceedings of the Conference on Programming Language Design and Implementation, June 2000. Google Scholar
Digital Library
- E. P. D. Pednault. ADL and the State-Transition Model of Action. Journal of Logic and Computation, 4(5):467--512, 1994.Google Scholar
Cross Ref
- E. S. Raymond. The Art of Unix Programming, chapter 8: Minilanguages. Addison-Wesley, 2004. Google Scholar
Digital Library
- J. R. Rice. The Algorithm Selection Problem. Advances in Computers, 15:65--118, 1976.Google Scholar
Digital Library
- C. Rich and R. C. Waters. Automatic Programming: Myths and Prospects. IEEE Computer, 21(8):40--51, August 1988. Google Scholar
Digital Library
- P. Schnorf, M. Ganapathi, and J. L. Hennessy. Compile-Time Copy Elimination. Software Practice and Experience, 23(11):1175--1200, November 1993. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- J. E. Stajich et al. The Bioperl Toolkit: Perl Modules for the Life Sciences. Genome Research, 12(10):1611--1618, October 2002.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- M. T. Vandevoorde. Exploiting Specifications to Improve Program Performance. PhD thesis, MIT, 1994. Google Scholar
Digital Library
- S.Weerawarana et al. PYTHIA: a Knowledge-Based System to Select Scientific Algorithms. ACM Transactions on Mathematical Software, 22(4):447--468, 1996. Google Scholar
Digital Library
- D. S. Weld. Recent Advances in AI Planning. AI Magazine, pages 93--123, Summer 1999.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Context-sensitive domain-independent algorithm composition and selection
Recommendations
Context-sensitive domain-independent algorithm composition and selection
Proceedings of the 2006 PLDI ConferenceProgressing 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 ...
A domain-specific language for building self-optimizing AST interpreters
GPCE '14Self-optimizing AST interpreters dynamically adapt to the provided input for faster execution. This adaptation includes initial tests of the input, changes to AST nodes, and insertion of guards that ensure assumptions still hold. Such specialization ...







Comments