r/ProgrammingLanguages • u/ImYoric • Jun 22 '26
Who's using (any kind of) formal verification as part of their toolchain?
Caveat Not strictly a PL topic, but I hope it's PL-adjacent enough for this sub.
My company went AI-native a few months ago, with the predictable results. My team, especially, is working on compiler-adjacent tech, and the agent has proven an endless source of surprises...
We have reached the point where many devs and some managers seem to realize that "spec-driven development" (the LLM style, not the Focus style) is something of wishful thinking, so there may be an opening for us to get a project started in using (some kind of) formal verification as part of our LLM-driven toolchain.
So I wonder if there's anything out there in the wild that we could already use, or at least contribute to, in the hope of getting it to a stage where we could use it.
I've seen Leanstral & DeepSeekProve that offer Lean proofs, which might be possible bricks, leaving the big question of "how do you go from human-readable specs to Lean signatures?" I've seen some work on Model Checking, which I still need to read.
But is anybody actually using any of this? Are there any success stories out there in the wild?
7
u/tiajuanat Jun 22 '26
TLA+ has both an MCP server and Claude/copilot skills
6
u/mamcx Jun 22 '26
I worked on SpacetimeDB and one thing that prove very valuable is to do "waterfall" kind of development: Any major feature requires a human authored specs that exercise everything and is vetted before start coding (this sound things will be slower to code, but proves to be the opposite. 1-2 weeks of planning saves tons of problems later!)
Compilers is the kind of project where all agile stuff is wrong. Do old-school waterfall-lite and you solve most problems.
In there, tooling like benchmarking, testing and even fancy formal verification will emerge naturally.
4
u/whatisRT Jun 22 '26
You don’t need any specialised AI tools to get started with formal verification. All you need is experience in the subject matter (even more so than in regular programming).
Source: I have >5yoe verifying real-world programs in Agda. Claude can easily finish proofs that would have taken me days in a matter of hours, with a paragraph of guidance from a plain state, no MCP, no skills, not even a CLAUDE.md. And Agda is a niche language even for proof assistants. I’m sure other frontier models get similar results.
2
u/ianzen Jun 22 '26
Yes absolutely. Put down a spec in Lean and point an LLM to some resources and papers and have it generate code and proof autonomously. I still have to babysit it for a bit, but the Lean checker immediately kills hallucinations from propagating. In my recent projects, I have LLM suggest from optimizations for a verification tool we are developing, and then have it immediately justify the correctness of the optimization in Lean against a semantic model.
6
u/deaddyfreddy Jun 22 '26
How did you manage to use AI to get predictable results? /s
2
u/reini_urban Jun 22 '26
I have make verify in a couple of my projects. Via cbmc and variants, checking C and C++ code.
Certainly not TLA or lean, unless someone can create these proofs from the original code. Only the original code counts.
1
u/Formal-Laffa 22d ago
I work a lot with Behavioral Programming, a verifiable, executable specification language that is somewhere between TLA+ and Dafny (or so people tell me). We use this to define usage scenario space, from which we derive test suites. So it's a "lightweight" use of formal method, external to the system itself. Also, there's not translation stage between the system source code and the verified artifact.
(proper disclosure: I work for a company that writes Behavioral Programming tool suites)
1
u/carlk22 Sep 22 '26
I’ve been doing something close to this with Rust algorithms and Lean. Last year, proving one RangeSetBlaze insertion algorithm took about three weeks and hundreds of AI prompts. With current models, comparable and harder proofs can take just one or two prompts.
The part I find most interesting is staying at the algorithm level rather than modeling all of Rust. The AI writes or translates the algorithm into Lean, proves the Lean version correct, and then I separately review/test that the Rust matches the proved algorithm. This year I used that workflow for set insertion, map insertion, faster cursor-based variants, cached lengths, and several other properties.
I wrote up the experiment here, including the limitations:
https://levelup.gitconnected.com/nine-rules-for-vibe-validation-of-vibe-coded-algorithms-20db019f5583
1
u/[deleted] Sep 11 '26
[removed] — view removed comment