Introduction to Automatic Program Verification with Dafny
Learn about using and building an automatic program verifier with Dafny language, focusing on abstraction, dynamic frames, and class invariants. Explore the concepts through a demo of RockBand and RockBand2 exercises. Links to resources included.
Introduction to Automatic Program Verification with Dafny
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 4 LASER Summer School 2011 Elba, Italy 8 September 2011
Abstraction, frames demo Counter
Dynamic frames, recap • Conceptually:class C {invariantJ; … } • Explicitly in Dafny:class C {function Valid(): bool … { J }ghostvarRepr: set<object>;constructorInit()modifiesthis;ensures Valid() && fresh(Repr – {this});method Mutate()requires Valid();modifiesRepr;ensures Valid() && fresh(Repr– old(Repr)); }
Dynamic frames idiom demo RockBand, RockBand2
Exercises • List • http://rise4fun.com/Dafny/nAW
Links • Dafny • research.microsoft.com/dafny • rise4fun.com/Dafny/tutorial/guide • rise4fun • rise4fun.com • Verification Corner • research.microsoft.com/verificationcorner