The Verification Gap: A Brief History Of Formal Verification 

The fifty-year quest to prove software can never fail. The Math was the easy part.

Formal Methods · Software Correctness · Computer Science
Can We Prove That Software Will Never Fail?
Mathematicians and computer scientists have spent fifty years building tools that can guarantee software is correct. The tools work. Here is why most of the world is not using them.
2026 · Daice Labs

Every piece of software you have ever used was probably wrong in some way. A small and persistent community of researchers has spent more than half a century arguing that this does not have to be true. Their tools are extraordinary. Their adoption rate is not.

In October 1969, a British computer scientist named Tony Hoare published a four-page paper that opened with a sentence that still lands like a provocation: "Computer programming is an exact science." He meant it literally. He was proposing that programs could be verified the way Euclid verified geometric theorems, rigorously, completely, with no room for doubt. Not tested. Not inspected. Proved.

More than fifty years later, that vision has been achieved, in full, for a handful of remarkable pieces of software. And for almost everything else, the gap between what is possible and what is practiced remains as wide as ever. Understanding why requires following an unlikely cast of logicians, engineers, and now AI researchers through one of the stranger intellectual adventures in the history of computing.

I. What "Proving" a Program Actually Means

When software engineers test a program, they run it on inputs they think are representative and check that the outputs look right. This is useful. It can catch a lot of bugs. But it cannot tell you the program is correct, only that it worked on those particular inputs, on that particular day, on that particular machine. As Edsger Dijkstra, one of the field's great curmudgeons, put it: "Testing can show the presence of errors, but not their absence."

Formal verification does something different. It treats a program as a mathematical object and asks whether it satisfies a logical specification, for all possible inputs, in all possible states. Robert Floyd, in 1967, proposed that logical statements could be attached to points in a program the way labels are attached to points on a map. At the start of a loop, you write down what is true. After each iteration, you show that the truth is preserved. At the end, you have proved something about every possible run of the loop, not just the ones you thought to test.

Tony Hoare turned Floyd's intuition into a precise logical system. At its center is a simple notation called a Hoare triple: {P} S {Q}. Read it as a contract. If condition P holds before command S executes, then condition Q will hold afterward. The condition P is called the precondition, Q is the postcondition, and together they express what the program is supposed to do, for every conceivable input, without exception.

The most important thing to understand about this framework is what it demands from the programmer. Before you can prove a program correct, you have to write down exactly what "correct" means. Writing a correct specification turns out to be at least as hard as writing a correct program. Often harder. The specification is where the real thinking happens, and it is where most of the ambitious verification projects in history have run into trouble.

01 Testing vs. Formal Proof
Testing checks a few cases. A Hoare triple proves all of them, for all possible inputs, mathematically guaranteed. The difference is not a matter of degree.
TESTING FORMAL PROOF input = 4 input = 9 input = 16 ··· infinite inputs, never checked Program sqrt(x) Looks right? Correct only for tested inputs. Everything else: unknown. PRECONDITION {P} input >= 0 COMMAND S result = sqrt(input) POSTCONDITION {Q} result² = input Holds for all possible inputs. Mathematically guaranteed. The catch: you must first write down, precisely, what the program is supposed to do.
Testing (sampled inputs only)
Precondition / Postcondition
Command being verified
II. The Machine That Cannot Be Fooled

For a long time, the practical problem with formal verification was that producing a proof was an enormous amount of work, and checking that the proof was actually correct was nearly as hard. Proofs are long, intricate documents. Humans make mistakes in them. And a proof with a subtle error is not just useless; it is actively dangerous, because it gives false confidence.

The solution was to make computers do the checking. In the early 1970s, Robin Milner built a system called LCF (Logic for Computable Functions). LCF was designed around a deceptively simple architectural principle. It defined a type called a theorem. A value of this type could only be constructed by applying a small set of verified inference rules. No other code in the system could create a theorem. This meant the computer could check proofs automatically and infallibly: if your proof compiled, it was correct. The checker could not be fooled, because fooling it would require breaking the type system.

This idea, a small trusted kernel protecting an arbitrarily large and complex verification infrastructure, became the blueprint for every serious proof assistant built since. LCF also gave birth, almost accidentally, to the ML programming language, which later spawned Standard ML, OCaml, and influenced the design of languages all the way up to Haskell and Scala. The descendants of LCF, namely Coq (recently renamed Rocq), Isabelle/HOL, and Lean, are the tools that proved CompCert correct, that proved seL4 correct, and that AlphaProof used to solve IMO problems.

02 The Trusted Kernel Architecture
Everything above the kernel can be arbitrarily complex and user-written. Only the kernel is uncheateable. Milner's 1970s insight still governs every serious proof assistant today.
You (mathematician or engineer) Write high-level proof goals in natural mathematical language Tactics layer High-level proof strategies written in ML / Lean / Ltac, and can be arbitrarily complex Automation (SMT and SAT solvers) Dispatches routine subgoals automatically without human intervention Inference rules A small fixed set of valid logical steps Trusted kernel ~500 lines · cannot be fooled · cannot be bypassed If your proof reaches the kernel and is accepted, it is correct. There is no "almost correct." Can be arbitrarily complex
User-written tactics
Automated reasoning
Inference rules
Trusted kernel (uncheateable)
Formal verification in practice

The seL4 microkernel proof: 8,700 lines of C, 200,000 lines of Isabelle/HOL proof, roughly twenty person-years of effort. The first operating system kernel proved correct down to its machine instructions, used today in military drone systems and secure communications infrastructure.

III. When Exhaustive Search Became Possible

Proof assistants require a human expert guiding them through every logical step. For many practical verification problems, this is too slow. A different approach, invented in the early 1980s, tried to make the process automatic. The idea is called model checking, and it was invented simultaneously by Edmund Clarke and Allen Emerson at Harvard, and Joseph Sifakis at Verimag in France. All three shared the Turing Award in 2007.

Model checking explores every reachable state of a system to check whether a property holds. Give it the model, give it the property, press a button. The weakness is what happens when the model is large. A concurrent system with twenty independent processes, each with ten possible states, has ten-to-the-twentieth possible combined states, roughly the number of atoms in a small mountain. No computer can enumerate it directly.

The breakthrough came from Randal Bryant's 1986 paper on Binary Decision Diagrams. BDDs represent large sets of states in a compact form by exploiting mathematical structure rather than listing every case. In 1990, a group at CMU used BDDs to build a model checker that verified systems with more than ten-to-the-twentieth states. The 1994 Intel Pentium FDIV bug, five missing entries in a lookup table that cost Intel $475 million and triggered a full recall, demonstrated with brutal clarity what was at stake. After that disaster, formal verification became a standard part of chip design at every major manufacturer.

03 The State Explosion Problem
Why checking every possibility sounds impossible, and how Binary Decision Diagrams made it practical by compressing exponential state spaces into manageable structures.
NAIVE ENUMERATION S1 S2 S3 S4 → 10^20 more... Impossible to enumerate → BDDs, 1986 Bryant's breakthrough BINARY DECISION DIAGRAM x1 = ? root decision 0 1 x2 = ? x2 = ? ✓ ✗ ✗ ✓ Shared sub-trees compress exponential space 10^20 states verified in seconds Pentium FDIV bug, 1994: $475M recall. BDDs would have caught it first.
Naive state enumeration
BDD decision nodes
Property holds
Property violated
IV. Two Miracles in the 2000s

Against this backdrop of steadily improving tools, two projects stand out as proof-of-concept demonstrations of what full formal verification can achieve. The first is CompCert, a C compiler developed by Xavier Leroy at INRIA in France. CompCert is not just a correct C compiler; it is a C compiler whose correctness has been completely proved in Coq for every stage of the compilation process. In 2011, researchers at Utah used a random program generator called Csmith to bombard the most widely used C compilers. They found more than 325 bugs in GCC and LLVM. In CompCert's verified core, they found exactly zero.

The second project, seL4, is a microkernel proved correct by Gerwin Klein and his team at NICTA in Australia. The final theorem covers 8,700 lines of C code. The proof, carried out in Isabelle/HOL, runs to more than 200,000 lines. The ratio of proof to code is roughly twenty to one, costing approximately $400 per verified line. Both projects reveal the same sobering arithmetic: full formal verification takes roughly ten to twenty times as much work as writing the software itself, requires PhD-level expertise, and demands a precise formal specification before a single line of code is touched. The tools make it possible. They do not make it cheap.

04 The Verification Cost Pyramid
Moving up the pyramid catches more bugs and costs exponentially more. Full formal proof sits at the narrow, expensive apex. The twenty-to-one proof-to-code ratio of seL4 has not changed in two decades.
$$$$$ $$$$ $$$ $$ $ Full formal proof seL4 · CompCert · HACL* Model checking (TLA+, CBMC) Exhaustive on bounded models, used by AWS Static analysis (Infer, SLAM, Dafny) Proves targeted properties · scales to large codebases Strong type systems (Rust) Eliminates memory safety class · enforced by compiler · no extra cost Testing and fuzzing 20x more proof than code ~$400 per verified line
Full formal proof
Model checking
Static analysis
Type systems
Testing
V. What Industry Actually Does

Given all of this, how do the organizations that care most about software correctness actually approach the problem? The answer is that they apply formal reasoning selectively, where the benefit is clear and the cost is manageable, rather than pursuing comprehensive verification of large systems.

Amazon Web Services has been using TLA+, Leslie Lamport's specification language, since 2011. TLA+ checks designs, not code. Engineers using it to specify DynamoDB, S3, and other services have found bugs requiring counterexample traces of 35 steps, the kind of bug that requires a precise sequence of 35 interleaved events across multiple servers to trigger. No amount of testing would have surfaced them. TLA+ found them before a single line of code was written.

At Meta, a tool called Infer has been running on every code change since 2015. Infer uses separation logic to reason automatically about how programs use memory. By 2015, it was catching over a thousand bugs per month before they shipped, with each analysis completing in about fifteen minutes. Cryptography has gone the furthest: a library called HACL*, developed through Microsoft Research's Project Everest, provides implementations of Curve25519, ChaCha20-Poly1305, and AES-GCM, all verified simultaneously for correctness, memory safety, and constant-time execution. This code now runs inside Firefox, the Linux kernel, WireGuard, and the Windows kernel. Hundreds of millions of people use it every day without knowing it.

Rust represents perhaps the most broadly adopted form of verification-adjacent thinking. Its ownership and borrowing system eliminates the memory safety bugs that account for roughly seventy to eighty percent of all security vulnerabilities, with no runtime overhead and without requiring anyone to know what a Hoare triple is. It represents, in a sense, the most successful deployment of formal-methods thinking in the history of the field, not because it was sold as formal verification, but because it was sold as a better programming language.

VI. The AI Wildcard

For most of the history of formal verification, the bottleneck was human expert time. Large language models have begun to change this, though how much and how durably remains to be seen. Lean Copilot, described in a 2024 paper, integrates LLM suggestions directly into the Lean proof assistant, automating 74 percent of proof steps compared to 40 percent for the best rule-based automation alone.

Google DeepMind's AlphaProof combined a pretrained language model with reinforcement learning operating directly in the Lean proof environment. At the 2024 International Mathematical Olympiad, AlphaProof scored 28 out of 42 possible points, a silver medal performance, with every solution formally verified. It could not submit a solution that was not. The verification layer was not a constraint on capability. It was the mechanism of capability.

What might help verification more broadly is AI assistance for the annotation burden: the tedious work of writing loop invariants, function contracts, and intermediate assertions that verification tools require. Several startups, including Harmonic AI, which raised $100 million in 2025, are pursuing exactly this direction. The hardest part remains what it always was: translating an informal requirement into a precise formal specification. That decision is irreducibly human.

VII. Is the Gap Closing?

The gap is closing in hardware, where formal methods have been essentially mandatory since the mid-1990s. It is closing in high-assurance components, including cryptographic libraries, microkernels, and compilers, where a single flaw can compromise everything above it. It is closing at the edges, in the design-verification space that TLA+ occupies and in the type-system-enforced safety that Rust provides.

It is not closing, at any near-term horizon, for general-purpose software at scale. The twenty-to-one ratio of proof to code observed in seL4 has not budged significantly. The specification problem is irreducible. Testing, continuous integration, and fuzzing, while theoretically inferior, are economically rational for the overwhelming majority of software development, where the cost of a bug is a patch and not a recall.

What has changed is the pressure from outside the field. The European Union's Cyber Resiliency Act, which came into force in 2024, imposes liability on software manufacturers for security vulnerabilities. The United States government's 2024 guidance pushed federal software procurement toward Rust. Ransomware attacks have made the human cost of software insecurity legible in ways it was not before. None of this mandates formal verification. But it raises the cost of ignoring it.

Hoare wrote in 1969 that he envisioned a future where "the correctness of a program, its compiler, and the hardware of the computer have all been established with mathematical certainty." For seL4, CompCert, and HACL*, that future has arrived. For the code running the rest of the world, the gap remains, not because the math was wrong, but because the math turned out to be the easy part. The hard part was always the humans.

05 Where the Gap Is Closing
Fifty years of progress has made formal verification routine in some domains. The rest remains open, and pressure from regulation, ransomware economics, and AI assistance is beginning to shift the landscape.
Hardware Crypto Design Edges General software Closed Wide open Hardware Routine since 1994 Intel, AMD use model checking on every chip economics clear Crypto & kernels seL4, CompCert, HACL* in Firefox proven & deployed costly but real Design & edges TLA+ at AWS Rust in Linux kernel Infer at Meta spreading fast General software Scale, cost, expertise, and specification make full verification out of reach gap persists NEW PRESSURE CLOSING THE GAP FROM OUTSIDE EU Cyber Resiliency Act · US memory-safe mandates · ransomware economics · AI assistance The math works. The tools exist. The gap that remains is not technical.
Hardware (closed)
Crypto & kernels
Design & edges
General software (wide open)
External pressure

Key references: Hoare, "An Axiomatic Basis for Computer Programming" (CACM, 1969); Floyd, "Assigning Meanings to Programs" (1967); Clarke, Emerson, Sifakis, Turing Award lecture (2007); Bryant, "Graph-Based Algorithms for Boolean Function Manipulation" (1986); Leroy, "Formal Verification of a Realistic Compiler" (CACM, 2009); Klein et al., "seL4: Formal Verification of an OS Kernel" (SOSP, 2009); Zinzindohoué et al., "HACL*: A Verified Modern Cryptographic Library" (CCS, 2017); Newcombe et al., "How Amazon Web Services Uses Formal Methods" (CACM, 2015); Song et al., Lean Copilot (2024); Google DeepMind, AlphaProof (Nature, 2025).