CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 3. Specification Automata Syntax, given a set A of atomic observations: Sfinite set of states S 0 Sset of initial states S S transition.
Advertisements

Automatic Verification Book: Chapter 6. How can we check the model? The model is a graph. The specification should refer the the graph representation.
Metodi formali dello sviluppo software a.a.2013/2014 Prof.Anna Labella.
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.
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.
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
François Fages MPRI Bio-info 2007 Formal Biology of the Cell Inferring Reaction Rules from Temporal Properties François Fages, Constraint Programming Group,
UPPAAL Introduction Chien-Liang Chen.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
卜磊 Transition System. Part I: Introduction  Chapter 0: Preliminaries  Chapter 1: Language and Computation Part II: Models  Chapter.
CS 267: Automated Verification Lecture 7: SMV Symbolic Model Checker, Partitioned Transition Systems, Counter-example Generation in Symbolic Model Checking.
CS 267: Automated Verification Lectures 4:  -calculus Instructor: Tevfik Bultan.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
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 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
CS 290C: Formal Models for Web Software Lecture 3: Modeling Navigation Instructor: Tevfik Bultan.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
Temporal Logic and Model Checking. Reactive Systems We often classify systems into two types: Transformational: functions from inputs available at the.
Witness and Counterexample Li Tan Oct. 15, 2002.
Review of the automata-theoretic approach to model-checking.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
Witness and Counterexample Li Tan Oct. 15, 2002.
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.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
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,
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.
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.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
CS 267: Automated Verification Lecture 3: Fixpoints and Temporal Properties Instructor: Tevfik Bultan.
卜磊 Transition System. Definitions and notations Reactive System The intuition is that a transition system consists of a set of possible.
- 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.
Variants of LTL Query Checking Hana ChocklerArie Gurfinkel Ofer Strichman IBM Research SEI Technion Technion - Israel Institute of Technology.
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.
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
Model Checking Formal Methods Workshop August 18, 2017 Amrita
CTL model checking algorithms
CIS 842: Specification and Verification of Reactive Systems
CSCI1600: Embedded and Real Time Software
CSEP590 – Model Checking and Automated Verification
Automatic Verification of Industrial Designs
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
Computer Security: Art and Science, 2nd Edition
CSCI1600: Embedded and Real Time Software
Introduction to verification
Formal Methods in software development
Program correctness Branching-time temporal logics
Program correctness Model-checking CTL
Presentation transcript:

CS 267: Automated Verification Lecture 2: Linear vs. Branching time. Temporal Logics: CTL, CTL*. CTL model checking algorithm. Counter-example generation. Instructor: Tevfik Bultan

Linear Time vs. Branching Time In linear time logics we look at the execution paths individually In branching time logics we view the computation as a tree –computation tree: unroll the transition relation s2s1s4s3 Transition SystemExecution PathsComputation Tree s3 s4 s3 s1 s s3 s4 s3 s1 s s3 s4s s4s1...

Computation Tree Logic (CTL) In CTL we quantify over the paths in the computation tree We use the same four temporal operators: X, G, F, U However we attach path quantifiers to these temporal operators: –A : for all paths –E : there exists a path We end up with eight temporal operators: –AX, EX, AG, EG, AF, EF, AU, EU

CTL Semantics Given a state s and CTL properties p and q s |= piff L(s, p) = True, where p  AP s |=  piff not s |= p s |= p  qiffs |= p and s |= q s |= p  qiffs |= p or s |= q s 0 |= EX piffthere exists a path s 0, s 1, s 2,... such that s 1 |= p s 0 |= AX pifffor all paths s 0, s 1, s 2,..., s 1 |= p

CTL Semantics s 0 |= EG piffthere exists a path s 0, s 1, s 2,... such that for all i  0, s i |= p s 0 |= AG pifffor all paths s 0, s 1, s 2,..., for all i  0, s i |= p s 0 |= EF p iffthere exists a path s 0, s 1, s 2, … such that there exists an i  0 such that s i |= p s 0 |= AF p ifffor all paths s 0, s 1, s 2,..., there exists an i  0, such that, s i |= p s 0 |= p EU qiffthere exists a path s 0, s 1, s 2,..., such that, there exists an i  0 such that s i |= q and for all 0  j < i, s j |= p s 0 |= p AU qifffor all paths s 0, s 1, s 2,..., there exists an i  0 such that s i |=q and for all 0  j< i, s j |=p

CTL Properties s2s1s4s3 Transition SystemComputation Tree s4 s3 s1 s s3 s4s s4s1... pp p p p p s3 |= p s4 |= p s1 |=  p s2 |=  p s3 |= EX p s3 |= EX  p s3 |=  AX p s3 |=  AX  p s3 |= EG p s3 |=  EG  p s3 |= AF p s3 |= EF  p s3 |=  AF  p p p

CTL Equivalences CTL basis: EX, EU, EG AX p =  EX  p AG p =  EF  p AF p =  EG  p p AU q =  ( (  q EU (  p  q))  EG  q) EF p = True EU p Another CTL basis: EX, EU, AU

CTL Model Checking Given a transition system T= (S, I, R) and a CTL property p T |= pifffor all initial state s  I, s |= p Model checking problem: Given a transition system T and a CTL property p, determine if T is a model for p (i.e., if T |=p) For example: T |=? AG (  (pc1=c  pc2=c)) T |=? AG(pc1=w  AF(pc1=c))  AG(pc2=w  AF(pc2=c)) Question: Are CTL and LTL equivalent?

CTL vs. LTL CTL and LTL are not equivalent –There are properties that can be expressed in LTL but cannot be expressed in CTL For example: FG p –There are properties that can be expressed in CTL but cannot be expressed in LTL For example: AG(EF p) Hence, expressive power of CTL and LTL are not comparable

CTL* CTL* is a temporal logic which is strictly more powerful than CTL and LTL CTL* also uses the temporal operators X, F, G, U and the path quantifiers A and E, but temporal operators can also be used without path quantifiers

CTL* CTL and CTL* correspondence –Since and CTL property is also a CTL* property, CTL* is clearly as expressive as CTL Any LTL f property corresponds to the CTL* property A f –i.e., LTL properties have an implicit “for all paths” quantifier in front of them –Note that, according to our definition, an LTL property f holds for a transition system T, if and only if, for all execution paths of T, f holds –So, LTL property f holds for the transition system T if and only if the CTL* property A f holds for all initial states of T

CTL* CTL* is more expressive than CTL and LTL Following CTL* property cannot be expressed in CTL or LTL –A(FG p)  AG(EF p)

Model Checking Algorithm for Finite State Systems [Clarke and Emerson 81], [Queille and Sifakis 82] CTL Model checking problem: Given a transition system T = (S, I, R), and a CTL formula f, does the transition system satisfy the property? CTL model checking problem can be solved in O(|f|  (|S|+|R|)) Note that the complexity is linear in the size of the formula and the transition system –Recall that the size of the transition system is exponential in the number of variables and concurrent components (this is called the state space explosion problem)

CTL Model Checking Algorithm Translate the formula to a formula which uses the basis –EX p, EG p, p EU q Start from the innermost subformulas –Label the states in the transition system with the subformulas that hold in that state Initially states are labeled with atomic properties Each (temporal or boolean) operator has to be processed once Processing of each operator takes O(|S|+|R|)

CTL Model Checking Algorithm Boolean operators are easy –  p : Each state which is not labeled with p should be labeled with  p –p  q : Each state which is labeled with both p and q should be labeled with p  q –p  q : Each state which is labeled with p or q should be labeled with p  q

CTL Model Checking Algorithm: EX p EX p is easy to do in O(|S|+|R|) –All the nodes which have a next state labeled with p should be labeled with EX p s2s1s4s3 pp p, EX p EX p s2s1s4s3

CTL Model Checking Algorithm: p EU q p EU q: Find the states which are the source of a path where p U q holds –Find the nodes that reach a node that is labeled with q by a path where each node is labeled with p Label such nodes with p EU q –It is a reachability problem which can be solved in O(|S|+|R|) First label the nodes which satisfy q with p EU q For each node labeled with p EU q, label all its previous states that are labeled with p with p EU q

CTL Model Checking Algorithm: p EU q s2s1s4s3 pp p, p EU q s2s1s4s3 q q, p EU q

CTL Model Checking Algorithm: EG p EG p: Find infinite paths where each node on the path is labeled with p, and label nodes in such paths with EG p –First remove all the states which do not satisfy p from the transition graph –Compute the strongly connected components of the remaining graph, and then find the nodes which can reach the strongly connected components (both of which can be done in O(|S|+|R|) –Label the nodes in the strongly connected components and the nodes that can reach the strongly connected components with EG p

CTL Model Checking Algorithm: EG p s2s1s4s3 pp p, EG p s2s1s4s3 p p, EG p s2s4s3 pp p A strongly connected component

Verification vs. Falsification Verification: –Show: initial states  truth set of p Falsification: –Find: a state  initial states  truth set of  p –Generate a counter-example starting from that state Model checking algorithms can be modified to generate a counter-example paths if the property is not satisfied –without increasing the complexity The ability to find counter-examples is one of the biggest strengths of the model checkers

Counter-Example Generation Remember: Given a transition system T= (S, I, R) and a CTL property p T |= p ifffor all initial state s  I, s |= p Verification vs. Falsification –Verification: Show: initial states  truth set of p –Falsification: Find: a state  initial states  truth set of  p Generate a counter-example starting from that state The ability to find counter-examples is one of the biggest strengths of the model checkers

General Idea We can define two temporal logics using subsets of CTL operators –ACTL: CTL formulas which only use the temporal operators AX, AG, AF and AU and all the negations appear only in atomic properties (there are no negations outside of temporal operators) –ECTL: CTL formulas which only use the temporal operators EX, EG, EF and EU and all the negations appear only in atomic properties Given an ACTL property its negation is an ECTL property

An Example If we wish to check the property AG(p) We can use the equivalence: AG(p)   EF(  p) If we can find an initial state which satisfies EF(  p), then we know that the transition system T, does not satisfy the property AG(p)

Another Example If we wish to check the property AF(p) We can use the equivalence: AF(p)   EG(  p) If we can find an initial state which satisfies EG(  p), then we know that the transition system T, does not satisfy the property AF(p)

Counter-Example Generation for ACTL Given an ACTL property p, we negate it and compute the set of states which satisfy it is negation  p –  p is an ECTL property If we can find an initial state which satisfies  p then we generate a counter-example path for p starting from that initial state by following the states that are marked with  p –Such a path is called a witness for the ECTL property  p

Counter-example generation for ACTL In general the counter-example for an ACTL property (equivalently a witness to an ECTL property) is not a single path For example, the counter example for the property AF(AGp) would be a witness for the property EG(EF  p) –It is not possible to characterize the witness for EG(EF  p) as a single path However it is possible to generate tree-like transition graphs containing counter-example behaviors as a counter- example: –Edmund M. Clarke, Somesh Jha, Yuan Lu, Helmut Veith: “Tree-Like Counterexamples in Model Checking”. LICS 2002: 19-29

Counter-example generation for LTL –Recall that, an LTL property f holds for a transition system T, if and only if, for all execution paths of T, f holds Then, to generate a counter-example for an LTL property f, we need to show that there exists an execution path for which  f holds. –Given an LTL property f, a counter-example is an execution path for which  f holds

What About LTL and CTL* Model Checking? The complexity of the model checking problem for LTL and CTL* are: –(|S|+|R|)  2 O(|f|) Typically the size of the formula is much smaller than the size of the transition system –So the exponential complexity in the size of the formula is not very significant in practice