Program Sketching with Types & Examples
Year: 2026
Type: dissertation
Abstract: Computer programs describe instructions for the computer to follow, and the computer will happily follow those instructions without asking questions. Humans, however, tend to make mistakes, leading the computer to do the wrong thing. To try and avoid these situations, programmers often write specifications. These describe some expectation of the programmer about the program in question. This thesis focuses on two common types of specifications: tests and types. Tests describe which output the programmer expects for specific inputs. Types express the programmer’s expectation about the structure of the data handled by the program. The main reason for writing a specification is that the computer can check automatically whether the program matches the programmer’s expectation. It is often encouraged to write specifications before writing the program: it forces the programmer to think about their expectations, and it allows the computer to take those expectations into account when helping the programmer along. In practice, however, specifications are often not used to their full potential. For example, the computer may fail to recognize that (1) the programmer has introduced a mistake while the program cannot yet be executed, (2) the specification contains a contradiction, or (3) there is a way to fill in gaps in the program so that it meets the specification. In this thesis, I develop techniques to get more out of specifications. These techniques are developed in the context of interactive program synthesis, a form of programming from specifications. In Chapter 2, I explore how bidirectional evaluation can be used to find mistakes in incomplete programs that are generated during program synthesis. In Chapter 3, I develop techniques for finding contradictions between tests and polymorphic types, and for proving the absence of such contradictions. In Chapter 4, I expand on these techniques and explore how to fill in gaps in a program so that it matches the specification. In Chapter 5, I look at different scenarios in which the techniques developed in this thesis can be applied.
DOI: 10.33540/3607
Author: Niek Mulleners
Language: English
Subfield: Software
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7212123843
