Edmund M. Clarke School of Computer Science Carnegie Mellon University Lecture 2: Model Checking My 30 Year Quest to Conquer the State Explosion Problem.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

The Quest for Correctness Joseph Sifakis VERIMAG Laboratory 2nd Sogeti Testing Academy April 29th 2009.
Abstraction in Model Checking Nishant Sinha. Model Checking Given a: –Finite transition system M –A temporal property p The model checking problem: –Does.
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.
SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
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.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
François Fages MPRI Bio-info 2006 Formal Biology of the Cell Modeling, Computing and Reasoning with Constraints François Fages, Constraints Group, INRIA.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
Timed Automata.
Model Checking : Making Automatic Formal Verification Scale Shaz Qadeer EECS Department University of California at Berkeley.
Verification of Hybrid Systems An Assessment of Current Techniques Holly Bowen.
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.
Thomas Ball, Rupak Majumdar, Todd Millstein, Sriram K. Rajamani Presented by Yifan Li November 22nd In PLDI 01: Programming Language.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Edmund M. Clarke School of Computer Science Carnegie Mellon University Model Checking and the Verification of Computer Systems.
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:
Demonstration Of SPIN By Mitra Purandare
1 Temporal Logic u Classical logic:  Good for describing static conditions u Temporal logic:  Adds temporal operators  Describe how static conditions.
CSEP590 – Model Checking and Software Verification University of Washington Department of Computer Science and Engineering Summer 2003.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
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.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Formal verification Marco A. Peña Universitat Politècnica de Catalunya.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
Model Checking for Embedded Systems Edmund Clarke, CMU High-Confidence Embedded Systems Workshop, May 1 st.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Model Checking My 27 year quest to overcome the state explosion problem Edmund Clarke Computer Science Department Computer Science Department Carnegie.
1 Carnegie Mellon UniversitySPINFlavio Lerda Bug Catching SPIN An explicit state model checker.
MCAI 2.0 Model Checking in Ten Minutes Edmund Clarke School of Computer Science Carnegie Mellon University.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University.
Lecture 1: Model Checking
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
10/19/2015COSC , Lecture 171 Real-Time Systems, COSC , Lecture 17 Stefan Andrei.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
Verification & Validation By: Amir Masoud Gharehbaghi
Reachability for Linear Hybrid Automata Using Iterative Relaxation Abstraction Sumit K. Jha, Bruce H. Krogh, James E. Weimer, Edmund M. Clarke Carnegie.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable Software.
Writing, Verifying and Exploiting Formal Specifications for Hardware Designs Chapter 3: Verifying a Specification Presenter: Scott Crosby.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
Model Checking Lecture 2 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Basic concepts of Model Checking
Formal methods: Lecture
CIS 842: Specification and Verification of Reactive Systems
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Introduction to verification
Predicate Abstraction
Presentation transcript:

Edmund M. Clarke School of Computer Science Carnegie Mellon University Lecture 2: Model Checking My 30 Year Quest to Conquer the State Explosion Problem

Intel Pentium FDIV Bug  Try – / * In 94’ Pentium, it doesn’t return 0, but 256.  Intel uses the SRT algorithm for floating point division. Five entries in the lookup table are missing.  Cost: $400 - $500 million  Xudong Zhao’s Thesis on Word Level Model Checking

Temporal Logic Model Checking automatic verification technique  Model checking is an automatic verification technique for finite state concurrent systems. Clarke and Emerson Queille and Sifakis  Developed independently by Clarke and Emerson and by Queille and Sifakis in early 1980’s.  Specificationspropositional temporal logic  Specifications are written in propositional temporal logic. (Pnueli 77) intelligent exhaustive search of the state space  Verification procedure is an intelligent exhaustive search of the state space of the design.

Advantages of Model Checking  No proofs!!! (Algorithmic rather than Deductive)  Fast (compared to other rigorous methods such as theorem proving)  Diagnostic counterexamples  No problem with partial specifications  Logics can easily express many concurrency properties

Main Disadvantage State Explosion Problem: 2-bit counter 0,0 0,1 1,1 1,0 n-bit counter has 2 n states

1 2 3 a b c || n states, m processes 1,a 2,a 1,b 2,b 3,a 1,c 3,b 2,c 3,c n m states Main Disadvantage (Cont.)

State Explosion Problem: Unavoidable in worst case, but steady progress over the past 28 years using clever algorithms, data structures, and engineering Main Disadvantage (Cont.)

Determines Patterns on Infinite Traces Atomic Propositions Boolean Operations Temporal operators a“a is true now” X a FaF GaG a U bU a “a is true now” X a “a is true in the neXt state” Fa “a will be true in the Future” Ga “a will be Globally true in the future” a U b “a will hold true Until b becomes true” LTL - Linear Time Logic (Pn 77) a

Determines Patterns on Infinite Traces Atomic Propositions Boolean Operations Temporal operators a X a“a is true in the neXt state” FaF GaG a U bU a “a is true now” X a “a is true in the neXt state” Fa “a will be true in the Future” Ga “a will be Globally true in the future” a U b “a will hold true Until b becomes true” LTL - Linear Time Logic (Pn 77) a

Determines Patterns on Infinite Traces Atomic Propositions Boolean Operations Temporal operators a X aX Fa“a will be true in the Future” GaG a U bU a “a is true now” X a “a is true in the neXt state” Fa “a will be true in the Future” Ga “a will be Globally true in the future” a U b “a will hold true Until b becomes true” LTL - Linear Time Logic (Pn 77) a

Determines Patterns on Infinite Traces Atomic Propositions Boolean Operations Temporal operators a X aX FaF Ga“a will be Globally true in the future” a U bU a “a is true now” X a “a is true in the neXt state” Fa “a will be true in the Future” Ga “a will be Globally true in the future” a U b “a will hold true Until b becomes true” LTL - Linear Time Logic (Pn 77) aaaaa

Determines Patterns on Infinite Traces Atomic Propositions Boolean Operations Temporal operators a X aX FaF GaG a U b“a will hold true Until b becomes true” a “a is true now” X a “a is true in the neXt state” Fa “a will be true in the Future” Ga “a will be Globally true in the future” a U b “a will hold true Until b becomes true” LTL - Linear Time Logic (Pn 77) aaaab

Branching Time (EC 80, BMP 81)

CTL: Computation Tree Logic EF g“g will possibly become true”

CTL: Computation Tree Logic AF g“g will necessarily become true”

CTL: Computation Tree Logic AG g“g is an invariant”

CTL: Computation Tree Logic EG g“g is a potential invariant”

CTL: Computation Tree Logic CTL (CES83-86) uses the temporal operators AX, AG, AF, AU EX, EG, EF, EU CTL* CTL* allows complex nestings such as AXX, AGX, EXF,...

Model Checking Problem Mstate-transition graph  Let M be a state-transition graph. ƒspecification  Let ƒ be the specification in temporal logic. sMM, s |= ƒ  Find all states s of M such that M, s |= ƒ. CTL Model Checking: CE 81; CES 83/86; QS 81/82. CTL Model Checking: CE 81; CES 83/86; QS 81/82. LTL Model Checking: LP 85. LTL Model Checking: LP 85. Automata Theoretic LTL Model Checking: VW 86. Automata Theoretic LTL Model Checking: VW 86. CTL* Model Checking: EL 85. CTL* Model Checking: EL 85.

State-transition graph describes system evolving over time. Trivial Example ~ Start ~ Close ~ Heat ~ Error Start ~ Close ~ Heat Error ~ Start Close ~ Heat ~ Error ~ Start Close Heat ~ Error Start Close Heat ~ Error Start Close ~ Heat ~ Error Start Close ~ Heat Error Microwave Oven

Temporal Logic and Model Checking heat updoor is closed  The oven doesn’t heat up until the door is closed.  Notheat_upuntildoor_closed  Not heat_up holds until door_closed ~heat_upU door_closed  (~ heat_up) U door_closed

Transition System (Automaton, Kripke structure) Hardware Description (VERILOG, VHDL, SMV) Informal Specification Temporal Logic Formula (CTL, LTL, etc.) compilation manual algorithmic verification Model Checking

Transition System Informal Specification Temporal Logic Formula (CTL, LTL, etc.) Safety Property: bad state unreachable: satisfied Initial State Counterexamples Program or circuit

Transition System Program or circuit Informal Specification Temporal Logic Formula (CTL, LTL, etc.) Initial State Safety Property: bad state unreachable Counterexample Counterexamples

Transition System Program or circuit Informal Specification Temporal Logic Formula (CTL, LTL, etc.) Initial State Safety Property: bad state unreachable Counterexamples Counterexample

Hardware Example: IEEE Futurebus + IEEE Future+ cache coherence protocol.  In 1992 we used Model Checking to verify the IEEE Future+ cache coherence protocol. previously undetected errors  Found a number of previously undetected errors in the design. IEEE standard  First time that a formal verification tool was used to find errors in an IEEE standard  Development of the protocol began in 1988, but previous attempts to validate it were informal.

 Symbolic Model Checking Burch, Clarke, McMillan, Dill, and Hwang 90; Ken McMillan’s thesis 92   The Partial Order Reduction Valmari 90 Godefroid 90 Peled 94 (Gerard Holzmann’s SPIN) Four Big Breakthroughs on State Space Explosion Problem!

 BoundedModel Checking  Bounded Model Checking  Biere, Cimatti, Clarke, Zhu 99  Using Fast SAT solvers  Can handle thousands of state elements Can the given property fail in k-steps? I(V 0 ) Λ T(V 0,V 1 ) Λ … Λ T(V k-1,V k ) Λ ( ¬ P(V 0 ) V … V ¬ P(V k )) k-steps Property fails in some step Initial state BMC in practice: Circuit with 9510 latches, 9499 inputs BMC formula has 4 x 10 6 variables, 1.2 x 10 7 clauses Shortest bug of length 37 found in 69 seconds Four Big Breakthroughs on State Space Explosion Problem (Cont.)

 Localization Reduction  Bob Kurshan 1994  Counterexample Guided Abstraction Refinement (CEGAR)  Clarke, Grumberg, Jha, Lu, Veith 2000  Used in most software model checkers

Existential Abstraction M MM Given an abstraction function  : S  S , the concrete states are grouped and mapped into abstract states:  Preservation Theorem ?

Preservation Theorem  Theorem (Clarke, Grumberg, Long) abstract modelconcrete model  Theorem (Clarke, Grumberg, Long) If property holds on abstract model, it holds on concrete model  Technical conditions  Property is universal i.e., no existential quantifiers  Atomic formulas respect abstraction mapping  Converse implication is not true !

Spurious Behavior AGAF red “Every path necessarily leads back to red.” Spurious Counterexample:... “red” “go” Artifact of the abstraction !

Automatic Abstraction M Original Model Refinement MM Initial Abstraction Spurious counterexample Validation or Counterexample Correct !

CEGAR C ounter E xample- G uided A bstraction R efinement Circuit or Program InitialAbstraction Simulator No error or bug found Propertyholds Simulationsucessful Bug found Abstraction refinement Refinement Model CheckerVerification Spurious counterexample Counterexample Abstract Model

Future Challenge Is it possible to model check software? According to Wired News on Nov 10, 2005: When Bill Gates announced that the technology was under development at the 2002 Windows Engineering Conference, he called it the holy grail of computer science “When Bill Gates announced that the technology was under development at the 2002 Windows Engineering Conference, he called it the holy grail of computer science”

What Makes Software Model Checking Different ? int, float, string  Large/unbounded base types: int, float, string  User-defined types/classes  Pointers/aliasing + unbounded #’s of heap-allocated cells  Procedure calls/recursion/calls through pointers/dynamic method lookup/overloading  Concurrency + unbounded #’s of threads

What Makes Software Model Checking Different ?  Templates/generics/include files  Interrupts/exceptions/callbacks  Use of secondary storage: files, databases  Absent source code for: libraries, system calls, mobile code  Esoteric features: continuations, self-modifying code  Size (e.g., MS Word = 1.4 MLOC)

What Does It Mean to Model Check Software? 1.Combine static analysis and model checking Use static analysis to extract a model K from a boolean abstraction of the program. Use static analysis to extract a model K from a boolean abstraction of the program. Then check that f is true in K (K |= f), where f is the specification of the program. Then check that f is true in K (K |= f), where f is the specification of the program. SLAM (Microsoft) SLAM (Microsoft) Bandera (Kansas State) Bandera (Kansas State) MAGIC, SATABS (CMU) MAGIC, SATABS (CMU) BLAST (Berkeley) BLAST (Berkeley) F-Soft (NEC) F-Soft (NEC)

2.Simulate program along all paths in computation tree  Java PathFinder (NASA Ames)  Source code + backtracking (e.g., Verisoft)  Source code + symbolic execution + backtracking (e.g., MS/Intrinsa Prefix) 3.Use finite-state machine to look for patterns in control-flow graph [Engler] What Does It Mean to Model Check Software?

4.Design with Finite-State Software Models Finite state software models can act as “missing link” Finite state software models can act as “missing link” between transition graphs and complex software. between transition graphs and complex software.  Statecharts  Esterel What Does It Mean to Model Check Software?

5.Use Bounded Model Checking and SAT [Kroening]  Problem: How to compute set of reachable states? Fixpoint computation is too expensive.  Restrict search to states that are reachable from initial state within fixed number n of transitions  Implemented by unwinding program and using SAT solver What Does It Mean to Model Check Software?

Software Example: Device Driver Code Also according to Wired News : Model Checking “Microsoft has developed a tool called Static Device Verifier or SDV, that uses ‘Model Checking’ to analyze the source code for Windows drivers and see if the code that the programmer wrote matches a mathematical model of what a Windows device driver should do. If the driver doesn’t match the model, the SDV warns that the driver might contain a bug.” (Ball and Rajamani, Microsoft)

Future Challenge Can We Debug This Circuit? Kurt W. Kohn, Molecular Biology of the Cell 1999

P53, DNA Repair, and Apoptosis “The p53 pathway has been shown to mediate cellular stress responses; p53 can initiate DNA repair, cell-cycle arrest, senescence and, importantly, apoptosis. These responses have been implicated in an individual's ability to suppress tumor formation and to respond to many types of cancer therapy.” (A. Vazquez, E. Bond, A. Levine, G. Bond. The genetics of the p53 pathway, apoptosis and cancer therapy. Nat Rev Drug Discovery 2008 Dec;7(12): ) The protein p53 has been described as the guardian of the genome referring to its role in preventing genome mutation. In 1993, p53 was voted molecule of the year by Science Magazine.

New NSF Expedition Grant Next-Generation Model Checking and Abstract Interpretation with a Focus on Systems Biology and Embedded Systems 45

CMACS Strategic Plan Verification Nonlinear Systems Statistical Techniques Compositional Beyond Reachability Model Checking Abstract Interpretation CMACS Model Discovery Nonlinear Systems Stochastic Systems Hybrid Systems Reaction-Diffusion Challenge Problems Systems Biology Embedded Systems Atrial Fibrillation Onset Fly-by-Wire Control Software Automotive Distributed Control Abstraction Model Reduction Infinite-State Systems Time-Scale Analysis Spatio-Temporal Pancreatic Cancer Pathways 46

Jim Faeder, UPMC begin molecule types A(b,Y~U~P) B(a) end molecule types begin reaction rules A(b)+ B(a) A(b!1).B(a!1) A(Y~U) -> A(Y~P) end reaction rules Faeder JR, Blinov ML, Hlavacek WS Rule-Based Modeling of Biochemical Systems with BioNetGen. In Methods in Molecular Biology: Systems Biology, (2009). A b b Y U P B a a A b b B a a + A b b B a a A Y U A Y P The BioNetGen Language

Existing Approach: Manual Analysis Many simulation traces need to be carefully analyzed !

Model Checking Approach BioLab 2.0 Automated Analysis !

Bounded Linear Temporal Logic  Bounded Linear Temporal Logic (BLTL): Extension of LTL with time bounds on temporal operators.  Let σ = (s 0, t 0 ), (s 1, t 1 ),... be an execution of the model –along states s 0, s 1,... –the system stays in state s i for time t i  σ i : Execution trace starting at state i.  V(σ, i, x): Value of the variable x at the state s i.  A natural model for BioNetGen traces.

Bounded Linear Temporal Logic  Bounded Linear Temporal Logic (BLTL): Extension of LTL with time bounds on temporal operators.  Let σ = (s 0, t 0 ), (s 1, t 1 ),... be an execution of the model –along states s 0, s 1,... –the system stays in state s i for time t i  A natural model for BioNetGen traces.  Example: (Yeast Heterotrimec G Protein Cycle) does the G protein stay above 6000 for 2 time units and fall below 6000 before 20 time units?  G 2 ( GProtein > 6000 ) Λ F 20 ( GProtein < 6000 )

Semantics of BLTL The semantics of the timed Until operator:  “within time t, Φ 2 will be true and Φ 1 will hold until then ”  σ k : Execution trace starting at state k.  σ k Φ 1 U t Φ 2 iff there exists natural n such that 1) σ k+n Φ 2 2) Σ i<n t k+i ≤ t 3) for each 0 ≤ j < n, σ k+j Φ 1  In particular: F t Φ = true U t Φ, G t Φ = ¬F t ¬Φ

Semantics of BLTL The semantics of BLTL for a trace σ k :  σ k x ~ c iff V(σ, k, x) ~ c, where ~ is in {≤,≥,=}  σ k Φ 1 v Φ 2 iff σ k Φ 1 or σ k Φ 2  σ k ¬Φ iff σ k Φ does not hold  σ k Φ 1 U t Φ 2 iff there exists natural i such that 1) σ k+i Φ 2 2) Σ j<i t k+j ≤ t 3) for each 0 ≤ j < i, σ k+j Φ 1

Probabilistic Model Checking  Given a stochastic model such as –a Discrete or Continuous Markov Chain, or –a stochastic differential equation  a BLTL property and a probability threshold.  Does satisfy with probability at least ?  Numerical techniques compute precise probability of satisfying : –Does NOT scale to large systems.

Wait a minute! Isn’t Statistical Model Checking an oxymoron? I thought so for the first 28 years of my quest. Much easier to simulate a complex biological system than to build the transition relation for it. Moreover, we can bound the probability of error.

Statistical Model Checking  Decides between two mutually exclusive hypotheses: –Null Hypothesis –Alternate Hypothesis  Statistical tests can determine the true hypothesis: –based on sampling the traces of system –answer may be wrong, but error probability is bounded.  Statistical Hypothesis Testing Model Checking!

BioLab 2.0 Model Checking Biochemical Stochastic models: M ╞═ P ≥θ (Φ) ? Model M BioNetGen Statistical Model Checker BLTL formula Φ BLTL to Monitor compiler Formula monitor M ╞═ P ≥θ (Φ) Statistical Test Statistical Test M ╞═ P ≥θ (Φ)

Motivation - Scalability  State Space Exploration often infeasible for complex systems. –May be relatively easy to simulate a system  Our Goal: Provide probabilistic guarantees using fewer simulations –How to generate each simulation run? –How many simulation runs to generate?  Applications: BioNetGen, Stateflow / Simulink BioLab: A Statistical Model Checker for BioNetGen Models. E. Clarke, C. Langmead, J. Faeder, L. Harris, A. Legay and S. Jha. (International Conference on Computational Methods in System Biology, 2008)

Motivation – Parallel Model Checking Some success with explicit state Model Checking More difficult to distribute Symbolic MC using BDDs. Learned Clauses in SAT solving are not easy to distribute. Multiple simulations can be easily parallelized. Next Generation Model Checking should exploit multiple cores commodity clusters

Existing Work  [Younes and Simmons 02-06] use Wald’s SPRT  SPRT: Sequential Probability Ratio Test  [Hérault et al. 04] use Chernoff bound:  Estimate the probability that M ╞═ Φ  [Sen et al ] use p-value:  Approximates the probability that the null hypothesis M ╞═ P ≥θ (Φ) is true  [Clarke et al. 09] Bayesian approach  Both hypothesis testing and estimation  Faster (fewer samples required)

The End Questions?