Guarantees by construction, revisited

Jules Jacobs (TU Delft → Radboud → Cornell → Jane Street → ETH)
IPA Fall Days 2026
The cover illustration of the thesis: a maze-like connectivity graph of threads and channels

Guarantees by construction

A guarantee that holds for every program, with no per-program proof effort. Example: data-race freedom in Rust.

Abstraction

You get the guarantee without knowing how it works.

Compositionality

Properties of the whole follow from properties of the parts.

Efficiency

The checker and its output are fast.

Deadlock freedom and verified concurrencysession types, locks, separation logic
Probabilistic programmingparadoxes, exact inference
Network verification and automataBoa, KATch, StacKAT, SER
Deadlocks and leaks

Rust programs can still leak and deadlock

enum List { Nil, Cons(u32, Arc<Mutex<List>>) }

let x = Arc::new(Mutex::new(List::Nil));
*x.lock() = List::Cons(1, x.clone());
drop(x);   // refcount is 1: never freed

Leak: the list points to itself.

Cons(1, ·) refcount stays 1 x dropped
fn swap(x: &Mutex<u32>, y: &Mutex<u32>) {
    let mut gx = x.lock();
    let mut gy = y.lock();
    let tmp = *gx; *gx = *gy; *gy = tmp;
}
spawn(|| swap(x, y));
spawn(|| swap(y, x));

Deadlock: each thread holds one lock and waits for the other.

T1 T2 x y holds waits

Both programs type-check.

Goal: type systems in which every well-typed program is free of deadlocks and leaks, with machine-checked proofs.

Prior work: session types

let c = fork(λc′.
    let (c′, n) = receive(c′) in
    let c′ = send(c′, n mod 2 == 0) in
    close(c′))
let c = send(c, 3) in
let (c, b) = receive(c) in
close(c)
parent child !Int. ?Bool. End ?Int. !Bool. End

Type-checked ⇒ no deadlocks and no leaks.

What was missing: a machine-checked proof.

Connectivity graphs: a proof method for session types

T1 T2 !τ. s?τ. s̄ v before: T1 owns v, and v owns two channels send(c, v) T1 T2 s?τ. s̄ v after: v and what it owns hang under the channel

Every step keeps the ownership graph acyclic, so some thread can always step.

A reusable Rocq library

Also used for multiparty session types (ICFP'22).

Connectivity graphsPOPL'22
Multiparty GVICFP'22
Stephanie Balzer
Stephanie
Balzer
Robbert Krebbers
Robbert
Krebbers

The same idea for locks

T1 T2 T3 refs: 3val: v ⟨τ10⟩ ⟨τ00⟩ ⟨τ00⟩

Lock references are linear. The type specifies who must release the lock and who must free it.

No deadlocks, no leaks.

Higher-order leak and deadlock free locksPOPL'23, distinguished paper
Stephanie Balzer
Stephanie
Balzer

Prior work: Actris

let (c1, c2) = new_chan () in
fork { let x = c2.recv() in
       c2.send(x + 2) };
c1.send(40);
let y = c1.recv() in
assert(y = 42)
{ c ↣ !(x:τ)⟨v⟩{P}. p ∗ P[t/x] }
    send c (v[t/x])
{ c ↣ p[t/x] }

Proved ⇒ the asserts hold

MiniActris: Actris rebuilt from one-shot channels, in under 1,000 lines of Rocq

receiver 0 1 sender
Dependent session protocols in separation logic from first principlesICFP'23
Jonas Kastberg Hinrichsen
Jonas Kastberg
Hinrichsen
Robbert Krebbers
Robbert
Krebbers

LinearActris: deadlock freedom inside the logic

c1, d1 := new_chan()
c2, d2 := new_chan()
fork { c1.recv(); d2.send(2) }
c2.recv(); d1.send(3)

Actris: verified, although it deadlocks.

main forked d1c1c2d2 a cycle

LinearActris: verified programs are deadlock free and leak free.

Deadlock-free separation logicPOPL'24
Jonas Kastberg Hinrichsen
Jonas Kastberg
Hinrichsen
Robbert Krebbers
Robbert
Krebbers
780 pages of Rocq
In hindsight: was it worth it?

With AI you can do this 10–100× faster now.

Question: Is the research now (or soon) easier and faster to do?

Probabilistic programming

Probabilistic programming

Metres

h = rand(Normal(1.7, 0.5))
if rand(Bernoulli(0.5))
  observe(Normal(h, 0.1), 2.0)
end

1.81 m

Centimetres

h = rand(Normal(170, 50))
if rand(Bernoulli(0.5))
  observe(Normal(h, 10), 200)
end

170.2 cm

Answer depends on units!

Paradoxes of probabilistic programmingPOPL'21

Conditioning on an event of probability zero

|x − y| ≤ ε |eˣ − eʸ| ≤ ε

Fix: make the limit explicit with intervals.

mobserve(Normal(h, 0.1), Interval(2.0, ε))
cmobserve(Normal(h, 10), Interval(200, 100ε))

Both programs give 1.70 m and 170 cm.

Paradoxes of probabilistic programmingPOPL'21

Exact inference by discretization

let x = gaussian(0, 1) in
…
if x < 0.8 then x < 0.1
           else x < 2.0
0.10.82.0 0: 0.53981: 0.24832: 0.18913: 0.0228
let x = discrete(0.5398, 0.2483,
                 0.1891, 0.0228) in
…
if x < 2 then x < 1
         else x < 3

Exact answer: P(true) = 0.7289

Slice: type-directed discretization of probabilistic programsOOPSLA'26
Katherine Wu
Katherine
Wu
Kevin Batz
Kevin
Batz
Alexandra Silva
Alexandra
Silva

In hindsight: what's still needed?

Generic inference

Maybe not? Scientists usually run their model on only one input. So we can specify the model in Lean and have AI figure out its value.

Probabilistic programming languages

Maybe yes. We still want a good specification language.

Question: Is there a better approach by the time you finish it?

Network verification and automata

Boa: one algorithm for many kinds of automata

abb aa aa, b bb 12345
State12345
classesAAAAA
signaturesF,A,AF,A,AF,A,AT,A,AT,A,A
classesAAABB
signaturesF,A,AF,B,AF,B,AT,B,BT,B,B
classesCAABB

Generic, but still fast

Fast coalgebraic bisimilarity minimizationPOPL'23
Thorsten Wißmann
Thorsten
Wißmann

In hindsight: is a generic algorithm still needed?

  • +Write the code once, and it works for every kind of automaton.
  • −An agent can now write a custom minimization procedure for each automaton type, and optimize it for that type.

Still nice that one implementation works, and is fast, in general. But a lot of its value is subsumed now.

Question: Will the research still save human effort, or just tokens?

Prior work: NetKAT

NetKAT: a network is a program, and questions about it are equivalences.

KATch: decision diagrams instead of packets. Orders of magnitude faster, and used in Google's NetKAT.

34555 abbc ⊤⊥⊥⊤⊥
KATch: a fast symbolic verifier for NetKATPLDI'24
Mark Moeller
Mark
Moeller
Olivier Savary Belanger
Olivier Savary
Belanger
David Darais
David
Darais
Cole Schlesinger
Cole
Schlesinger
Steffen Smolka
Steffen
Smolka
Nate Foster
Nate
Foster
Alexandra Silva
Alexandra
Silva

Packets with unbounded contents

StacKAT adds a stack to NetKAT, for variable-length packet data.

1 2 3 1 2 1 2 push(3)pop(3)
push(v) · pop(v) ≡ 1
push(v) · pop(w) ≡ 0        (v ≠ w)
push(a)* · pop(a)* ≡ push(a)* + pop(a)*

Equivalence is still decidable.

StacKAT: infinite state network verificationPLDI'25
Nate Foster
Nate
Foster
Tobias Kappé
Tobias
Kappé
Dexter Kozen
Dexter
Kozen
Lily Saada
Lily
Saada
Alexandra Silva
Alexandra
Silva
Jana Wagemaker
Jana
Wagemaker

Deciding serializability

Does every concurrent run of a network system give the same result as some run that handles the requests one at a time?

concurrentone at a time A₁ B₁ A₂ B₂ A₁ A₂ B₁ B₂

Decidable, even with unboundedly many requests.

Deciding serializability in network systemsTACAS'26
Guy Amir
Guy
Amir
Mark Barbone
Mark
Barbone
Nicolas Amat
Nicolas
Amat

In hindsight: are bounded model checkers still good?

  • +They are much cheaper to build now. I made KATch 8× faster in a few minutes, by describing some ideas to AI.
  • +If the finite model covers the whole problem, as in networking, the checker is enough.
  • +Checkers make changes safer, for example to network configurations.
  • −The decidability results in StacKAT are the kind of math that the next AI can do.
  • −Where the model is only an approximation, you can maybe describe the whole space in Lean and have it proved.

Question: Does the work complement or compete?

Did it have to be hindsight?

What GPT-3 could do (2020)

TaskCorrect
2-digit addition≈ 100%
4-digit addition≈ 25%
5-digit addition≈ 9%
Writing a correct function≈ 0%

Me: how far is this going to go?

Robbert: skeptical.

Me: I'm getting a little worried!

2023

It seems reasonable to assume that AI will be able to do mathematics better than humans, and that this will happen in the near future.
My blog, 2023

Feedback: you are crazy, GPT-4 can't even multiply 3-digit numbers.

They were right!

The argument I had

“Humans are incredibly stupid. Humans are even stupider than that at math.”

  1. Humans are barely able to develop civilization.
  2. Humans are very badly designed, given what physics allows.
  3. Humans are not at all optimized for mathematics.
  4. Mathematics is a game that is very well suited for a computer to play.
  5. LLMs are impressively good at "pure intuition".
Therefore AI will be able to do mathematics better than humans, in the near future.

1. Humans are barely able to develop civilization

Sketch: ability to start a civilization rising over evolutionary time, crossing a threshold at Homo sapiens
Not to scale

“Once civilization gets going, they fly to the moon in the blink of an eye.”

Life starts, 3.7 billion years ago Mammals, 225 million years ago Civilization, 6,000 years ago Homo sapiens, 300,000 years ago Homo erectus, 2 million years ago Apes, 25 million years ago

2. Humans are very badly designed

A whale brain is 6× larger.

Transistors switch a million times faster than neurons.

Nerve signals travel at about 100 m/s. Signals in a wire travel at about 200,000,000 m/s.

The laws of physics allow a lot more.

3. Humans are not at all optimized for mathematics

Selection pressure for mathematical ability has been very low.

We can do mathematics only because abilities such as pattern recognition also help us survive.

If mathematics had been useful for survival, we would be much better at it, with the same brains.

4. Mathematics suits computers

In chess, the gap between a grandmaster and a computer is enormous.

Mathematics is also a game with well-defined rules. Rocq and Lean show that it is a search problem.

In principle, brute force search proves every provable theorem. It just takes a long time.

5. LLMs are good at "pure intuition"

GPT-4 is better than humans at natural language, just by predicting the next word.

It can't do mathematics yet: it was not trained for it the way AlphaZero was trained for chess.

LLMs don't need to be very smart: just a good enough heuristic to cut the branching factor of proof search.

Why I didn't act on my own argument

  • Most colleagues were skeptical.
  • Does rational argument even work? It is just a string of words.
  • Papers and careers require conventional work.
  • Even believing it, I did not think enough about what to do differently, and it is hard.
  • The research I was already doing was fun!

Bear with me: let's pretend arguments work.

What it takes for AI to learn a task

Lots of pretraining data builds the right internal structures (can also be generated) A way to check answers lets RL point them at a goal (the checker can also be an LLM) The task

Data, but no checker: writing. There is lots of text, but we can't check for good writing.

A checker, but no data: RL on math problems without pretraining doesn't work.

What comes next?

  • Mathematics: fully superhuman provers.
  • Software engineering: autonomously build the entire software stack.
  • Robotics: LLMs do better than robotics models (RoboHarm, 2026).
  • AI development itself
  • Biology: English description → DNA → pet?
Research of the near future

Vox: who reviews the code?

Three settings: vibe coding, verified programming in which humans review specs, and human code review
Mode crossingICFP'26
Benjamin Peters
Benjamin
Peters
Diana Kalinichenko
Diana
Kalinichenko
Liam Stevenson
Liam
Stevenson
Aspen Smith
Aspen
Smith
Derek Dreyer
Derek
Dreyer
Richard Eisenberg
Richard
Eisenberg
Leo White
Leo
White
Chris Casinghino
Chris
Casinghino
Yaron Minsky
Yaron
Minsky
Others at
Jane Street

Do we still need compilers?

person writes sourcecompilerassembly
Screenshot of RollerCoaster Tycoon (1999), a theme park with roller coasters

RollerCoaster Tycoon (1999): written in assembly by one person.

spec AI generator assemblyassembly + proof

Sep: a proof assistant for writing fast code

Approach (in development)

  • Write code in a proof assistant
  • From high level (type theory)
  • To low level (assembly in CPS)
  • Generators: partial evaluation, specialization, staging, tactics
dependent type theoryHigh levelfunctional programming, advanced typesGeneratorspartial evaluation, staging, tacticsLow levelIRs encoded via CPS ↔ SSAProofsin the same language

What research to work on?

Questions

  • Can AI do your research project by the time you finish it?
  • Is there a better approach by the time you finish it?
  • Is the research now (or soon) easier and faster to do?
  • Does the work complement or compete?
  • Will the research still save human effort, or just tokens?
  • If you fully succeed, does it have impact?

Opportunities

  • Verification has real impact now!
  • You have a lot of leverage to steer the future
  • Make future software understandable by humans
  • AI makes security more important
  • Academia can now do big projects
  • Conventional research is risky now too: so take risks

Reality check: I don't know what to work on.

But it is probably better to think about it.

Thank you.

0:00target 40:00
Next slide
→ / space / click: next step
←: previous
N: notes · P: presenter window
F: fullscreen · Home / End
number + Enter: go to slide
Print to PDF: all steps shown