On bounded model checking, abstract interpretation, interpolants, and induction K. Rustan M. Leino Microsoft Research, Redmond, WA, USA IFIP WG 2.3, meeting.

Slides:



Advertisements
Similar presentations
Automatic verification of summations K. Rustan M. Leino IFIP WG 2.3 meeting 46 Sydney, Australia 11 January 2007.
Advertisements

Model Checking Base on Interoplation
A SAT characterization of boolean-program correctness K. Rustan M. Leino Microsoft Research, Redmond, WA 14 Nov 2002 IFIP WG 2.4 meeting, Schloβ Dagstuhl,
Hoare-style program verification K. Rustan M. Leino Guest lecturer Rob DeLines CSE 503, Software Engineering University of Washington 26 Apr 2004.
Advanced programming tools at Microsoft
Logical Abstract Interpretation Sumit Gulwani Microsoft Research, Redmond.
Quantified Invariant Generation using an Interpolating Saturation Prover Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
The Spec# programming system K. Rustan M. Leino Microsoft Research, Redmond, WA, USA Lunch seminar, Praxis Bath, UK 6 Dec 2005 joint work with Mike Barnett,
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,
Checking correctness properties of object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 3 EEF summer school on Specification,
Technologies for finding errors in object-oriented software K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 2 Summer school on Formal Models.
Checking correctness properties of object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 2 EEF summer school on Specification,
Technologies for finding errors in object-oriented software K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 1 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?
Quantified Invariant Generation using an Interpolating Saturation Prover Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Program synthesis with Jennisys K. Rustan M. Leino Research in Software Engineering (RiSE), Microsoft Research, Redmond Aleksandar Milicevic MIT IFIP Working.
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Model-based reasoning meets code verification Michael Butler 21 May 2014 WG 2.3 Meeting 55, Orlando.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Lecture #21 Software Model Checking: predicate abstraction Thomas Ball Testing, Verification and Measurement Microsoft Research.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
1 Cover Algorithms and Their Combination Sumit Gulwani, Madan Musuvathi Microsoft Research, Redmond.
Rahul Sharma, Saurabh Gupta, Bharath Hariharan, Alex Aiken, and Aditya Nori (Stanford, UC Berkeley, Microsoft Research India) Verification as Learning.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
Contracts, tools, verification K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Keynote, ASWEC 2010; Auckland, NZ;
Lazy Predicate Abstraction in BLAST John Gallagher CS4117.
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 1 LASER.
Hoare-style program verification K. Rustan M. Leino Guest lecturer Rob DeLine’s CSE 503, Software Engineering University of Washington 26 Apr 2004.
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 0 Summer School on Logic and Theorem-Proving in Programming.
Using and Building an Automatic Program Verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Lecture 0 LASER.
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
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 3 LASER.
K. Rustan M. Leino Microsoft Research, Redmond, WA 10 Oct 2007 IFIP WG 2.3 meeting Santa Fe, NM.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Lazy Abstraction Lecture 3 : Partial Analysis Ranjit Jhala UC San Diego With: Tom Henzinger, Rupak Majumdar, Ken McMillan, Gregoire Sutre.
Refinement, reusable libraries, instantiable classes K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond Joint work.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Coinduction in a language and verifier K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond IFIP WG 2.3 meeting Seattle,
1 Employing decision procedures for automatic analysis and verification of heap-manipulating programs Greta Yorsh under the supervision of Mooly Sagiv.
1 A Combination Method for Generating Interpolants Greta Yorsh Madan Musuvathi Tel Aviv University, Israel Microsoft Research, Redmond, US CAV’05.
K. Rustan M. Leino RiSE, Microsoft Research 1 Dec 2008 Invited talk, working group meeting COST Action IC0701, Formal Verification of Object-Oriented Software.
Algorithmic Software Verification V &VI. Binary decision diagrams.
Application: Correctness of Algorithms Lecture 22 Section 4.5 Fri, Mar 3, 2006.
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
Application: Correctness of Algorithms Lecture 22 Section 4.5 Fri, Feb 18, 2005.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
K. Rustan M. Leino Research in Software Engineering (RiSE) Microsoft Research, Redmond, WA part 2 International Summer School Marktoberdorf Marktoberdorf,
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Toward Unbounded Model Checking for Region Automata Fang Yu, Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
1 Numeric Abstract Domains Mooly Sagiv Tel Aviv University Adapted from Antoine Mine.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Algorithms and Decision Procedures for Regular Languages Chapter 9.
#1 Having a BLAST with SLAM. #2 Software Model Checking via Counter-Example Guided Abstraction Refinement Topic: Software Model Checking via Counter-Example.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
Dafny An automatic program verifier for functional correctness
SS 2017 Software Verification Bounded Model Checking, Outlook
Using and Building an Automatic Program Verifier
Instructor: Rajeev Alur
Introduction to Software Verification
Hoare-style program verification
Over-Approximating Boolean Programs with Unbounded Thread Creation
Dafny An automatic program verifier for functional correctness
Program correctness Axiomatic semantics
Presentation transcript:

On bounded model checking, abstract interpretation, interpolants, and induction K. Rustan M. Leino Microsoft Research, Redmond, WA, USA IFIP WG 2.3, meeting Sep 2004 Prato, Italy

State transition system (I, T, R) where I—description of initial states T—total transition relation R—description of “good” states

Bounded model checking  Is ¬R reachable from I via a finite number of T steps?  BMC(I,T,R,k) = ¬R is reachable from I via at most k T steps

Relations  Id(σ,σ’) = σ=σ’  (R;S)(σ,σ’’) = ( σ’ R(σ,σ’)  S(σ’,σ’’))  R n = R;R;R;…;R  a predicate P can be used as a relation, with the meaning P(σ,σ’) = P(σ)  σ=σ’  R(σ’) = ( σ R(σ,σ’))  everywhere brackets on predicates: [P] = ( σ P(σ)) n times

Checking reachability Reach(I,T,F,k) = { returns (n | 0≤n≤k ¬[I;T n  ¬F]) } SAT(I(σ 0 )  ( i | 0≤i<k T(σ i, σ i+1 ))  ( i | 0≤i≤k F(σ i )) ) BMC(I,T,R,k) = Reach(I,T,¬R,k)

System diameter  The diameter of a system is the smallest number of steps that reaches all reachable states

Basic algorithm Main(I,T,R) = for k := 0 thru Diameter(I,T) do if Reach(I,T,¬R,k) then return Error end end; return Correct

Improved algorithm Main(I,T,R) = if SAT(I  ¬R) then return Error end; for k := 1 thru Diameter(I,T) do { (n | 0≤n<k [I;T n  R]) } case Check(I,T,R,k) of Correct:return Correct Error:return Error DontKnow:skip end end; return Correct

Procedure Check Check(I,T,R,k) = {requires 1≤k  (n | 0≤n<k [I;T n  R]); ensures Error  Reach(I,T,¬R,k); ensures Correct  (n | 0≤n [I;T n  R]); ensures DontKnow  (n | 0≤n≤k [I;T n  R]); } if Reach(I,T,¬R,k) then return Error else … return DontKnow end

System invariant Check(I,T,R,k) = var J := I; if Reach(J,T,¬R,k) then return Error else loop { [I  J]  (n | 0≤n≤k [J;T n  R]) } var J’ := …; { [J  J’]  [J;T  J’] } if [J’  J] then { (n | 0≤n [I;T n  R]) } return Correct else if Reach(J’,T,¬R,k) then return DontKnow end; J := J’ end

NextJ Check(I,T,R,k) = var J := I; if Reach(J,T,¬R,k) then return Error else loop { [I  J]  (n | 0≤n≤k [J;T n  R]) } var J’ := NextJ(J,T,R,k); { [J  J’]  (n | 1≤n≤k [J;T n  J’]) } if [J’  J] then { (n | 0≤n [I;T n  R]) } return Correct else if Reach(J’,T,¬R,k) then return DontKnow end; J := J’ end

Goal: Implement NextJ {1≤k  (n | 0≤n≤k [J;T n  R]) } J’ := NextJ(J,T,R,k) {[J  J’]  (n | 1≤n≤k [J;T n  J’]) }

NextJ: Widen [Cousot/Cousot 1977] NextJ(J,T,R,k) = var J’ := J  J;T ; { [J  J’]  [J;T  J’] } return J’

Interpolants [Craig 1957] For any formulas A and B such that [A  B], there exists an interpolant P such that  [A  P]  [P  B]  every free symbol in P is a free symbol in both A and B

NextJ: Interpolant [McMillan 2003] NextJ(J,T,R,k) = { (n | 0≤n≤k [J;T n  R]) } let σ 0,…,σ k be fresh symbols; let A =J(σ 0 )  T(σ 0,σ 1 ); let B =( i | 1≤i<k T(σ i,σ i+1 ))  ( i | 1≤i≤k R(σ i )); var P := Interpolant(A,B); { [J;T  P[σ/σ 1 ]] } return J  P[σ/σ 1 ]

NextJ: “Induction” [Sheeran/Singh/Stålmarck 2000] NextJ(J,T,R,k) = { (n | 0≤n≤k [J;T n  R]) } { J;T k = J;(R;T) k } var J’ := true;(R;T) k ; { [J;T k  J’] } return J  J’

Completeness  Widen no completeness guarantee (so still needs diameter in main loop)  Interpolant complete for boolean programs  “Induction” complete for boolean programs, under the additional constraint that there are no repeated states

What would make a good NextJ? For J’ := NextJ(J,T,R,k):  [J  J’]  (n | 1≤n≤k [J;T n  J’] (m | 0≤m≤k-n [J’;T m  R]) ) NextJ(J,T,R,k) = let n, P satisfy 1 ≤ n ≤ k [sp(T n, J)  P] [P  wp( (assert R; T) n-k, R)]; return J  P