Computer Science

Ambroise Lafont, Neel Krishnaswami

2026.3.24JOURNAL OF FUNCTIONAL PROGRAMMING

DOI: 10.1017/s0956796825100130

Abstract

Abstract We propose a notion of syntax with metavariables that generalises Miller’s decidable pattern fragment of second-order unification for simply typed $\lambda$ -calculus. Using categorical semantics, we show that, under some conditions, a generalisation of Miller’s unification algorithm applies. To illustrate our semantic analysis, we implemented our generic unification algorithm in Agda. The syntax with metavariables given as input of the algorithm is specified by a notion of signature generalising binding signatures, covering a wide range of examples, including ordered $\lambda$ -calculus and (intrinsic) polymorphic syntax such as System F. Although we do not explicitly handle equations, we also tackle simply typed $\lambda$ -calculus modulo $\beta$ - and $\eta$ -equations (Miller’s original setting) by working on the syntax of normal forms.

Citation format

LAFONT, Ambroise; KRISHNASWAMI, Neel. Semantics of pattern unification. JOURNAL OF FUNCTIONAL PROGRAMMING, 2026, 35.