← Latest papers
💻 computer science

Compositional Program Verification with Polynomial Functors in Dependent Type Theory

This paper presents a framework for compositional program verification in dependent type theory that utilizes polynomial functors to model interfaces, implementations, and specifications, demonstrating how these components compose via wiring diagrams and Mealy machines while being fully formalized in Agda.

Original authors: C. B. Aberlé

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

Original authors: C. B. Aberlé

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 trying to understand a massive, complex machine, like a modern car or a smartphone. If you try to look at the entire thing at once, it's overwhelming. You can't see how the engine talks to the brakes, or how the screen connects to the battery.

This paper proposes a new way to build and check software that treats programs like LEGO sets or electronic circuits. Instead of trying to understand the whole giant machine at once, we break it down into small, self-contained boxes, check each box individually, and then snap them together.

Here is the breakdown of the paper's ideas using simple analogies:

1. The "Interface" Box (Polynomial Functors)

Think of every piece of software as a black box with specific ports.

  • The Input Port: What kind of data does this box need to work? (e.g., "I need a list of numbers").
  • The Output Port: What kind of data does this box give back? (e.g., "I will give you a single number").
  • The Directions: If the box has many different input ports, it tells you exactly which path to take for each one.

In the paper, these boxes are called Polynomial Functors. They are just a fancy mathematical way of saying, "Here is the shape of this box's connection points."

2. The "Wiring Diagram" (Composition)

Now, imagine you have a box that sorts mail, and another box that stamps envelopes.

  • To make a "Mail Processing System," you don't rewrite the code for sorting or stamping.
  • You simply wire the output of the "Sorter" box to the input of the "Stamper" box.

The paper introduces Wiring Diagrams as a visual map of how these boxes connect. The magic is that if you know how the Sorter works and how the Stamper works, you automatically know how the whole "Mail System" works just by looking at the wires. You don't need to peek inside the boxes again.

3. The "Rulebook" (Specifications & Dependent Polynomials)

Just because you can wire boxes together doesn't mean they will do the right thing. Maybe the Sorter box is broken and throws away the letters.

To fix this, the authors attach a Rulebook (a Specification) to every box.

  • The Promise: "If you give me a letter (Input), I promise to give you a stamped letter (Output)."
  • The Catch: The rulebook is smart. It says, "If the letter is addressed to 'Bob', I promise to stamp it red. If it's for 'Alice', I promise to stamp it blue."

In the paper, these are called Dependent Polynomials. They are like a dynamic contract that changes based on what goes into the box.

4. The "Inspector" (Verification)

Here is the superpower of this framework: Compositional Verification.

Usually, to prove a whole system is safe, you have to check every single line of code in the entire system. That's like checking every brick in a skyscraper to prove the building won't fall.

This paper says: No, you don't need to do that.

  1. Check the "Sorter" box against its Rulebook. (Pass!)
  2. Check the "Stamper" box against its Rulebook. (Pass!)
  3. Check the Wiring Diagram to make sure the outputs of one match the inputs of the other. (Pass!)

Conclusion: Because the pieces are checked and the connections are correct, the entire system is guaranteed to be correct. The proof "composes" just like the boxes do.

5. The "Robot" (Mealy Machines)

How do we actually run these boxes? The paper uses Mealy Machines.
Think of a Mealy Machine as a robot with a memory.

  • When you push a button (Input), the robot looks at its memory, does a task, gives you a result (Output), and updates its memory for the next time.
  • The paper shows that you can take these "Rulebook-checked" boxes and plug them into these robots. If the boxes are verified, the robot's behavior is also verified.

6. The "Traffic Cop" (Concurrency)

The paper also looks at what happens when boxes run at the same time (like two people trying to use the same printer).

  • They introduce a "Parallel Sum" which acts like a Traffic Cop.
  • It ensures that two boxes don't try to grab the same resource at the exact same time, preventing "traffic jams" (race conditions) in the software.

The Big Picture

The author, C.B. Aberlé, has built a mathematical "Lego kit" for software engineers.

  • Old way: Build a giant wall, then try to find the cracks.
  • New way: Build perfect, verified bricks. Snap them together with a diagram. If the bricks are good and the diagram is right, the wall is perfect.

This framework has been tested and written out in a computer language called Agda (a tool for writing mathematically perfect code), proving that this "Lego approach" actually works in the real world.

In short: This paper gives us a way to build complex software by snapping together small, verified pieces, ensuring that the whole system is safe and correct without having to re-check everything from scratch every time we add a new piece.

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 →