ECE 667 - Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.

Slides:



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

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Metodi formali dello sviluppo software a.a.2013/2014 Prof.Anna Labella.
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
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.
Partial Order Reduction: Main Idea
1 Computation Tree Logic (CTL). 2 CTL Syntax P - a set of atomic propositions, every p  P is a CTL formula. f, g, CTL formulae, then so are  f, f 
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.
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.
François Fages MPRI Bio-info 2006 Formal Biology of the Cell Modeling, Computing and Reasoning with Constraints François Fages, Constraints Group, INRIA.
Temporal Logic and the NuSMV Model Checker CS 680 Formal Methods Jeremy Johnson.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
CS6133 Software Specification and Verification
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
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.
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.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: Property checking Property 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:
1 Temporal Logic u Classical logic:  Good for describing static conditions u Temporal logic:  Adds temporal operators  Describe how static conditions.
 2001 CiesielskiFormal Verification1 FORMAL METHODS IN HARDWARE VERIFICATION Maciej Ciesielski Dept. of Electrical & Computer Engineering University.
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
© Katz, 2007CS Formal SpecificationsLecture - Temporal logic 1 Temporal Logic Formal Specifications CS Shmuel Katz The Technion.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Temporal Logic and Model Checking. Reactive Systems We often classify systems into two types: Transformational: functions from inputs available at the.
ECE Synthesis & Verification - L211 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Verification Equivalence checking.
Review of the automata-theoretic approach to model-checking.
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems FSM Traversal.
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.
Witness and Counterexample Li Tan Oct. 15, 2002.
ECE Synthesis & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina 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.
1 Temporal Logic-Overview FM Temporal Logic u Classical logic: Good for describing static conditions u Temporal logic: Adds temporal operators Describe.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
15-820A 1 LTL to Büchi Automata Flavio Lerda A 2 LTL to Büchi Automata LTL Formulas Subset of CTL* –Distinct from CTL AFG p  LTL  f  CTL. f.
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
Automatic Verification of Finite-State Concurrent Systems Using Temporal Logic Specifications 1.
Algorithmic Software Verification V &VI. Binary decision diagrams.
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
Verification & Validation By: Amir Masoud Gharehbaghi
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Bounded Model Checking A. Biere, A. Cimatti, E. Clarke, Y. Zhu, Symbolic Model Checking without BDDs, TACAS’99 Presented by Daniel Choi Provable 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.
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
CIS 842: Specification and Verification of Reactive Systems
CSCI1600: Embedded and Real Time Software
Automatic Verification of Industrial Designs
Chapter 4: Model Checking of Finite State Systems
Albert M. K. Cheng Real-Time Systems Laboratory University of Houston
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Formal Methods in software development
Introduction to BDDs.
Introduction to verification
Formal Methods in software development
10 Design Verification and Test
Presentation transcript:

ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics

ECE Synthesis & Verification - L272 Model Checking Algorithmic method of verifying correctness of (finite state) concurrent systems against temporal logic specifications –A practical approach to formal verification Basic idea –System is described in a formal model derived from high level design (HDL, C), circuit structure, etc. –The desired behavior is expressed as a set of properties expressed as temporal logic specification –The specification is checked against the model

ECE Synthesis & Verification - L273 Model Checking How does it work –System is modeled as a state transition structure (Kripke structure) –Specification is expressed in propositional temporal logic (CTL formula) asserts how system behavior evolves over time –Efficient search procedure checks the transition system to see if it satisfies the specification

ECE Synthesis & Verification - L274 Model Checking Characteristics –searches the entire solution space –always terminates with YES or NO –relatively easy, can be done by experienced designers –widely used in industry –can be automated Challenges –state space explosion – use symbolic methods, BDDs History –Clark, Emerson [1981] USA –Quielle, Sifakis [1980’s] France

ECE Synthesis & Verification - L275 Model Checking - Tasks Modeling –converts a design into a formalism: state transition system Specification –state the properties that the design must satisfy –use logical formalism: temporal logic asserts how system behavior evolves over time Verification –automated procedure (algorithm)

ECE Synthesis & Verification - L276 Model Checking - Issues Completeness –model checking is effective for a given property –impossible to guarantee that the specification covers all properties the system should satisfy –writing the specification - responsibility of the user Negative results –incorrect model –incorrect specification (false negative) –failure to complete the check (too large)

ECE Synthesis & Verification - L277 Model Checking - Basics State transition structure M(S,R,L) (Kripke structure) S = finite set of states {s 1, s 2, … s n } R = transition relation L = set of labels assigned to states, so that L(s) = f if state s has property f All properties are composed of atomic propositions (basic properties), e.g. the light is green, the door is open, etc. –L(s) is a subset of all atomic propositions true in state s Label (property ) s3s3 s1s1 s2s2 a b ac

ECE Synthesis & Verification - L278 Temporal Logic Formalism describing sequences of transitions Time is not mentioned explicitly The temporal operators used to express temporal properties –eventually –never –always Temporal logic formulas are evaluated w.r.to a state in the model Temporal operators can be combined with Boolean expressions

ECE Synthesis & Verification - L279 Computation Trees State transition structure (Kripke Model) Infinite computation tree for initial state s 1 a b a ac s1s1 s3s3 s1s1 s2s2 a b

ECE Synthesis & Verification - L2710 CTL – Computation Tree Logic Path quantifiers - describe branching structure of the tree –A (for all computation paths) –E (for some computation path = there exists a path) Temporal operators - describe properties of a path through the tree –X (next time, next state) –F (eventually, finally) –G (always, globally) –U (until) –R (release, dual of U)

ECE Synthesis & Verification - L2711 CTL Formulas Temporal logic formulas are evaluated w.r.to a state in the model State formulas –apply to a specific state Path formulas –apply to all states along a specific path

ECE Synthesis & Verification - L2712 Basic CTL Formulas E X (f) –true in state s if f is true in some successor of s (there exists a next state of s for which f holds) A X (f) –true in state s if f is true for all successors of s (for all next states of s f is true) E G (f) – true in s if f holds in every state along some path emanating from s (there exists a path ….) A G (f) –true in s if f holds in every state along all paths emanating from s (for all paths ….globally )

ECE Synthesis & Verification - L2713 Basic CTL Formulas - cont ’d E F (g) –there exists a path which eventually contains a state in which g is true A F (g) –for all paths, eventually there is state in which g holds E F, A F are special case of E [f U g], A [f U g] –E F (g) = E [ true U g ], A F (g) = A [ true U g ] f U g (f until g) –true if there is a state in the path where g holds, and at every previous state f holds

ECE Synthesis & Verification - L2714 CTL Operators - examples s o |= E F g g soso soso g g g s o |= A F g s o |= E G g gsoso g g s o |= A G g soso g g g g gg

ECE Synthesis & Verification - L2715 Basic CTL Formulas - cont ’d Full set of operators –Boolean: ¬, , , ,  –temporal:E, A, X, F, G, U, R Minimal set sufficient to express any CTL formula –Boolean:¬,  –temporal:E, X, U Examples: f  g = ¬(¬f  ¬g), F f = true U f, A (f ) = ¬E(¬f )

ECE Synthesis & Verification - L2716 Typical CTL Formulas E F ( start  ¬ ready ) –eventually a state is reached where start holds and ready does not hold A G ( req  A F ack ) –any time request occurs, it will be eventually acknowledged A G ( E F restart ) –from any state it is possible to get to the restart state

ECE Synthesis & Verification - L2717 Model Checking – Explicit Algorithm Problem: given a structure M(S,R,L) and a temporal logic formula f, find a set of states that satisfy f {s  S: M,s |= f } Explicit algorithm: label each state s with the set label(s) of sub-formulas of f which are true in s. 1.i = 0; label(s) = L(s) 2.i = i + 1; Process formulas with (i -1) nested CTL operators. Add the processed formulas to the labeling of each state in which it is true. 3.Continue until closure. Result: M,s |= f iff f  label (s)

ECE Synthesis & Verification - L2718 Explicit Algorithm - cont’d To check for arbitrary CTL formula f –successively apply the state labeling algorithm to the sub-formulas –start with the shortest, most deeply nested –work outwards Example: E F ¬ (g  h ) T1 = states in which g and h are true T2 = complement of T1 T3 = predecessor states to T2

ECE Synthesis & Verification - L2719 Model Checking Example Traffic light controller (simplified) R1 G2 Y1 R2 G1 R2 R1 Y2 C ’+ T ’ C T C T ’ C ’+ T C = car sensor T = timer G1 R2 Y1 R2 R1 G2 G1 R2 Y1 R2 R1 G2 R1 Y2 R1 G2 G1 R2R1 Y2R1 G2 R1 Y2 G2 Y2 R2 G1 Y1 R1 C C Timer T sensor Road 2 Road 1

ECE Synthesis & Verification - L2720 Traffic light controller - Model Checking Model Checking task: check – safety condition – fairness conditions Safety condition: no green lights on both roads at the same time A G ¬ (G1  G2 ) Fairness condition: eventually one road has green light E F (G1  G2) R1 G2 Y1 R2 G1 R2 R1 Y2 C ’+T ’ C T C T ’ C ’+T

ECE Synthesis & Verification - L2721 Checking the Safety Condition A G ¬ (G1  G2) = ¬ E F (G1  G2) S(G1  G2 ) = S(G1)  S(G2) = {1}  {3} =  S(EF (G1  G2 )) =  S(¬ EF (G1  G2 )) = ¬  = {1, 2, 3, 4} Each state is included in {1,2,3,4}  the safety condition is true (for each state) 2 R1 G2 Y1 R2 G1 R2 R1 Y

ECE Synthesis & Verification - L2722 Checking the Fairness Condition E F (G1  G2 ) = E(true U (G1  G2 ) ) S(G1  G2 ) = S(G1)  S(G2) = {1}  {3} = {1,3} S(EF (G1  G2 )) = {1,2,3,4} (going backward from {1,3}, find predecessors) Since {1,2,3,4} contains all states, the condition is true for all the states

ECE Synthesis & Verification - L2723 Another Check E X 2 (Y1) = E X (E X (Y1)) (starting at S 1 =G1R2, isthere a path s.t. Y1 is true in 2 steps ?) S (Y1) = {2} S (EX (Y1)) = {1} (predecessor of 2) S (EX (EX(Y1)) = {1,4} (predecessors of 1) R1 G2 Y1 R2 G1 R2 R1 Y Property E X 2 (Y1) is true for states {1,4}, hence true

ECE Synthesis & Verification - L2724 Symbolic Model Checking Symbolic –operates on entire sets rather than individual states Uses BDD for efficient representation –represent Kripke structure –manipulate Boolean formulas RESTRICT and APPLY logic operators Quantification operators –Existential:  x f = f | x=0 + f | x=1 (smoothing) –Universal:  x f = f | x=0 f | x=1 (consensus)

ECE Synthesis & Verification - L2725 Symbolic Model Checking - example Traffic Light Controller Encode the atomic propositions (G1,R1,Y1, G2,Y2,R2): use [a b c d] for present state, [v x y z] for next state a b c d G Y R G Y R R1 G2 Y1 R2 G1 R2 R1 Y2 s1 s3 s4 s

ECE Synthesis & Verification - L2726 Example - cont’d Represent the set of states as Boolean formula Q: Q = abcd’ + a’bcd’ + ab’cd + ab’c’d R1 G2 Y1 R2 G1 R2 R1 Y2 s1 s3 s4 s Store Q in a BDD (It will be used to perform logic operations, such as S(G1)  S(G2)

ECE Synthesis & Verification - L2727 Example - cont’d Write a characteristic function R for the transition relation R =abcd’vxyz’ + abcd’v’xyz’ + … + ab’c’dvxyz’ (6 terms) R1 G2 Y1 R2 G1 R2 R1 Y2 s1 s3 s4 s abcd vxyz R Store R in a BDD. It will be used for Pre-Image computation for EF.

ECE Synthesis & Verification - L2728 Example - Fairness Condition Check fairness condition: E F (G1  G2 ) Step 1: compute S(G1), S(G2) using RESTRICT operator –S(G1): ab·Restrict Q(G1) = ab Q| ab = abcd’ = {s1} –S(G2): cd·Restrict Q(G2) = cd Q| cd = ab’cd = {s3} Step 2: compute S(G1)  S(G2 ) using APPLY operator –Construct BDD for (abcd’ + ab’cd) = {s1, s3}, set of states labeled with G1 or G2

ECE Synthesis & Verification - L2729 Example – cont’d  s’ {s1’,s3’} R(s,s’) ) = =  vxyz (vxyz’ + vx’yz) R(a,b,c,d;v,x,y,z) =  vxyz (abcd’vxyz’ + a’bcdvx’yz + ab’cdvx’yz + ab’c’dvxyz’) = (abcd’ + a’bcd + ab’cd + ab’c’d) = {s1, s2, s3, s4} Compare to the result of explicit algoritm  Step 3: compute S(EF (G1  G2 )) using Pre-Image computation (quanitfy w.r.to next state variables) Recall: R = abcd’vxyz’ + abcd’v’xyz’+ … + ab’c’dvxyz’

ECE Synthesis & Verification - L2730 Example – Interpretation Pre-Img(s1’,s3’,R) eliminates those transitions which do not reach {s1,s3} R1 G2 Y1 R2 G1 R2 R1 Y2 s1 s3 s4 s abcd vxyz R X X Quantification w.r.to next state variables (v,x,y,z) gives the encoded present states {s1,s2,s3,s4}