The fifty-year quest to prove software can never fail. The Math was the easy part.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
Daice Labs Inc.
Brookline, MA, USA
Roll the "daice"–exploration & programmable adaptation.