Get the latest tech news
My first verified imperative program
One of the many exciting new features in the upcoming Lean 4.22 release is a preview of the new verification infrastructure for proving properties of imperative programs. In this post, I’ll take a first look at this feature, show a simple example of what it can do, and compare it to similar tools.
Then we have access to a Python-like syntax with the usual affordances of imperative programming, such as mutable state, for loops and early returns. To do this, Std.Do provides a piece of proof automation called mvcgen(for “monadic verification condition generator”) which analyzes locally imperative programs and tells us what we need to do to prove the triple. All of the automation that makes proving in Lean easy (including grind) generates so-called proof terms that are fed to the small kernel.
Or read this on Hacker News