Program Verification with Dafny: Ensuring Functional Correctness

dafny an automatic program verifier n.w
1 / 15
Embed
Share

"Learn about Dafny, an automatic program verifier for functional correctness, enabling program verification through innovative features like invariants, assertions, theorem-prover commands, and more."

  • Dafny
  • Program Verification
  • Functional Correctness
  • Verification Tools
  • Software Engineering

Uploaded on | 0 Views


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


  1. Dafny An automatic program verifier for functional correctness K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond LPAR-16 Dakar, Senegal 27 April 2010

  2. Program verification traditional mechanical program verification functional correctness Dafny and others extended static checking limited checking automatic decision procedures (SMT solvers) interactive proof assistants K. Rustan M. Leino

  3. User interaction Program oriented: invariants, assertions, Formula oriented: theorem-prover commands, tactics Formula K. Rustan M. Leino

  4. Dafny Binary search

  5. 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, algebraic datatypes User-defined functions Ghost variables K. Rustan M. Leino

  6. Top-level grammar Program ::= Type* Type ::= Class | Datatype Class ::= class Name { Member* } Member ::= Field | Method | Function Datatype ::= datatype Name { Constructor* } Generic (that is, accepts type parameters) K. Rustan M. Leino

  7. Types Booleans Mathematical integers Finite sets Sequences Class types Algebraic datatypes K. Rustan M. Leino

  8. Dafny Calculator

  9. Verification architecture Boogie K. Rustan M. Leino

  10. Dafny, Boogie, VC From Dafny to verification-condition formulas

  11. Axiomatizing functions function F(x: T): U { Body } ( x F(x) = Body) datatype Tree { Leaf(int); Split(Tree,Tree); } function G(x: Tree): U { match x case Leaf(n) n case Split(a,b) G(a) + G(b) } ( t G(t) = if else G(left(t)) + G(right(t))) ( n G(Leaf(n)) = n) ( a,b G(Split(a,b)) = G(a) + G(b)) K. Rustan M. Leino

  12. root Dafny prev Schorr-Waite algorithm current

  13. Verifying termination Functions Loops Methods decreases clause lexicographic tuple components of tuple can be of any types to compare, consider longest commonly typed prefix of the lexicographic tuple K. Rustan M. Leino

  14. Dafny Using a program to prover a theorem

  15. Conclusions Full functional-correctness verification is becoming more automatic Interaction is moving closer to the problem domain A well-designed language and verifier, plus a great SMT solver, go a long way Dafny (and Boogie) open source: boogie.codeplex.com K. Rustan M. Leino

More Related Content