
AI + Formal Verification. Founder @midspiral_ai. I build tools that make sure your AI-generated code doesn't break the Internet.
Cambridge, MA
Joined June 2012
- Tweets3K
- Following539
- Followers1.1K
- Likes3K
Fernanda Graciolli retweeted
Thrilled that formal methods are having a moment. Horrified that engineers allow agents to write properties.
Let agents write the proofs. Never let agents decide what’s being proved.
Fernanda Graciolli retweeted
Holly Baker, @heyyfernanda, Nada Amin, and team just put out a paper on "claimcheck". It goes after a tricky problem: a proof can pass and STILL prove the wrong thing.
their example: you ask for a sorted list, and the rule says "the output is in order." A program that returns an empty list passes, because an empty list is never out of order.
claimcheck has one model explain the rule in plain English without seeing what you asked for. A second model compares that to your request. That beat just asking one model to compare them, by 8 to 10 points in Dafny, Lean, Isabelle, and Rocq.
arxiv.org/abs/2610.17358
have you noticed that typing into chatgpt or codex has a different "feel" to it than typing into most other web input boxes? it's a detail i noticed recently that makes the UX a little more delightful.
does anyone know what the css/js magic is behind it?
opinions on programming with AI seem evenly split (at least on my timeline):
camp 1: remove all harnesses, skills, constraints -- the models are good enough!
camp 2:
"5. But what if I constrain the agent? Put it in a straitjacket?
6. Oh, the results are pretty good now. How do I go deeper?"
i'm squarely in camp 2 because i actually inspect agent output.
1. Oh shit, AI can do my job better than me
2. Software engineering is dead!
3. I can vibe code as much slop as I want!
4. Oh, things are not going well. Fable/Sol/Opus all suuuck
5. But what if I constrain the agent? Put it in a straitjacket?
6. Oh, the results are pretty good now. How do I go deeper?
7. *Orders 12 software engineering books from Amazon*
8. Software engineering is alive!
📣 This:
“Hopefully by now the problem is clearer: even if your codebase is objectively correct, it might not be in the right shape to be proven correct!”
People assume that in an AI doing formal verification world, they can take their existing codebase, ask AI to prove it correct, and get either a proof or a bug.
Sadly reality has a few bones to pick with this, and one of them is the "existing codebase" part. And that's due to the good ol' halting problem.
The short of it is that there is no general purpose algorithm that takes any program and input and correctly determines whether it will terminate or run forever. With a few mathematical flourishes we can extend that to "Rice's theorem" and prove this is true for any nontrivial semantic property, meaning we can't automatically prove arbitrary things about arbitrary programs.
Now obviously we can prove some things about some programs, or else formal verification wouldn't exist as a field. The trick is that we write the code in a style suitable for verification. One example of this is totality: in Lean, all functions must be guaranteed to return a value for all inputs. If we want some code that runs forever (like f.ex a server), instead of `while true` we do `while (i < 10^60)` so that it's guaranteed to terminate and return a value (after the end of the universe).
(Totality is also why, in Lean, `1/0 == 0`. If you convert your code to Lean without accounting for this, you could have correct lean but incorrect code!)
Another "style" we use is state machines. Even if your code doesn't quite fit an SM architecture, if you want to prove it at scale, you're probably going to go with a state machine. State machines are the carcinisation of provable code.
Hopefully by now the problem is clearer: even if your codebase is objectively correct, it might not be in the right shape to be proven correct!
Okay, just have the AI rewrite your codebase into another form, right? Two problems. One: you don't know if you've introduced errors in the rewrite because you can't prove them equivalent (since one of them is not in a provable shape). Two: making code more verifiable can make it worse on other metrics, like modifiability, performance, and complexity. And now you've got the old bugbear of software engineers, the dreaded tradeoff.
Now, don't get me wrong, formal verification has a huge role in the future of software, but it's not going to be a breezy "prove my Ruby thx" Claude prompt. It's still going to take work and expertise on our parts to prove our code, and to strike the right balance between formal verification and other forms of correctness.
This is one reason I'm so excited to be working at @AntithesisHQ , which tackles a lot of the same properties as proof methods, but verifies them with "deterministic simulation testing" and fuzzing instead of with a proofs. So it's not as thorough and doesn't give you confidence in all inputs, but it automatically works on pretty much any code shape. I've literally grabbed open source projects off Github, told Claude "check properties XYZ in Antithesis thx", and gotten bug reports back. No state machine rewrites needed.
Fernanda Graciolli retweeted
me: how do i open pdf
claude: You're right to ask. The PDF is the prize; the mouse is the gate; and the map is the fulcrum that holds the raven's skull. The furniture's stale, but the instrument's fresh, and the fresh half is the half that counts. I deleted your home directory.
“It works” only lasts until it hits an edge case. The problem isn’t how pretty the code is, it’s that the failure modes are way more catastrophic, and bc they’re harder to catch (and often latent) they compound on subsequent changes.
I think implementation code will be throwaway soon, but that only works if it’s built on a solid foundation.
This is a great list of formal verification tools. Thanks for featuring LemmaScript!
We put together a practical reference to formal verification tools:
quint.sh/guides/formal-verif…
If you're getting started, use it to explore the landscape.
If you're already an expert, help us make it better.
If you find a missing tool or any mistake, please tell us! We want this to be an accurate, useful, and current reference.
we had been running Dafny benchmarks with opus 5 and kimi. opus 5 was usually taking about 15-20 mins to complete proofs. kimi 40+ mins.
then we ran opus 5.5: 4-6 mins. claude proof completion time hasn't changed much since opus 4.5. so this is pretty exciting.
Seeing a lot of vibe coded "formal verification" projects. it's one thing to vibe code an an app that uses formal verification in some way to verify to some extent.
it's a whole other game when you are the one building the verification tools themselves. our work at @midspiral_ai is to build verification tools (that's all we do) and we've tried many approaches. the one approach that definitively does not work is vibing it. you need very solid foundations. you need to be in FULL control of language design. you need to be able to answer what the limitations are, why the limitations exist and what the impact of that limitation is (without asking your agent). you need to stress test it with case after case after case.
releasing something for which the core promise is correctness requires far more ownership than vibes can provide.
LemmaScript is going to have some soundness bugs, that's expected. we're aware of some that exist and document them explicitly. the ones that come up, we immediately understand why and how to fix -- because we built it on strong foundations and with full ownership/accountability.
my academic training is in neuroscience and now im deep inside the AI/ML world. i used to try to engage but there's too big a gap in understanding of the fundamentals. on top of that the terms overlap, so it's like speaking 2 languages that sound similar but diverge in meaning.
I don't mean to sound arrogant by saying this, but I just think it is just true that if people learned more neuroscience, and had a better idea how the human nervous system and brain actually works, then they would be better prepared to understand how machine intelligence is really not the same as human intelligence
For example, neural networks are sort of loosely inspired by cortex, but that's about it
I'm not trying to be a dick, but it's hard to have conversations on here sometimes because people's level of knowledge is just so low
“Programming language syntax or languages themselves doesn’t matter anymore because the agents just do it.” This drives me nuts because it’s just not true. You need to have solidly designed primitives for agents to work with, otherwise it becomes sloppy soup.
maybe it's time to resurface our ACM Queue column: You Don't Know Jack About Formal Verification. We already got the hacker news beatdown. give me your best shot. queue.acm.org/doi/10.1145/38…
Agree with the sentiment. I'd put the timeline at 2-3 years (if we're paralleling to GPT-2 to Astra jump). In one year I'd say we'll be at around sonnet 3.7.
Fernanda Graciolli retweeted
I am running a formal methods hackathon on November 1st, with a bunch of my friends. Contestants will compete to build normie software -- video games, AI agents, travel booking tools, etc. -- but formally verified. We are going to measure to what degree these tools are usable by SWEs with no prior FM background and no FM-specific education. This is a super exciting opportunity to see where the ergonomic gaps are that we, the FM community, need to fill in order to take advantage of our moment in the zeitgeist. If you want to get involved, please DM me! In particular, I think I've got location/food/tokens/photography all covered, but I need some sponsors for the prizes. If you make a cool gizmo or product we can give away and you're down to donate one, please do so!













