How CTL model checking works

Slides:



Advertisements
Similar presentations
Model Checking Lecture 4. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Advertisements

Introduction to Model Checking
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.
BDDs & Theorem Proving Binary Decision Diagrams Dr. Eng. Amr T. Abdel-Hamid NETW 703 Winter 2012 Network Protocols Lectures are based on slides by: K.
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 
Planning based on Model Checking Dept. of Information Systems and Applied CS Bamberg University Seminar Paper Svetlana Balinova.
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.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
CS357: CTL Model Checking (combined notes from lectures 11/5 and 11/7) David Dill 1.
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.
CS 267: Automated Verification Lecture 7: SMV Symbolic Model Checker, Partitioned Transition Systems, Counter-example Generation in Symbolic Model Checking.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
Spring 07, Feb 13 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Binary Decision Diagrams Vishwani D. Agrawal James.
ECE Synthesis & Verification - Lecture 18 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Word-level.
A New Approach to Structural Analysis and Transformation of Networks Alan Mishchenko November 29, 1999.
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 16, 2003.
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 & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
ECE 667 Synthesis & Verification - BDD 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Binary Decision Diagrams (BDD)
ENGG3190 Logic Synthesis “Binary Decision Diagrams” BDDs Winter 2014 S. Areibi School of Engineering University of Guelph.
IT University of Copenhagen Lecture 8: Binary Decision Diagrams 1. Classical Boolean expression representations 2. If-then-else Normal Form (INF) 3. Binary.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Claus Brabrand, ITU, Denmark DATA-FLOW ANALYSISMar 25, 2009 Static Analysis: Data-Flow Analysis II Claus Brabrand IT University of Copenhagen (
Claus Brabrand, UFPE, Brazil Aug 09, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
A Simple Model Checker for CTL. The problem n We need efficient algorithms to solve the problems [1]M,s  [2]M,s  where M should have finitely many states,
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
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)
Model Checking Lecture 4 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
CS 267: Automated Verification Lecture 6: Binary Decision Diagrams Instructor: Tevfik Bultan.
Algorithmic Software Verification V &VI. Binary decision diagrams.
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.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Introduction to Model Checking
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 05/06 Universität Dortmund Validation - Formal verification -
1 Verification of FSM Equivalence Goal: Verify that two sequential circuit implementations always produce the same sequence of outputs given the same sequence.
Verifying Programs with BDDs Topics Representing Boolean functions with Binary Decision Diagrams Application to program verification class-bdd.ppt
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
BDDs1 Binary Tree Representation The recursive Shannon expansion corresponds to a binary tree Example: Each path from the root to a leaf corresponds to.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
IT 60101: Lecture #121 Foundation of Computing Systems Lecture 13 Trees: Part VIII.
Basic concepts of Model Checking
CTL model checking algorithms
CIS 842: Specification and Verification of Reactive Systems
Planning as model checking, (OBDDs)
SS 2017 Software Verification CTL model checking, BDDs
Binary Decision Diagrams
Automatic Verification of Industrial Designs
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
Formal Methods in software development
A logic function f in n inputs x1, x2, ...xn and
Program correctness SAT and its correctness
A logic function f in n inputs x1, x2, ...xn and
Verifying Programs with BDDs Sept. 22, 2006
Model Checking CS 680 Formal Methods Jeremy Johnson.
Program correctness Model-checking CTL
ECE 667 Synthesis and Verification of Digital Systems
Presentation transcript:

How CTL model checking works Model Checking II How CTL model checking works

CTL A E X F G U Model checking problem Determine M, s0 f Or find all s s.t. M, s f

Need only E X F G U define others e.g. AG p   EF p AF p   EG p

Explicit state model checking Option 1 CES (original paper) Represent state transition graph explicitly Walk around marking states Graph algorithms involving strongly connected components etc. Not covered in this course (cf. SPIN) Used particularly in software model checking

Symbolic MC Option 2 McMillan et al because of STATE EXPLOSION problem State graph exponential in program/circuit size Graph algorithms linear in state graph size INSTEAD Use symbolic representation of both sets of states and of state transtion graph

Symbolic MC Fixed point characerisations of CTL ops Sets of states formulas relations between states (BDDs) Fixed point characerisations of CTL ops NO explicit state graph

A state Vector of boolean variables (v1,v2,v3, …., vn)  {0,1}n

Boolean formulas (x  y)  z ( is exclusive or) (1  0)  0 = 1 (1  0)  0 = 1 assignment [x=1,y=0,z=0] gives answer 1 is a model or satisfying assignment Write as 101 Exercise: Find another model

Boolean formulas (x  y)  z ( is exclusive or) (1  1)  0 = 0 (1  1)  0 = 0 assignment [x=1,y=1,z=0] is not a model

Formula is a tautology if ALL assignments are models and is contradictory if NONE is.

Boolean formulas For us, interesting formulas are somewhere in between: some assignments are models, some not IDEA: A formula can represent a set of states (its models)

{000,001, … , 111} true {} false {111} x  y  z {101} x  y  z {111,101} x  z . {000,001, … , 111} true

Example (x  y)  z represents {100,010,110,111} (x  y)  z is in form ({100,010,110,111},xyz) Exercise: Find formulas (with var. names x,y,z) for the sets {} {100} {110,100,010,000}

Exercise Find an element of form({001,010,100},abc) Will slarva and write form(P,vs) to stand for a formula representing P and using variables vs

What is needed now? A good data structure for boolean formulas Binary Decision Diagrams (BDDs) Akers (IEEE Trans. Comp 78) Bryant (IEEE Trans. Comp. 86, most cited CS paper!) see also Bryant’s document about a Hitachi patent from 93 McMillan saw application to symbolic MC

Binary Decision Diagrams Canonical form (constant time comparison) Polynomial algorithms for ’and’, ’or’, ’not’ etc. Exponential but practically efficient algorithm for boolean quantification (Presentation based on lecture notes by Ken McMillan)

Ordered Decision Tree ab + cd (ab)  (cd) a 0 1 b b 0 1 0 1 c c c c 0 1 b b 0 1 0 1 c c c c 0 1 0 1 0 1 0 1 d d d d d d d d 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 1

To get OBDD Combine isomorphic subtrees Eliminate redundant nodes (those with identical children) Tree becomes a graph

(O)BDD ab + cd (ab)  (cd) a 1 b c 1 d 1 0 1

Make BDD for (x  y)  z

Combining BDDs apply algorithm (for building and of two BDDs, or of two BDDs etc.) v is top variable in either f or g Solve recursively for v=0 and v=1 to get 0 and 1 branches of result node Do not create new result node if both brances equal (return that result) or if equivalent node already exists in reduce table. (The apply function is also memoized.) Terminates when both f and g constants (1 or 0)

Quantification b. f is f | b=0  f | b=1 get by replacing each b node by its 0 branch also have efficient algorithm for quantifying over a set of variables

BDDs + Many formulas (and circuits) have small representations -Some do not! Multipliers - BDD representation of a function can vary exponentially in size depending on variable ordering; users may need to play with variable orderings (less automatic) + Good algorithms and packages (e.g. CUDD) + EXTREMELY useful in practice - Size limitations a big problem

Exercise revisited Find a BDD for your form({001,010,100},abc)

Lattice {000,001, …. , 110, 111} . {000,001} {000,010} {110,111} {000} {001} {010} . . . . {110} {111} {}

form({},v) false form(PQ,v) form(P,v)  form(Q,v) form(PQ,v) form(P,v)  form(Q,v)

R set of pairs of states R R R R p Image(P,R) {t  s s  P  s R t}

Forward image {t  s s  P  s R t}  R R R R Image(P,R) p form(Image(P,R),v’) = v form(P,v)  form(R,(v,v’)) 

Backward image {s  t t  Q  s R t}  R R R R Q form(Image-1(Q,R),v) = v form(Q,v’)  form(R,(v,v’)) 

Symbolic MC of CTL Compute set of states satisfying a formula recursively (and use BDDs as rep.) consider E cases define others e.g. AX p   EX p A (p U q)  ?

CTL formula f H(f) set of states satisfying f a (atomic) L(a) (cf. Lars) p S – H(p) p  q H(p)  H(q) P  q ? EX p familiar ?

CTL formula f H(f) set of states satisfying f P  q H(p)  H(q) EX p Image-1(H(p),R)

Remaining operators Fixed point characterisation EF p  p  EX (EF p) least fixed point

Fixed points f : set of S -> set of S Monotonic x  y => f(x)  f(y) Fixed point y s.t. f(y) = y

Fixed points monotonic f has Least fixed point y. f(y) [lfp y. f(y)] Greatest fixed point y. F(y) [gfp y. F(y)]

Lattice again {000,001, …. , 110, 111} . {000,001} {000,010} {110,111} {000,001} {000,010} {110,111} {000} {001} {010} . . . . {110} {111} {}

Lattice (S finite) S . {}

Fixed points {}  f({})  f(f({}))  f(f(f({})))  …. Limit is the least fixed point y. f(y) S  f(S)  f(f(S)  f(f(f(S)))  …. Limit is greatest fixed point y. f(y)

CTL EF p  p  EX (EF p) H(EF p) = y. H(p)  H( EX y) = y. H(p)  Image-1(y,R)

Fixed point iteration S0 = H(p) Si+1 = H(p)  Image-1(Si,R)

Fixed point iteration P

Fixed point iteration p  EX (p  EX p) P

Fixed point iteration Evetually stops! P . . . .

Concrete example 000 100 110 111 001 101 010 011

Concrete example 7 4 6 000 100 110 111 001 101 010 011 1 5 2 3 EF p p = dreq  q0  dack

dack and or q0 dreq Boxes with funny arrows are clocked D flip-flops (like Magnus showed before) We will study this example and

EG EG p  p  EX (EG p) H(EG p) = y. H(p)  Image-1(y,R)

EG EG p  p  EX (EG p) H(EG p) = y. H(p)  Image-1(y,R) NB: We can do all of these operations using BDDs to represent the sets

Fixed point interation in the other direction

Fixed point interation in the other direction p  EX p P

Fixed point interation in the other direction p  EX (p  EX p) P

Fixed point interation in the other direction p  EX (p  EX p) …. p

Concrete example 7 4 6 000 100 110 111 001 101 010 011 1 5 2 3 EG p p = (dreq  q0 )  dack

EU E (p U g)  q  (p  EX (E (p U g) ) H(E (p U g) ) = y. H(q)  (H(p)  Image-1(y,R)) Exercise: define H (A(p U q))

All done with BDDS! Glad påsk