Automatic Invention of Functional Abstractions

We investigate how new elements of background knowledge can be abstracted automatically from patterns in programs. The approach is implemented in the KANDINSKY system using an algorithm that searches for common subterms over sets of functional programs. We demonstrate that KANDINSKY can invent higher-order functions such as map, fold, and sumBy from small sets of input programs. An experiment shows that KANDINSKY can find high-compression abstractions efficiently, with low settings of its input parameters. Finally we compare our approach with related work in the inductive logic programming and functional programming literature, and suggest directions for further work.