1991 Volume 6 Issue 6 Pages 920-927
Program synthesis by examples is more convenient than using conventional techniques, since it only requires examples instead of a detailed specification. In spite of this convenience, relatively little research in this type of synthesis has so far been carried out. A major obstacle is that, due to the similarity-based and data-driven features of this technique, many examples and considerable computation power are required to synthesize a complex program. To overcome this difficulty, such systems require some useful heuristics given by their programmer. This paper proposes a method for automatically acquiring such heuristics based on explanations of synthesis processes, in which the system explains how other similar programs are synthesized from given examples and transfers the explanation to the target. To synthesize a program by examples, we write a reversible meta-interpreter. In addition to obtaining a result from a program and data, the interpreter can conversely derive a program from data and a user-specified result. For the synthesis, this interpreter explains how other programs are computed, and then synthesize a new program from given examples by transferring the explanations. Since the programming know-how involved in the similar programs is already available, new programs are easily synthesized using only a small number of examples.