Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.

Slides:



Advertisements
Similar presentations
Model Checking Base on Interoplation
Advertisements

The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Exploiting SAT solvers in unbounded model checking
Exploiting SAT solvers in unbounded model checking K. L. McMillan Cadence Berkeley Labs.
Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Abstraction in Model Checking Nishant Sinha. Model Checking Given a: –Finite transition system M –A temporal property p The model checking problem: –Does.
NP-Hard Nattee Niparnan.
CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
Efficient Reachability Analysis for Verification of Asynchronous Systems Nishant Sinha.
Model Checking Inputs: A design (in some HDL) and a property (in some temporal logic) Outputs: Decision about whether or not the property always holds.
Towards More Efficient SAT-Based Model Checking Joao Marques-Silva Electronics & Computer Science University of Southampton LAA C&V Workshop, Isaac Newton.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: Property checking Property checking.
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.
1 Temporal Logic u Classical logic:  Good for describing static conditions u Temporal logic:  Adds temporal operators  Describe how static conditions.
Using Statically Computed Invariants Inside the Predicate Abstraction and Refinement Loop Himanshu Jain Franjo Ivančić Aarti Gupta Ilya Shlyakhter Chao.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
Discrete Abstractions of Hybrid Systems Rajeev Alur, Thomas A. Henzinger, Gerardo Lafferriere and George J. Pappas.
Abstractions. Outline Informal intuition Why do we need abstraction? What is an abstraction and what is not an abstraction A framework for abstractions.
Solving Partial Order Constraints for LPO termination.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
Witness and Counterexample Li Tan Oct. 15, 2002.
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
Efficient Reachability Checking using Sequential SAT G. Parthasarathy, M. K. Iyer, K.-T.Cheng, Li. C. Wang Department of ECE University of California –
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
Review of the automata-theoretic approach to model-checking.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Completeness and Complexity of Bounded Model Checking.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
Witness and Counterexample Li Tan Oct. 15, 2002.
Word Level Predicate Abstraction and Refinement for Verifying RTL Verilog Himanshu Jain Daniel Kroening Natasha Sharygina Edmund Clarke Carnegie Mellon.
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.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
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.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
7/13/2003BMC A SAT-Based Approach to Abstraction Refinement in Model Checking Bing Li, Chao Wang and Fabio Somenzi University of Colorado at Boulder.
1 2. Independence and Bernoulli Trials Independence: Events A and B are independent if It is easy to show that A, B independent implies are all independent.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
Yang Liu, Jun Sun and Jin Song Dong School of Computing National University of Singapore.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Incremental formal verification of hardware Hana Chockler Alexander Ivrii Arie Matsliah Shiri Moran Ziv Nevo IBM Research - Haifa.
1 Bisimulations as a Technique for State Space Reductions.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
Verification & Validation By: Amir Masoud Gharehbaghi
Properties Incompleteness Evaluation by Functional Verification IEEE TRANSACTIONS ON COMPUTERS, VOL. 56, NO. 4, APRIL
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Variants of LTL Query Checking Hana ChocklerArie Gurfinkel Ofer Strichman IBM Research SEI Technion Technion - Israel Institute of Technology.
Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable Software.
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
1 Computing Abstractions by integrating BDDs and SMT Solvers Alessandro Cimatti Fondazione Bruno Kessler, Trento, Italy Joint work with R. Cavada, A. Franzen,
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Hybrid BDD and All-SAT Method for Model Checking
Hardware Verification
Property Directed Reachability with Word-Level Abstraction
Over-Approximating Boolean Programs with Unbounded Thread Creation
Discrete Controller Synthesis
Scalability in Model Checking
Predicate Abstraction
SAT Based Abstraction/Refinement in Model-Checking
Presentation transcript:

Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02) revisions by M. Roveri, R. Sebastiani and S. Tonetta

2 Outline Preliminaries Notion of Abstraction Over and under-approximation, simulation, bisimulation Counter-example based abstraction refinement

3 Model Checking Given a: Finite transition system M (S, I, R, L) A temporal property p The model checking problem: Does M satisfy p ?

4 Model Checking Temporal properties: “Always when a train arrives the bar is not up” G (train_arriving  !bar_up) “Every Send is followed immediately by Ack” G(Send  X Ack) “Reset can always be reached” GF Reset “From some point on, always switch_on” FG switch_on “Safety” properties “Liveness” properties

5 Model Checking (safety) I Add reachable states until reaching a fixed-point = bad state

6 Model Checking (safety) I PROBLEM: Too many states to handle ! = bad state

7 Abstraction hhhhh Abstraction Function h : S ! S’ S S’

8 Abstraction Function Partition variables into visible( V ) and invisible( I ) variables. The abstract model consists of V variables. I variables are made inputs. The abstraction function maps each state to its projection over V.

9 Abstraction Function x1 x2 x3 x4 0 h x1 x2 Group concrete states with identical visible part to a single abstract state.

10 Building an Abstract Model M’ can be computed efficiently if M is in functional form, e.g. sequential circuits. Abstract x1 x2 x3 x4 x1 x2 i1 i2 i1 i2 x3 x4

11 Building an Abstract Model (cont.) next(x1) = f1(x1,x2,x3,x4,i1,i2); next(x2) = f2(x1,x2,x3,x4,i1,i2); next(x3) = f3(x1,x2,x3,x4,i1,i2); next(x4) = f4(x1,x2,x3,x4,i1,i2); next(x1) = f1(x1,x2,x3,x4,i1,i2); next(x2) = f2(x1,x2,x3,x4,i1,i2); abstract

12 Computing Abstractions S – concrete state space S’ – abstract state space  : S → S’ - abstraction  : S’ → 2 S :  (s’) = {s | s’=h(s)} - concretization (refinement) Properties of  and  :  (  (A)) = A, for A in S’  (  (B)) ⊇ B, for B in S The above properties mean that  and  are Galois-connected SS’  

13 Aside: simulations M = (s 0, S, R, L) M’ = (t 0, S’, R’, L’) Definition: p is a simulation between M and M’ if 1. (s 0, t 0 )  p 2.  (t, t 1 )  R’  (s, s 1 )  R s.t. (s, t)  p and (s 1, t 1 )  p (We say that M simulates M’.) Intuitively, for every transition in M’ there is a corresponding transition in M

14 Aside: bisimulation M = (s 0, S, R, L) M’ = (t 0, S’, R’, L’) Definition: p is a bisimulation between M and M’ if 1. p is a simulation between M and M’ and 2. p is a simulation between M’ and M

15 Existential Abstraction (Over- Approximation): M’ simulates M I I

16 Model Checking Abstract Model Preservation Theorem M’ ⊨ φ  M ⊨ φ Intuition: if M has a countermodel,M’ simulates it The counterexample may be spurious The converse does not hold M’ ⊭ φ  M ⊭ φ Let φ be a universally-quantified property (i.e., expressed in LTL or ACTL) and M’ simulates M

17 Universal Abstraction (Under- Approximation): M simulates M’ I I

18 Model Checking Abstract Model Preservation Theorem M’ ⊨ φ  M ⊨ φ Intuition: if M’ has a model, M simulates it Converse does not hold M’ ⊭ φ  M ⊭ φ Let φ be a existential-quantified property (i.e., expressed in ECTL) and M simulates M’

19 Model Checking Abstract Model M = (s 0, S, R, L) and M’ = (t 0, S’, R’, L’) related by bisimulation Then, for every CTL/LTL property φ: M’ ⊨ φ  M ⊨ φ M’ ⊭ φ  M ⊭ φ

20 Our specific problem Preservation Theorem M’ ⊨ φ  M ⊨ φ Converse does not hold M’ ⊭ φ  M ⊭ φ Counter-examples may be spurious Let φ be a universally-quantified property (i.e., expressed in LTL or ACTL) and M’ simulates M

21 Checking the Counterexample Counterexample : (c 1, …,c m ) Each c i is an assignment to V. Simulate the counterexample on the concrete model.

22 Checking the Counterexample Concrete traces corresponding to the counterexample (c1, …,cm): (Initial State) (Unrolled Transition Relation) (Restriction of V to Counterexample)

23 Abstraction-Refinement Loop Check Counterexample Refine Model CheckAbstract M’, pM, p, h No Bug Pass Fail Bug Real Spurious h’

24 Refinement methods… P Frontier Inputs Invisible Visible (R. Kurshan, 80’s) Localization

25 Generate all counterexamples. Prioritize variables according to their consistency in the counterexamples. X1 x2 x3 x4 (Glusman et al., 2002) Intel’s refinement heuristic Refinement methods…

26 Simulate counterexample on concrete model with SAT If the instance is unsatisfiable, analyze conflict Make visible one of the variables in the clauses that lead to the conflict (Chauhan, Clarke, Kukula, Sapra, Veith, Wang, FMCAD 2002) Abstraction/refinement with conflict analysis Refinement methods…

27 Why spurious counterexample? I I Deadend states Bad States Failure State f

28 Refinement Problem: Deadend and Bad States are in the same abstract state. Solution: Refine abstraction function. The sets of Deadend and Bad states should be separated into different abstract states.  D to represent the set of Deadend states  B to represent the set of Bad states

29 Refinement h’ Refinement : h’ h’

30 Refinement Deadend States Let f be the maximum value by which the following formula is satisfiable:

31 Refinement Deadend States Bad States

32 Refinement as Separation The state separation problem Input: Sets D, B of states (assignments) Output: U (minimal) subset of I s.t.:  d  D,  b  B,  u  U. d(u)  b(u) The refinement h’ is obtained by adding U to V.

33 Refinement as Separation d1d1 b1b1 b2b2 I V Refinement : Find subset U of I that separates between all pairs of deadend and bad states. Make them visible. Keep U small !

34 Refinement as Separation d1d1 b1b1 b2b I V Refinement : Find subset U of I that separates between all pairs of deadend and bad states. Make them visible. Keep U small !

35 Two separation methods ILP-based separation Minimal separating set. Computationally expensive. Decision Tree Learning based separation. Not optimal. Polynomial.

36 Separation with Decision Tree learning (Example) Separating Set : {v 1,v 2,v 4 } DB BDBD 1001 b1b1 d2d2 d1d1 b2b2 v1v1 v4v4 v2v2 01 {d1,b2}{d1,b2}{d2,b1}{d2,b1} DBDB Classification:

37 Separation with 0-1 ILP One constraint per pair of states. v i = 1 iff v i is in the separating set.

38 Separation with 0-1 ILP (Example)

39 Refinement as Learning For systems of realistic size Not possible to generate D and B. Expensive to separate D and B. Solution: Sample D and B Infer separating variables from the samples. The method is still complete: counterexample will eventually be eliminated.

40 Efficient Sampling DB db Let  (D,B) be the smallest separating set of D and B. Q: Can we find it without deriving D and B ? A: Search for smallest d,b such that  (d,b) =  (D,B)

41 Efficient Sampling Direct search towards samples that contain more information. How? Find samples not separated by the current separating set (Sep).

42 Efficient Sampling Recall:  D characterizes the deadend states  B characterizes the bad states  D  B is unsatisfiable Samples that agree on the sep variables: Rename all v i  B to v i ’

43 Efficient Sampling Sep = {} d,b = {} Run SAT solver on  (Sep) STOP unsat Compute Sep:=  (d,b) Add samples to d and b sat Sep is the minimal separating set of D and B

44 The Tool NuSMV Cadence SMV MC Chaff SAT LpSolve Dec Tree Sep

45 Results Property 1

46 Results Property 2 Efficient Sampling together with Decision Tree Learning performs best. Machine Learning techniques are useful in computing good refinements.

47 Current trends (3/3) (Chauhan, Clarke, Kukula, Sapra, Veith, Wang, FMCAD 2002) Abstraction/refinement with conflict analysis

48 The End