K. Rustan M. Leino RiSE, Microsoft Research 1 Dec 2008 Invited talk, working group meeting COST Action IC0701, Formal Verification of Object-Oriented Software.

Slides:



Advertisements
Similar presentations
Verification of object-oriented programs with invariants Mike Barnett, Robert DeLine, Manuel Fahndrich, K. Rustan M. Leino, Wolfram Schulte Formal techniques.
Advertisements

Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
Extended Static Checking for Java Cormac Flanagan K. Rustan M. Leino Mark Lillibridge Greg Nelson James B. Saxe Raymie Stata Compaq SRC 18 June 2002 PLDI02,
Demand-driven inference of loop invariants in a theorem prover
Checking correctness properties of object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 4 EEF summer school on Specification,
Object Invariants in Specification and Verification K. Rustan M. Leino Microsoft Research, Redmond, WA Joint work with: Mike Barnett, Ádám Darvas, Manuel.
Writing specifications for object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 21 Jan 2005 Invited talk, AIOOL 2005 Paris,
Program Verification Using the Spec# Programming System ETAPS Tutorial K. Rustan M. Leino, Microsoft Research, Redmond Rosemary Monahan, NUIM Maynooth.
Technologies for finding errors in object-oriented software K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 3 Summer school on Formal Models.
Technologies for finding errors in object-oriented software K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 0 Summer school on Formal Models.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Lecture 4 Towards a Verifying Compiler: Data Abstraction Wolfram Schulte Microsoft Research Formal Methods 2006 Purity, Model fields, Inconsistency _____________.
Challenges in increasing tool support for programming K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 23 Sep 2004 ICTAC Guiyang, Guizhou, PRC joint.
Chapter 1 Object Oriented Programming 1. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
Program synthesis with Jennisys K. Rustan M. Leino Research in Software Engineering (RiSE), Microsoft Research, Redmond Aleksandar Milicevic MIT IFIP Working.
Automated Verification with HIP and SLEEK Asankhaya Sharma.
Model-based reasoning meets code verification Michael Butler 21 May 2014 WG 2.3 Meeting 55, Orlando.
Lecture #21 Software Model Checking: predicate abstraction Thomas Ball Testing, Verification and Measurement Microsoft Research.
K. Rustan M. Leino Microsoft Research Peter Müller ETH Zurich Angela Wallenburg Chalmers University.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA, USA 3 December 2008 U. Lugano Lugano, Switzerland.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are crated using the class definition. Programming techniques.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 0 International Summer School Marktoberdorf Marktoberdorf,
ECI 2007: Specification and Verification of Object-Oriented Programs Lecture 2 Courtesy: K. Rustan M. Leino and Wolfram Schulte.
Lecture 2 Towards a Verifying Compiler: Logic of Object oriented Programs Wolfram Schulte Microsoft Research Formal Methods 2006 Objects, references, heaps,
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 1 LASER.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 4 International Summer School Marktoberdorf Marktoberdorf,
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 0 Summer School on Logic and Theorem-Proving in Programming.
K. Rustan M. Leino RiSE, Microsoft Research Typing, Analysis and Verification of Heap-Manipulating Programs Dagstuhl, Germany 20 July 2009.
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 0 LASER.
Building a program verifier K. Rustan M. Leino Microsoft Research, Redmond, WA 10 May 2006 Guest lecture, Shaz Qadeer’s cse599f, Formal Verification of.
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 4 LASER.
Well-cooked Spaghetti: Weakest-Precondition of Unstructured Programs Mike Barnett and Rustan Leino Microsoft Research Redmond, WA, USA.
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 5 LASER.
Automating Separation Logic with Trees and Data Ruzica Piskac Yale University Thomas Wies New York University Damien Zufferey MIT CSAIL CAV, ,
K. Rustan M. Leino Microsoft Research, Redmond, WA 10 Oct 2007 IFIP WG 2.3 meeting Santa Fe, NM.
Using data groups to specify and check side effects K. Rustan M. Leino Microsoft Research Arnd Poetzsch-Heffter Universität Kaiserslautern Yunhong Zhou.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Caltech Pasadena, CA 12 November 2009.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 1 Summer School on Logic and Theorem-Proving in Programming.
Cormac Flanagan University of California, Santa Cruz Hybrid Type Checking.
Proving termination conditions Name Country, City, University Omer Subasi Turkey, Istanbul, Koc University Anton Dergunov
K. Rustan M. Leino RiSE, Microsoft Research, Redmond joint work with Peter Müller and Jan Smans Lecture 0 1 September 2009 FOSAD 2009, Bertinoro, Italy.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
224 3/30/98 CSE 143 Recursion [Sections 6.1, ]
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 3 Marktoberdorf.
Synthesis, Analysis, and Verification Lecture 05a Lectures: Viktor Kuncak Programs with Data Structures: Assertions for Accesses. Dynamic Allocation.
Chapter 1 Object Oriented Programming. OOP revolves around the concept of an objects. Objects are created using the class definition. Programming techniques.
Refinements to techniques for verifying shape analysis invariants in Coq Kenneth Roe GBO Presentation 9/30/2013 The Johns Hopkins University.
Program Verification K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond University of Washington CSE P January.
Rustan Leino RiSE, Microsoft Research, Redmond MIT 5 June 2009 Joint work with: Peter Müller, ETH Zurich Jan Smans, KU Leuven.
K. Rustan M. Leino RiSE, Microsoft Research 17 July 2009 JML seminar Dagstuhl, Germany.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 0 Marktoberdorf.
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
Linked List by Chapter 5 Linked List by
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 3 International Summer School Marktoberdorf Marktoberdorf,
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 2 International Summer School Marktoberdorf Marktoberdorf,
Chapter 5 Linked List by Before you learn Linked List 3 rd level of Data Structures Intermediate Level of Understanding for C++ Please.
K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 15 Nov 2007 Chalmers Göteborg, Sweden.
Extended Static Checking for Java Cormac Flanagan Joint work with: Rustan Leino, Mark Lillibridge, Greg Nelson, Jim Saxe, and Raymie Stata Compaq Systems.
1 Verification of object-oriented programs with invariants Mike Barnett, Robert DeLine, Manuel Fahndrich, K. Rustan M. Leino, Wolfram Schulte ECOOP 2003.
Dafny An automatic program verifier for functional correctness
Automated program verification Bryan Parno
Specification techniques for verifying object-oriented software
Learning Invariants using Decision Trees and Implication Counterexamples Pranav Garg Amazon India.
Using and Building an Automatic Program Verifier
Program Verification via an Intermediate Verification Language
Dafny An automatic program verifier for functional correctness
Presentation transcript:

K. Rustan M. Leino RiSE, Microsoft Research 1 Dec 2008 Invited talk, working group meeting COST Action IC0701, Formal Verification of Object-Oriented Software Madrid, Spain

experimental language sequential, object based (no subclassing) specifications in the style of dynamic frames coarse-grained frames (at the level of whole objects, not individual memory locations)

queue linked list with head/tail pointers in-situ list reversal integer set binary tree Schorr-Waite marking algorithm

Program ::= Class* Class ::= class C { Member* } Member ::= Field Method Function

var x : T;

T ::= bool int set seq C object

method M (Param*) returns (Param*) Spec* { Stmt* }

Stmt ::= var x: T; x := E; E.f := E’; x := new C ; call x* := E.M(E*); if (E) { Stmt* } else { Stmt* } while (E) invariant J; decreases F; { Stmt* } foreach (x in S) { x.f := E; }

Spec ::= requires E; modifies S; ensures E; where “modifies S” means modifies Heap ensures (  o,f  Heap[o,f] = old(Heap)[o,f]  o  old(S)  ¬ old(Heap)[o,alloc]) modifies clauses are enforced at every update

function F (Param*): T reads Rd; { Expr } produces definitional axiom: (  Heap,this,x  F(Heap,this,x) = Expr)

ensures definitional axioms are consistent reading o.f requires o  Rd calling a function G requires Rd G  Rd produces frame axiom: (  h0,h1,this,x  (  o,f  o  Rd  h0[o,f] = h1[o,f])  F(h0,this,x) = F(h1,this,x))

*) well, pretty much… *

class C { var footprint: set ; function Valid(): bool reads {this},footprint; { this  footprint  … } …

method Init() modifies {this}; ensuresValid()  fresh(footprint – {this});

method M() requires Valid(); modifies footprint; ensuresValid()  fresh(footprint – old(footprint));

:Queue:Queue :Node:Node:Node:Node:Node:Node:Node:Node head tail

Specification (excerpt): ensures root.marked; ensures (  n, i  n.marked  0 ≤ i < |n.children|  n.children[i] = null  n.children[i].marked); Loop invariant (excerpt): invariant t.marked; invariant (  n, i  n.marked  0 ≤ i < |n.children|  n  nodeStack  n.children[i] = null  n.children[i].marked);

decreases { n | ¬ n.marked }, |nodeStack|, |t.children| – t.childrenVisited;

ensures root.marked; ensures (  n, i  n.marked  0 ≤ i < |n.children|  n.children[i] = null  n.children[i].marked); ensures (  n  Reach(root,n)  ¬n.marked);

Dynamic-frame specifications are useful and flexible A language design around dynamic frames can be simple Thus good in teaching? Specifications are verbose, but perhaps simplification techniques can be applied (like in Spec# or Chalice) Currently missing in Dafny: scopes for axioms

Pure methods are hard, functions are easy SMT solvers work better with ghost fields than with functions Reachability is not always necessary in specifications Sets and sequences are nice as value types Generics are a cinch Decreases bound checks can be more liberal than naïve translation

SMT solvers can be used for functional- correctness verification Inductive predicates seem useful cases fit nicely with matching triggers take us in the direction of the input languages of interactive theorem provers Need: better views/visualizations of program states to clarify error messages and, generally, what’s going on

Try it for yourself: