arXiv:2610.06304cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.06304

Teaching a Minimalist Machine to Discover Recursive Programs for Arithmetic

Dominik Magiera, Christiane Wiebel-Herboth, Frank Jäkel

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Dominik Magiera 1^{1}[0009-0002-0643-9973], Christiane Wiebel-Herboth 2^{2}[0000-0002-6574-3820], and Frank Jäkel 1^{1}[0000-0002-1355-7663]

1^{1} Centre for Cognitive Science & Institute of Psychology, Technische Universität Darmstadt, Germany

2^{2} Honda Research Institute Europe GmbH, Offenbach am Main, Germany

Abstract. Humans can often acquire and synthesize complex, recursive concepts from minimal experience. Leveraging cognitive insights, we propose the Minimalist Machine, a framework for inductive program synthesis designed to model such conceptual learning. The system uses a compact relational subset of Prolog: Programs are searched within a fixed schema of body-free facts and two-body conjunctive Horn clauses. Recursion is not defined by a dedicated metarule. Instead, it emerges when a target predicate is reused inside the body of a learned clause. Inspired by a primary school curriculum, the model is taught through a human-curated, sequential introduction of new concepts in arithmetic. Starting from initially empty knowledge base, it first acquires simple structural predicates, then successor-based state transformations, and finally recursive programs for addition, subtraction, multiplication, and division. Ultimately, this approach yields the fully transparent, inductive reasoning trace necessary for human-like conceptual learning.

The full code and curriculum are available online at github.com/cognitive-modeling/minimalist-machine.

Keywords: Inductive Program Synthesis · Curriculum Learning · Recursive Programs

1 Introduction

Human learning is open-ended. Humans continually revise and extend their internal models through observation, interaction, and exploration rather than optimizing a fixed objective over a fixed dataset [1]. This remains difficult for current AI systems, which are typically trained on fixed datasets and often require human-guided retraining or fine-tuning to adapt to new environments [2]. Large language models also continue to struggle with structural reasoning tasks that require systematic abstraction, such as Bongard visual puzzles [3,4,5]. This raises a central question: how can a machine acquire new structured concepts in a cumulative, reusable, and open-ended way?

A natural formal setting for this problem is Inductive Programming (IP), which studies methods for learning computer programs from incomplete specifications, such as input-output examples [6]. This perspective is attractive because

D. Magiera et al.

programs can represent procedures, abstractions, and reusable forms of reasoning. A central mechanism for making such learning cumulative is predicate invention. By inventing new predicates, a learner can extend its own knowledge base with reusable abstractions, allowing later programs to build on concepts learned in earlier tasks [7,8]. This makes program induction more than the search for a single task-specific solution; it becomes a process of constructing a growing library of concepts. A core target for such cumulative program induction is recursion. Many cognitive abilities, including language, planning, and arithmetic, depend on applying the same operation repeatedly while maintaining a structured representation of intermediate states. In arithmetic, for example, children do not memorize every possible sum or product. They learn procedures such as counting, incrementing, repeated addition, and grouping. Previous work has shown that recursive equations can be induced from examples by detecting structural regularities [9]. The harder problem is to discover recursive structure in a way that supports reuse across tasks, rather than solving each task in isolation.

Existing approaches to Inductive Programming and Inductive Logic Programming make this problem tractable by imposing strong assumptions about the hypothesis space. Systems such as Metagol and Igor2 show that programs can be inferred from examples and can generalize compositionally [10,9]. However, these systems typically rely on predefined languages, metarules, functional schemes, mode declarations, type declarations, predicate declarations, or other structural restrictions that depend on the target concepts and determine in advance which kinds of programs can be found [11]. These forms of language bias are necessary to control the search space, but they also limit what the learner can invent. The open question is therefore what is a minimal structure that must be built into the learner before it can discover reusable recursive programs.

Novelty and Contributions. We ask whether a machine can learn arithmetic in a child-like way, starting from simple relational tasks and progressing through a curriculum toward recursive arithmetic. Our main contributions are:

  1. Discovery of recursive programs with a minimal language bias. We show that recursive symbolic programs can be discovered using a small set of schemas for relational instances and two-body Horn clauses with only three unique variables. The system is not given dedicated templates for recursion, arithmetic operations, accumulation, or inverse relations.

  2. Teaching arithmetic from an initially empty knowledge base. We show that a machine starting from an empty program can acquire arithmetic through a human-inspired curriculum. It first learns simple relational concepts such as projection, equality, permutation, and successor-based state transformation. These concepts are then used as primitives in recursive programs for addition, subtraction, multiplication, and division.

References (22)