r/ProgrammingLanguages • u/mttd • 10d ago
What’s going on with program verification?
https://blog.sigplan.org/2026/11/17/whats-going-on-with-program-verification/20
u/pthierry 10d ago
The LLM hype has many facets. I wonder what will become of this one after the bubble pops. I wish the interest in formal verification will not due out.
4
u/Mickenfox 9d ago
Even with assumptions that vastly favor the LLMs, Astrée comes out more than 400 times faster on 20-year-old hardware than today’s best models running on GPU clusters
Have we tried using those $134M worth of tokens to improve Astrée and seeing what comes out?
Also "verify machine code directly" seems insane. We build software piece by piece for a reason. Encoding semantics and restrictions is what programming languages do.
3
u/ryo33h 10d ago
I wonder if divide and conquer could help here.
Also, I hope languages that are fast and support formal proofs become popular.
3
u/matthieum 9d ago
Rust is decently popular, definitely fast (to execute), and has decent support for proofs (in the form of compiler plugins).
I hope that, at some point, the custom attributes (& syntax) used to describe pre-conditions, post-conditions, and invariants are standardized in the language.
3
3
u/garagedragon 9d ago
Contracts being considered as a first party feature in Rust is really cool, but as the GH issue about it points out, it's really complicated to cover all the possibilities of unsafe, weird lifetime logic, etc.
You can probably cover 90% of safe code with only a few constructs so hopefully those arrive relatively quickly
1
u/pthierry 9d ago
This reminds me of The Curse of The Excluded Middle. It's vastly easier to start from something easy to reason about and add features, than to start from something designed only from a practical point of view and adding proofs while maintaining backwards compatibility.
1
u/matthieum 8d ago
Oh god... yes, I was definitely thinking safe code only here.
Mind you, Creusot does perform verifications on
unsafeRust code, so there is work there, but you need "Separation Logic" to reason aboutunsafeRust code and I imagine that'd bleed intounsafecontracts... so I'm not sure how approachable it'd end up being.Would be really cool, though.
1
u/reflexive-polytope 1d ago
Why not use ATS, which supported proofs from day one without requiring any compiler plugins, and whose code generator exploits these proofs to avoid emitting superfluous checks?
ATS can verify things that Rust can't. It can check array index bounds at compile time. It can check that a comparison function satisfies the axioms of a weak ordering. etc. etc. etc.
2
u/joonazan 10d ago
I think the price for verifying nixpkgs wouldn't be that ridiculous if it was something stronger than not crashing. That kind of project would find an enormous amount of bugs, so getting those fixed might be a big part of the cost.
Correctness is a tricky target, though. Some parts are easy to specify but hard to implement. There a correctness proof is great. But some parts are best when expressed in concise code. Those parts would ideally get a good DSL, which is something AI is incapable of designing.
1
u/david-1-1 3d ago
I would presume that high-level language is more rewarding to verify. But in either case, I assume that we simulate all the semantics of the operations and accumulate a logical description of the current values, then compare with a given logical description of what the function or program is supposed to do. Is that right? I remember that The Science of Programming suggested adding pre and post conditions for each small and large section of code. The problem was that there was a big gap between the low level of ordinary predicate calculus and the much higher level of what a section of code can actually do.
16
u/its-been-a-decade 10d ago
I think the author here is very close to pointing out something that I and several of my colleagues have thought for a very long time: the problem is the language. Of course it will cost millions of dollars to verify the correctness of machine code, if for no other reason than it takes an enormous amount of effort simply to specify what “correct” means. We need a language that permits abstract formal specification and a suite of verified components on which to layer applications (without having to re-prove the component again). At that point, we can dispatch verification conditions to whatever theorem prove we like best because it turns out, with sufficiently abstract specification and implementation, VCs are almost always “easy” in the sense that a human can check out the givens and the goal and quickly recognize their validity. Of course there’s plenty of work to be done in automating these proofs using classical methods but I can’t imagine an LLM would get tripped up by these things to the tune of millions of dollars.
Incidentally, one idea a colleague of mine had recently was related to VC proofs with an incomplete theorem prover. Their idea was, in essence, to dispatch unproved VCs to an LLM and direct it to generate a proof and proof certificate. As mentioned above, the VCs are usually so relatively easy that it’s not going to require deep mathematical insight to prove.