Spec: Trades never create or destroy goods
Test: 1 apple for 2 oranges → total still 3 fruit ✅
Impl: 🤖
Proof: ∀ trades, goods before = goods after ∎
@robertpennerI see this take a lot re: formal verification: "The proof is worthless if the spec is wrong." Ok, that's been true for thousands of years. Spec alignment is as imperfect as humans; so what do we do about it?
We use proofs to replace scattershot example-based tests with comprehensive guarantees, while focusing human review on a short, clear spec.
People ask "how did we know human code was right?" We didn't, that's why even well-tested software still ships with bugs. We relied on unit tests and manual review largely because writing formal proofs by hand was too slow and expensive.
Now AI generates more code than humans want to review. But on the flip side, AI is finally making proofs cheap enough to actually write.
Calling formal verification a "cop out" has it backwards. The real cop out is passing up airtight, mathematical certainty when it's finally a realistic option. Lock the code to the spec, and we can put our energy into making the spec better.