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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of program

program

Related news:

News photo

X is piloting a program that lets AI chatbots generate Community Notes

News photo

No, 16 billion passwords didn't just get exposed in a mega-hack, but you should get with the program and stop reusing passwords anyways

News photo

How easy is it for a developer to "sandbox" a program?