NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automatic Programming From Data Types Decomposition Patterns

Christian GresseIJCAI 1983

Abstract

In the early 1980s, the field of automatic programming sought to bridge the gap between manual software engineering and fully autonomous synthesis. This paper introduces the Program Builder (PB), an interactive system that leverages the inherent structure of data types to generate algorithmic schemas. By applying decomposition patterns to input and output variables, the PB automates the creation of recursive program skeletons, reducing the cognitive burden on developers. This approach demonstrates that the structural logic of an algorithm is often a direct reflection of the data structures it manipulates.

Introduction

During the formative years of automatic programming, research was largely divided into two methodologies: formal logic deduction and rule-based expert systems. The former often suffered from a "combinatorial explosion" when attempting to deduce programs from first principles, while the latter relied on massive, highly specific knowledge bases that lacked generalizability.

Christian Gresse’s work on the Program Builder (PB) proposed a middle ground through the use of Program Schemas. Instead of attempting to synthesize a complete, perfect program in one pass, the PB focuses on generating the structural skeleton—the logical flow—of a program based on the formal definition of its data types. This methodology rests on the principle that the way a program processes data (such as a tree or a list) is fundamentally dictated by how that data structure is defined.

Methodology: The Program Builder (PB)

The PB operates as a top-down, modular assistant implemented in Maclisp. It was designed for interactive use within the Emacs editor, allowing programmers to guide the synthesis process in real-time. The system utilizes two primary decomposition strategies to derive program schemas:

1. Input Data Decomposition

This strategy focuses on the structure of the input variables. For instance, if a function accepts a list, the PB recognizes that a list is defined recursively: it is either empty or composed of a HEAD and a TAIL. Based on this definition, the PB automatically generates a CASE statement. One branch addresses the base case (the empty list), while the other handles the recursive call on the tail. This structural mapping naturally produces the schemas for algorithms such as Insertion Sort and Merge Sort.

2. Output Variable Decomposition

Alternatively, the system can analyze the desired output. If the output is a list, the PB identifies the necessary constructors (such as CONS) required to build that structure. This approach introduces the concept of "guards"—logical conditions that determine which path the program should take to satisfy the output requirements. This method is particularly effective for deriving algorithms like Selection Sort, where the output is constructed by repeatedly finding and extracting the minimum element from a set.

Key Insights and Philosophical Framework

Data-Driven Structure

The core insight of the PB is that code should mirror the "shape" of the data. If a data structure is recursive, the most efficient and logical code to process it will likely be recursive as well. By formalizing these "Decomposition Patterns," the PB automates the boilerplate of recursion, allowing the developer to focus on high-level logic.

Semantic Independence

A unique feature of the PB is its ability to suggest valid program schemas without a complete semantic understanding of the program's ultimate goal. By focusing on structural validity, the system can provide a functional starting point even when the specific sub-problems (the "muscles" of the program) have yet to be defined. While this can occasionally lead to irrelevant suggestions, it serves as a powerful brainstorming tool for the human user.

The Programmer’s Apprentice

The PB was never intended to replace the human programmer. Instead, it follows the "Programmer’s Apprentice" philosophy. The system handles the structural "how" of the programming task, while the human provides the functional "what." This collaborative approach was a precursor to modern IDE features and automated refactoring tools.

Results and Implementation

The PB was successfully integrated into the ASSPRO project at Orsay University, a suite of tools designed to modernize software development environments. The paper demonstrates the system's utility by generating schemas for several fundamental algorithms:

  • Insertion Sort: Derived via input decomposition (head/tail).
  • Merge Sort: Derived via a complex decomposition that splits strings into two halves.
  • Selection Sort: Derived via output decomposition and the introduction of guards.

Limitations and Future Directions

Despite its successes, the PB faced significant hurdles in the 1980s. The most prominent was the Automatic Guard Generation. While the system could suggest where an if condition was needed, it often required the human user to define the specific logic of that condition. Furthermore, to achieve true autonomy, Gresse noted that the system would need deeper integration with formal specifications—defining exactly what "sorted" means—to verify that the generated sub-problems correctly solve the overarching goal.

By establishing a formal link between data structures and program flow, Gresse’s work laid early groundwork for the field of structural synthesis and the evolution of intelligent programming environments.

Summary updated

BibTeX
@inproceedings{gresse1983automatic,
  author = {Christian Gresse},
  title = {{Automatic Programming From Data Types Decomposition Patterns}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {1983},
}
Figure