Rendered at 18:15:39 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
gavinray 54 minutes ago [-]
I really think that programming languages need a paradigm shift, now that code is mostly generated (like compiler output) and humans act as reviewers.
Languages were always designed with the intent of humans writing and reading it
We need a language that is verification-aware, with things like refinement/dependent types, and specs as a first-class feature
My money is on Rust evolving the pieces it needs to do this. Already libraries like Verus, Kani, Flux.rs and nightly Contracts feature add much of this.
I feel so strongly about this, I've written two posts on it!
One thing would to add, lean recently[1] got ”intrinsic verification”. So you can write requires, ensures, asserts directly in the function. Which for me, a “normal” non mathematician programmer, is much easier to understand.
I've found that I tend to move a lot faster in lean than verus. I think the proof and tactic language are just a lot more expressive and rust compile times are just generally very painful. I also just find lean to be a much more expressive, pleasant, and readable language than rust. You can also get to a much smaller tcb with lean than with verus.
It does take more work to get to a really fast system with fully manual memory management in lean, but once you do it will have much better trust assumptions than the versus solution.
t520z520 19 hours ago [-]
SMT solvers—which Verus builds upon—feel like a pre-AI workaround for the scarcity of human proof labor. By analogy to Turing completeness, interactive theorem proving is 'complete' in a way that wrestling with a heuristic-driven solver never is.
rsrsrs86 18 hours ago [-]
SMTs are marvels of engineering. They underlie the foundations of many verification techniques that might not look like SMT. For example, F* is based on SMT as well as dep types.
if your correctness depends on arithmetical invariants, SMT will be _much_ more powerful than dependent types because you might be in for a real long compilation time if your dependently typed approach depends on naive peano natural numbers representation
t520z520 7 hours ago [-]
Without a doubt, they are marvels of engineering, dancing on the brink of Rice's theorem. But this doesn't mean I should use them, just like how JS engines being marvels of engineering doesn't mean I should replace Rust/Go with JS. Bare-metal control vs. intricate frameworks is a recurring theme in tech, and choosing the latter here also means cutting yourself off from the accessible intelligence out there. As for the long compilation times, I’d argue that an SMT solver's complexity blowup can be far more catastrophic—and besides, we have long abandoned naive Peano natural number representations in production environments.
The ultimate payoff of an ITP is being able to read in the object language, write in the object language, think in the object language—and ultimately achieve clean, end-to-end proofs. The "road not taken" I'm more interested in is the TCF method, which I think draws a fascinating parallel to how AI actually works.
gr_norm 9 hours ago [-]
In my use, Lean has been significantly more reliable than SMT-based techniques at completing proofs involving juggling numerical properties. A lot of it is that it can use any of a number of best-in-class automation tactics (like `omega` and `grind`, which don't fall back on Peano reasoning) where applicable, while resorting to manual proofs as needed.
sestep 18 hours ago [-]
100% agree. I find it interesting that when I ask an LLM to work with me on verifying something, it usually reaches for SMT-based tools first, which invariably results in it spinning its wheels trying to coax the SMT solver into finding the solution; or if it does choose an ITP, it uses lots of expensive tactics that increase compilation time and thus reduce its iteration speed dramatically. I always have to give it explicit policies like "typechecking all of this project's Rocq code must not take more than two minutes." But once you do have that sort of policy in place, it can achieve incredible results.
defenestration 18 hours ago [-]
Can you share more about your approach and what works well? I would like to learn more about it.
sestep 18 hours ago [-]
I think other than what I wrote above, the only particular thing I do is try to maintain a very clear separation between the human-auditable interface and the LLM-maintained implementation. In the (I'd say medium-sized) projects I've been working on recently, that looks like a single file named Audit.v that's between 1k and 10k lines of code, and then the rest of the Rocq code is between 10k and 100k lines of code.
Happy to say more if you have specific questions.
t520z520 18 hours ago [-]
[dead]
tkz1312 17 hours ago [-]
smt solvers (or other trad automations) on a short timeout with a fallback to an LLM is an amazing combo, but generally I agree it makes no sense to be doing fv outside of a theorem prover these days. Being able to vibe code custom proof producing tactics and automations is totally insane for productivity.
ted_dunning 18 hours ago [-]
Lean builds on the exact same SMT solve (Z3) as Verus does. This is standard practice.
rramadass 18 hours ago [-]
No, that is incorrect.
Leonardo de Moura created both Z3 (automated SMT solver) and Lean (dependent type-based theorem prover) but they use totally different approaches.
nextaccountic 14 hours ago [-]
My guess is that what is meant is that there are Lean tactics to solve stuff through SMT (though, the grind tactic, which is what is generally used to automate proofs, isn't actually SMT)
More generally, you can combine SMT and interactive provers seamlessly, as seen for exaemple in the F* (Fstar) language. It tries to provesç things by SMT, and whatever it can't, you prove yourself
charlieyu1 4 hours ago [-]
Sounds great. Prove verifiers should read like programs rather than arcane magic.
rramadass 18 hours ago [-]
SAT/SMT solvers are easier to understand for programmers than type-based interactive theorem provers. Their FOL maps cleanly to state transitions in a program thus allowing you to map them to VCs which can then be solved.
IMO one needs to study both automated solver-based verification and type system tactic-based interactive theorem provers.
While Lean (dependent type system based) is getting all the attention because of mathematicians, programmers are better served starting with understanding solvers i.e. by using pre/post/invariants/asserts etc. in code. A good book to study is The Calculus of Computation : Decision Procedures
with Applications to Verification by Aaron Bradley and Zohar Manna.
MichaelNolan 16 hours ago [-]
> programmers are better served starting with understanding solvers i.e. by using pre/post/invariants/asserts etc. in code
I agree. It’s much easier to reason about. The good news is lean recently, in the last few months, got that. Under the name “intrinsic verification”.
pjmlp 10 hours ago [-]
This is a good example of killer application, without all the publicity, Lean probably would stay a niche thing for university research, like Idris, Dafny, F* and co.
Instead now everyone is talking about Lean.
t520z520 7 hours ago [-]
Maybe just using Rocq, the program verification oriented ITP language, is also a good idea.
Hizonner 2 hours ago [-]
Am I the only one who thinks Rust made every syntax choice with the intent of creating visually ugly, hard to read code?
Languages were always designed with the intent of humans writing and reading it
We need a language that is verification-aware, with things like refinement/dependent types, and specs as a first-class feature
My money is on Rust evolving the pieces it needs to do this. Already libraries like Verus, Kani, Flux.rs and nightly Contracts feature add much of this.
I feel so strongly about this, I've written two posts on it!
https://gavinray97.github.io/blog/optimize-languages-for-ver...
https://gavinray97.github.io/blog/design-by-contract-and-eff...
1. https://lean-lang.org/doc/reference/latest/releases/v4.34.0/
It does take more work to get to a really fast system with fully manual memory management in lean, but once you do it will have much better trust assumptions than the versus solution.
if your correctness depends on arithmetical invariants, SMT will be _much_ more powerful than dependent types because you might be in for a real long compilation time if your dependently typed approach depends on naive peano natural numbers representation
The ultimate payoff of an ITP is being able to read in the object language, write in the object language, think in the object language—and ultimately achieve clean, end-to-end proofs. The "road not taken" I'm more interested in is the TCF method, which I think draws a fascinating parallel to how AI actually works.
Happy to say more if you have specific questions.
Leonardo de Moura created both Z3 (automated SMT solver) and Lean (dependent type-based theorem prover) but they use totally different approaches.
More generally, you can combine SMT and interactive provers seamlessly, as seen for exaemple in the F* (Fstar) language. It tries to provesç things by SMT, and whatever it can't, you prove yourself
IMO one needs to study both automated solver-based verification and type system tactic-based interactive theorem provers.
While Lean (dependent type system based) is getting all the attention because of mathematicians, programmers are better served starting with understanding solvers i.e. by using pre/post/invariants/asserts etc. in code. A good book to study is The Calculus of Computation : Decision Procedures with Applications to Verification by Aaron Bradley and Zohar Manna.
I agree. It’s much easier to reason about. The good news is lean recently, in the last few months, got that. Under the name “intrinsic verification”.
Instead now everyone is talking about Lean.