Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable Software.

Slides:



Advertisements
Similar presentations
SAT-based Bounded and Unbounded Model Checking Edmund M. Clarke Carnegie Mellon University Joint research with C. Bartzis, A. Biere, P. Chauhan, A. Cimatti,
Advertisements

Tutorial I – An Introduction to Model Checking Peng WU INRIA Futurs LIX, École Polytechnique.
Metodi formali dello sviluppo software a.a.2013/2014 Prof.Anna Labella.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
Planning based on Model Checking Dept. of Information Systems and Applied CS Bamberg University Seminar Paper Svetlana Balinova.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
1 Partial Order Reduction. 2 Basic idea P1P1 P2P2 P3P3 a1a1 a2a2 a3a3 a1a1 a1a1 a2a2 a2a2 a2a2 a2a2 a3a3 a3a3 a3a3 a3a3 a1a1 a1a1 3 independent processes.
SYMBOLIC MODEL CHECKING: STATES AND BEYOND J.R. Burch E.M. Clarke K.L. McMillan D. L. Dill L. J. Hwang Presented by Rehana Begam.
 Dr. Vered Gafni 1 LTL Decidability Enables consistency check, but also base for verification.
CS 267: Automated Verification Lecture 7: SMV Symbolic Model Checker, Partitioned Transition Systems, Counter-example Generation in Symbolic Model Checking.
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
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:
Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Strichman Carnegie Mellon University.
Weizmann Institute Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Shtrichman Weizmann Institute & IBM (HRL)
1 Completeness and Complexity of Bounded Model Checking Ed Clarke Daniel Kroening Joel Ouaknine Carnegie Mellon University, Pittsburgh, USA Ofer Strichman.
Temporal Logic and Model Checking. Reactive Systems We often classify systems into two types: Transformational: functions from inputs available at the.
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
1 Model Checking Orna Grumberg Technion Haifa, Israel Taiwan, October 8, 2009.
Review of the automata-theoretic approach to model-checking.
Embedded Systems Laboratory Department of Computer and Information Science Linköping University Sweden Formal Verification and Model Checking Traian Pop.
Pruning techniques for the SAT-based Bounded Model-Checking problem Ofer Shtrichman Weizmann Institute of Science & IBM - HRL.
Weizmann Institute Tuning SAT-checkers for Bounded Model-Checking A bounded guided tour Ofer Shtrichman Weizmann Institute & IBM-HRL.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Completeness and Complexity of Bounded Model Checking.
Automata and Formal Lanugages Büchi Automata and Model Checking Ralf Möller based on slides by Chang-Beom Choi Provable Software Lab, KAIST.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Flavio Lerda 1 LTL Model Checking Flavio Lerda. 2 LTL Model Checking LTL –Subset of CTL* of the form: A f where f is a path formula LTL model checking.
Daniel Kroening and Ofer Strichman Decision Procedure
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
Model Checking and Related Techniques
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
Binary Decision Diagrams (BDDs)
1 Completeness and Complexity of Bounded Model Checking.
10/19/2015COSC , Lecture 171 Real-Time Systems, COSC , Lecture 17 Stefan Andrei.
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
Verification & Validation By: Amir Masoud Gharehbaghi
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Variants of LTL Query Checking Hana ChocklerArie Gurfinkel Ofer Strichman IBM Research SEI Technion Technion - Israel Institute of Technology.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
About Alternating Automata Daniel Choi Provable Software Laboratory KAIST.
SPLST'20098/26/ Good to Know about the Efficiency of State Space Methods Mikko Tiusanen & Antti Valmari Tampere University of Technology Department.
Bernd Fischer RW714: SAT/SMT-Based Bounded Model Checking of Software.
6/12/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development.
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
Basic concepts of Model Checking
Symbolic model checking with SAT/SMT
Introduction to Software Verification
SS 2017 Software Verification Bounded Model Checking, Outlook
Bounded Model Checking
Introduction to Software Verification
SS 2018 Software Verification LTL Satisfiability applied
Chapter 4: Model Checking of Finite State Systems
Formal Methods in software development
Translating Linear Temporal Logic into Büchi Automata
Scalability in Model Checking
Formal Methods in software development
Presentation transcript:

Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable Software Laboratory KAIST

Contents Introduction First glance at Bounded Model Checking –Bounded Model Checking – Safety –Bounded Model Checking – Liveness Linear Temporal Logic Semantics in BMC Translation LTL into Propositional Formula Determining the Bound Further Study Bounded Model Checking - Daniel KAIST2/30

Introduction(1/3) Model Checking without SAT-Solver –Symbolic model checking Binary Decision Diagrams(BDDs) are often become too large Selecting right variable ordering is very important for obtaining small BDDs –Often time consuming or needs manual intervention –Sometimes, no space efficient variable ordering exists –Explicit model checking Generate states explicitly State explosion problem Bounded Model Checking - Daniel KAIST3/30

Bad ordering Variable ordering of BDDs –BDD of (a 1 ∧ b 1 ) ∨ (a 2 ∧ b 2 ) Good ordering Introduction(2/3) Bounded Model Checking - Daniel KAIST4/30 a1a1 a2a2 a2a2 b1b1 b1b1 b2b2 01 a1a1 a2a2 b1b1 b2b2 01

Introduction(3/3) Model Checking with SAT-solver –SAT procedures also operate on Boolean formulas –Does not suffer from the potential space explosion of BDDs –Very efficient implementations exist e.g. MiniSAT, zChaff, … Bounded Model Checking - Daniel KAIST5/30

First Glance at BMC Bounded Model Checking - Daniel KAIST6/30 Given a property p : ( e.g. “ signal_a = signal_b”) Is there a state reachable in k cycles, which satisfies  p ?... s0s0 s1s1 s2s2 s k-1 sksk pp p pp p Counter example Trace

Bounded Model Checking - Safety Bounded Model Checking - Daniel KAIST7/30 The reachable states in k steps are captured by: The property p fails in one of the k steps

Bounded Model Checking - Safety Bounded Model Checking - Daniel KAIST8/30 The safety property p is valid up to step k iff  k  is unsatisfiable:... s0s0 s1s1 s2s2 s k-1 sksk pp p pp p

Bounded Model Checking - Safety Bounded Model Checking - Daniel KAIST9/30 Example: a two bit counter Property: G (  l   r ) For k = 2,  k  is unsatisfiable. For k = 3  k  is satisfiable Initial state:I :  l ^  r Transition:R : l ’ = ( l  r ) ^ r ’ =  r

Bounded Model Checking - Liveness Bounded Model Checking - Daniel KAIST10/30 There is no counterexample of length k to the Liveness property F p iff  k  is unsatisfiable: Loop Constraint... s0s0 s1s1 s2s2 s k-1 sksk :p:p :p:p pp :p:p :p:p =

LTL Semantics in BMC – Key Idea Consider only a finite prefix of a path (bounded by k) and look for possible counterexample Finite prefix may represent an infinite path if there is a back loop from the last state of the prefix to any of the previous states. If no back loop, can’t say anything about infinite behavior Bounded Model Checking - Daniel KAIST11/30... s0s0 s1s1 s2s2 s k-1 sksk :p:p :p:p pp :p:p :p:p = ???

LTL Semantics in BMC Definition 1 : A Kripke structure is a tuple M = (S,I,T,L) with a finite set of states S, the set of initial states I  S, a transition relation between states T  S X S and the labeling of the states L: S  P(A) with atomic propositions A Boolean encoding of state ( vector of state variables ) Each state has a successor state  (s 0,s 1,,…)  (i) = s i and  i = (s i,s i+1,…) Bounded Model Checking - Daniel KAIST12/30 s0s0 s1s1 s2s2 s k-1 sksk...

LTL Semantics Definition 2 (Semantics of LTL) : Let M be a Kripke structure,  be a path in M and f be an LTL formula. Then  ⊨ f ( f is valid along p) is defined as Bounded Model Checking - Daniel KAIST13/30

LTL Semantics in BMC Definition 3 (Validity): –An LTL formula f is universally valid in a Kripke structure M ( in symbols M ⊨ Af ) iff  ⊨ f for all paths  in M with  (0)  I. –An LTL formula f is existentially valid in a Kripke structure M ( in symbols M ⊨ Ef ) iff there exists a path  in M with  ⊨ f and  (0)  I We consider existential model checking problem –Searching for a counterexample for existential model checking problem Bounded Model Checking - Daniel KAIST14/30

LTL Semantics in BMC However, we are considering bounded sequence … Definition 4 : For l  k we call a path  a (k,l)-loop if  (k)   (l) and  =u.v  with u = (  (0),….,  (l-1)) and v=(  (l),..,  (k)). We call  simply a k-loop if there is an l  N with l Mk for which  is a (k,l)-loop Bounded Model Checking - Daniel KAIST15/30

LTL Semantics in BMC Definition 5 (Bounded Semantics for a Loop). Let k ∈ N and π be a k-loop. Then an LTL formula f is valid along the path π with bound k (π ⊨ k f) iff π ⊨ f. Bounded Model Checking - Daniel KAIST16/30

LTL Semantics in BMC Definition 6 (Bounded Semantics without a Loop). Let k ∈ N and let ∈ be a path that is not a k-loop. Then an LTL formula f is valid along the path π with bound k (π ⊨ k f ) iff π ⊨ 0 k f where Bounded Model Checking - Daniel KAIST17/30

LTL Semantics in BMC Lemma 7 : Let h be an LTL formula and  be a path and  ⊨ k h   ⊨ h Lemma 8 : Let f be an LTL formula and M a Kripke structure. If M ⊨ Ef then there exists k ∈ N with M ⊨ k Ef Theorem 9 : Let f be an LTL formula, M a Kripke structure. Then M |= Ef iff there exists k ∈ N with M ⊨ k Ef Bounded Model Checking - Daniel KAIST18/30

Translation LTL into Propositional Formula Given a Kripke structure M, LTL formula f, bound k –We need to construct a Propositional Formula [[ M,f ]] k which represents the constraints on s 0,….,s k such that [[ M,f ]] k is satisfiable iff f is valid along p –The size of [[ M,f ]] k is polynomial in the size of f –The size of [[ M,f ]] k is quadratic in k –The size of [[ M,f ]] k is linear in the size of the propositional formulas for R, I and the p ∈ A. Bounded Model Checking - Daniel KAIST19/30

Translation LTL into Propositional Formula Definition 10 ( Unfolding the Transition Relation ) For a Kripke structure M, k ∈ N, [[ M ]] k = I(s 0 )    T (s i, s i+1 ) Bounded Model Checking - Daniel KAIST20/30 i=0 k-1

Example – 3bit shift register 3-bit misbehaving shift register (x[0],x[1],x[2]) T(x, x’): (x’[0]=x[1])  (x’[1]=x[2])  (x’[2]=1) “Eventually register will be empty” : AF( x=0 ) –AF( x=0 )  ¬EG( x != 0 ) Restrict search to path having k+1 states (k=2) Bounded Model Checking - Daniel KAIST21/30 x 1 [0] x 1 [1] x 1 [2] x 0 [0] x 0 [1] x 0 [2] x0x0 x1x1 x2x2 x 2 [0] x 2 [1] x 2 [2]

Example – 3bit shift register f m = I(x 0 )  T(x 0,x 1 )  T(x 1,x 2 ) T(x 0,x 1 ) = T(x 1,x 2 ) = Property : ¬EG( x != 0 ) Bounded Model Checking - Daniel KAIST22/30 (x 1 [0]  x 0 [1])  x 1 [1]  x 0 [2])  x 1 [2]=1) (x 2 [0]  x 1 [1])  x 2 [1]  x 1 [2])  x 2 [2]=1) x 1 [0] x 1 [1] x 1 [2] x 0 [0] x 0 [1] x 0 [2] x0x0 x1x1 x2x2 x 2 [0] x 2 [1] x 2 [2] L0L0 L1L1 L2L2 “Any path with three states that is a witness for G(x != 0 ) must contain a loop”

Translation LTL into Propositional Formula Bounded Model Checking - Daniel KAIST23/30 Definition 10 ( Unfolding the Transition Relation ) For a Kripke structure M, k ∈ N, [[ M ]] k = I(s 0 )    T (s i, s i+1 ) In 3-bit shifter example, –f m = I(x 0 )  T(x 0,x 1 )  T(x 1,x 2 ) –I(x 0 ) = (x 0 [0]  0)  x 0 [1]  0)  x 0 [2]=0) (arbitrary) –T(x 0,x 1 ) = (x 1 [0]  x 0 [1])  x 1 [1]  x 0 [2])  x 1 [2]=1) –T(x 1,x 2 ) = (x 2 [0]  x 1 [1])  x 2 [1]  x 1 [2])  x 2 [2]=1) Constraint formula –(x i != 0 ) : ( x i [0] = 1) V ( x i [1] = 1 ) V ( x i [2] = 1 ) i=0 k-1

Translation LTL into Propositional Formula Depending on whether a path is a k-loop or not, two different translations exist for temporal formula f Translation if path not a k-loop : [[. ]] i k Translation if path is a k-loop : l [[. ]] i k Definition 12(Successor in a Loop) : Let k,l,i ∈ N, with l,i  k. Define the successor succ(i) in a (k,l)-loop as succ(i) = i+1 for i < k and succ(i) = l for i = k Bounded Model Checking - Daniel KAIST24/30

Definition 11 (Translation of an LTL formula without a Loop): For an LTL formula f and k, i ∈ N with i  k Bounded Model Checking - Daniel KAIST25/30 Translation LTL into Propositional Formula

Definition 13 (Translation of an LTL formula for a Loop): Let f be an LTL formula, k,l,i e N with l,i  k Bounded Model Checking - Daniel KAIST26/30

Translation LTL into Propositional Formula Definition 14 ( Loop Condition) : For k,l ∈ N, let l L k = T(s k, s l ), L k = V l=0 k L k Definition 15 ( General Translation ) : Let f be an LTL formula, M a Kripke structure and k ∈ N Theorem 16 :[[ M,f ]] k is satisfiable iff M ⊨ k Ef Corollary 17 : M ⊨ A ¬f iff [[ M,f ]] k is unsatisfiable for all k ∈ N Bounded Model Checking - Daniel KAIST27/30 without loopwith loop

Determining the Bound Bounded Model Checking - Daniel KAIST28/30

Further Study CBMC –Making the Most of BMC Counterexamples by Alex Groce, Daniel Koening. In BMC 2004 This paper introduces counterexample minimization Bounded Model Checking - Daniel KAIST29/30

Reference Bounded and Unbounded Model Checking using SAT (Invited talk) By E. Clarke. In Satisfiability Solvers and Pr ogram Verification Symbolic Model Checking without BDDs By A. Biere, A. Cimatti, E. Clarke, Y. Zhu. In TACAS’99 Bounded Model Checking - Daniel KAIST30/30