← Latest papers
💻 computer science

Nominal techniques as an Agda library

This paper presents a publicly accessible Agda library that implements nominal techniques for handling names and variable binding, successfully balancing rigorous mathematical formalization with practical overhead requirements.

Original authors: Murdoch J. Gabbay, Orestis Melkonian

Published 2026-03-05
📖 5 min read🧠 Deep dive

Original authors: Murdoch J. Gabbay, Orestis Melkonian

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are building a massive, intricate LEGO castle. In this castle, every single brick has a unique name tag. Some bricks are special because they are "temporary"—you can swap them out, rename them, or move them around without changing the structure of the castle, as long as you keep the relationships between them consistent.

In the world of computer science, these "name tags" are called variables or names, and the rules for swapping them are called Nominal Techniques.

For a long time, these rules have been like a secret language spoken only by a few mathematicians. They are beautiful and powerful, but nobody uses them in everyday programming because they are too hard to set up. It's a classic "chicken-and-egg" problem: No one uses the tools because they aren't built, and they aren't built because no one uses them.

This paper is about breaking that cycle. The authors, Murdoch and Orestis, have built a toolbox (a library) inside a very strict, logical programming language called Agda. Their goal is to make these complex name-swapping rules easy enough that anyone can pick them up and use them.

Here is how they did it, explained through some everyday analogies:

1. The Infinite Supply of "Fresh" Names

Imagine you are a teacher in a classroom with an infinite supply of name tags. You need to assign a new name to a student, but you must make sure it's a name no one else is currently using.

  • The Old Way: In some math theories, you just wave a magic wand and say, "There exists a new name!" but you can't actually find it or write it down. It's a ghost name.
  • The Agda Way: Because Agda is a "constructive" language (it demands proof that things actually exist), the authors built a machine that generates a fresh name tag on demand. It's like a vending machine that never runs out of new, unused stickers. This is a huge deal because it turns abstract math into something you can actually program with.

2. The "Swap" Dance

The core of their library is a simple dance move called Swap.
Imagine you have two people, Alice and Bob, holding hands with a third person, Charlie.

  • If you swap Alice and Bob, Charlie's relationship to the group changes slightly, but the structure of the group remains the same.
  • The authors created a set of rules (axioms) that say: "If you swap two names everywhere in your code, the logic still holds true."
  • They built a robot (a macro) that automatically figures out how to perform this swap dance for any complex structure you throw at it. You don't have to manually tell the robot how to swap names inside a list, a tree, or a function; the robot figures it out based on the shape of the data.

3. The "Alpha-Equivalence" Puzzle

In computer science, there's a famous puzzle: Are the programs λx. x and λy. y the same?

  • To a human, yes. They both mean "take an input and give it back." The names x and y don't matter; they are just placeholders.
  • To a computer, they look totally different because the letters are different.
  • Usually, programmers have to use a tricky system called "de Bruijn indices" (replacing names with numbers like 1, 2, 3) to solve this, which is confusing and error-prone.
  • The Solution: The authors' library lets you write λx. x and λy. y naturally. The library uses a special "For All" quantifier (the N symbol in the paper) to say: "These two are equal if you can swap the names around and make them match." It's like saying, "These two sentences mean the same thing because the specific words used for the variables don't change the story."

4. Why This Matters (The "Virtuous Circle")

The authors compared their work to porting a library from Haskell (another programming language) to Agda, but they did it with a twist. They didn't just copy-paste; they made it ergonomic (easy to use) and constructive (provable).

  • Before: Nominal techniques were like a high-end, custom-made suit. It fit perfectly, but only one tailor knew how to make it, and it took years to sew.
  • Now: They have turned it into a Lego kit. You can snap the pieces together, and the instructions (the library) handle the complex math for you.

The Big Picture

The paper demonstrates that you can take these sophisticated mathematical ideas about names and variables and turn them into a practical, working tool for programmers.

They successfully built a system where:

  1. You can define variables naturally (no confusing numbers).
  2. You can swap names automatically without breaking your code.
  3. You can prove your code is correct using these rules.

By making this "beautiful technology" accessible, they hope to start a virtuous circle: more people will use it, which will lead to better tools, which will lead to even more people using it. They are essentially handing the keys to the kingdom of "Name-Swapping Math" to the rest of the programming world, saying, "Here, try this. It's easier than you think."

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →