
Understanding Automatic Program Verification with Dafny
Discover the world of automatic program verification using Dafny, a powerful tool for ensuring software correctness through mechanical verification techniques. Learn about program verification, Dafny's object-based language features, basic concepts, and practical exercises like reasoning about loops and implementing algorithms. Dive into the realm of automated decision procedures, interactive proof assistants, and more in this fascinating journey into program verification.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 1 LASER Summer School 2011 Elba, Italy 7 September 2011
Program verification traditional mechanical program verification assurance level hand proofs (or hand waving) Dafny and others extended static checking human effort automatic decision procedures (SMT solvers) interactive proof assistants no machine assistance technology:
Dafny Object-based language generic classes, no subclassing object references, dynamic allocation sequential control Built-in specifications pre- and postconditions framing loop invariants, inline assertions termination Specification support Sets, sequences, inductive datatypes, User-defined recursive functions Ghost variables
Basics (assert, ensures, BVD, assume, requires, call, testing specs, debugging specs) Swap (parameters, globals, fields)
When do tools kick in? Run time Compile time Design time closer to the time of program construction
Reasoning about loops A loop invariant holds at the top of every iteration is the only thing the verifier remembers from one iteration to another (about the variables being modified) It is as if the loop body were not available while (B) { S; } Loop invariant holds here
Loops Iterative Fibonacci, FindZero (linear search)
Exercises Binary search Specify, implement, and verify binary search Cubes http://rise4fun.com/Dafny/Qch Cubes, recursive http://rise4fun.com/Dafny/6xO