An Experiment in Knowledge-Based Automatic Programming

Abstract Human programmers seem to know a lot about programming. This suggests a way to try to build automatic programming systems: encode this knowledge in some machine-usable form. In order to test the viability of this approach, knowledge about elementary symbolic programming has been codified into a set of about four hundred detailed rules, and a system, called PECOS, has been built for applying these rules to the task of implementing abstract algorithms. The implementation techniques covered by the rules include the representation of mappings as tables, sets of pairs, property list markings, and inverted mappings, as well as several techniques for enumerating the elements of a collection. The generality of the rules is suggested by the variety of domains in which PECOS has successfully implemented abstract algorithms, including simple symbolic programming, sorting, graph theory, and even simple number theory. In each case, PECOS's knowledge of different techniques enabled the construction of several alternative implementations. In addition, the rules can be used to explain such programming tricks as the use of property list markings to perform an intersection of two linked lists in linear time. Extrapolating from PECO's knowledge-based approach and from three other approaches to automatic programming (deductive, transformational, high level language), the future of automatic programming seems to involve a changing role for deduction and a range of positions on the generality-power spectrum.

[1]  Harvey Bratman Automatic coding , 1961, CACM.

[2]  Zohar Manna,et al.  The Evolution of Programs: Automatic Program Modification , 1977, IEEE Transactions on Software Engineering.

[3]  Gerald Jay Sussman,et al.  A Computer Model of Skill Acquisition , 1975 .

[4]  Craig Schaffert,et al.  Abstraction mechanisms in CLU , 1977, Commun. ACM.

[5]  Mary Shaw,et al.  An introduction to the construction and verification of Alphard programs , 1976, ICSE '76.

[6]  Ira P. Goldstein,et al.  Artificial Intelligence, Language, and the Study of Knowledge , 1977, Cogn. Sci..

[7]  Jacob T. Schwartz,et al.  On programming : an interim report on the SETL Project , 1973 .

[8]  David R. Barstow,et al.  Observations on the interaction between coding and efficiency knowledge in the PSI Program Synthesis System , 1976, ICSE '76.

[9]  David R. Barstow,et al.  Some Rules For The Automatic Synthesis Of Programs , 1975, IJCAI.

[10]  Edward A. Feigenbaum,et al.  The Art of Artificial Intelligence: Themes and Case Studies of Knowledge Engineering , 1977, IJCAI.

[11]  Edsger W. Dijkstra,et al.  Structured programming , 1972, A.P.I.C. Studies in data processing.

[12]  Elaine Kant A Knowledge-Based Approach to Using Efficiency Estimation in Program Synthesis , 1979, IJCAI.

[13]  Douglas B. Lenat,et al.  The ubiquity of discovery , 1993, AFIPS National Computer Conference.

[14]  C. Cordell Green,et al.  The Application of Theorem Proving to Question-Answering Systems , 1969, Outstanding Dissertations in the Computer Sciences.

[15]  Edward A. Felgenbaum The art of artificial intelligence: themes and case studies of knowledge engineering , 1977, IJCAI 1977.

[16]  David R. Barstow,et al.  Knowledge-based program construction , 1979 .

[17]  Zohar Manna,et al.  The evolution of programs: a system for automatic program modification , 1977, POPL '77.

[18]  Lars-erik Thorelli Marking algorithms , 1972 .

[19]  Zohar Manna,et al.  Synthesis: Dreams - Programs , 1979, IEEE Trans. Software Eng..

[20]  Herbert A. Simon,et al.  Experiments with a Heuristic Compiler , 1963, JACM.

[21]  Richard C. T. Lee,et al.  PROW: A Step Toward Automatic Program Writing , 1969, IJCAI.

[22]  E. Shortliffe Mycin: computer-based medical consultations , 1976 .

[23]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[24]  David R. Barstow,et al.  On Program Synthesis Knowledge , 1978, Artif. Intell..

[25]  David R. Barstow,et al.  A hypothetical dialogue exhibiting a knowledge base for a program-understanding system. , 1975 .

[26]  Patrick Henry Winston,et al.  Learning structural descriptions from examples , 1970 .

[27]  David C. Luckham,et al.  On automating the construction of programs. , 1974 .

[28]  C. Cordell Green The design of the PSI program synthesis system , 1976, ICSE '76.

[29]  James R. Low,et al.  Chess , 1975, SGAR.

[30]  John Darlington,et al.  A system which automatically improves programs , 1973, Acta Informatica.