Chapter 6: Computation Tree Logic

Similar documents
Chapter 4: Computation tree logic

Computation Tree Logic

Overview. overview / 357

Chapter 5: Linear Temporal Logic

Topics in Verification AZADEH FARZAN FALL 2017

Chapter 5: Linear Temporal Logic

Linear-Time Logic. Hao Zheng

Chapter 3: Linear temporal logic

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either

Model checking (III)

Chapter 5: Linear Temporal Logic

Linear Temporal Logic and Büchi Automata

A Tableau-Based Decision Procedure for Right Propositional Neighborhood Logic (RPNL )

Model Checking Algorithms

Introduction to Model Checking. Debdeep Mukhopadhyay IIT Madras

Model Checking with CTL. Presented by Jason Simas

Temporal & Modal Logic. Acronyms. Contents. Temporal Logic Overview Classification PLTL Syntax Semantics Identities. Concurrency Model Checking

A brief introduction to Logic. (slides from

Syntax and Semantics of Propositional Linear Temporal Logic

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Model for reactive systems/software

FORMAL METHODS LECTURE IV: COMPUTATION TREE LOGIC (CTL)

Computation Tree Logic

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

CS357: CTL Model Checking (two lectures worth) David Dill

SMV the Symbolic Model Verifier. Example: the alternating bit protocol. LTL Linear Time temporal Logic

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Algorithms for Model Checking (2IW55)

Computation Tree Logic

Verification. Arijit Mondal. Dept. of Computer Science & Engineering Indian Institute of Technology Patna

Temporal Logic Model Checking

Summary. Computation Tree logic Vs. LTL. CTL at a glance. KM,s =! iff for every path " starting at s KM," =! COMPUTATION TREE LOGIC (CTL)

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Lecture 16: Computation Tree Logic (CTL)

From Liveness to Promptness

Comp487/587 - Boolean Formulas

Verification. Lecture 9. Bernd Finkbeiner Peter Faymonville Michael Gerke

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Alternating-Time Temporal Logic

MODEL CHECKING. Arie Gurfinkel

CTL, the branching-time temporal logic

Theoretical Foundations of the UML

ESE601: Hybrid Systems. Introduction to verification

T Reactive Systems: Temporal Logic LTL

Tableau-based decision procedures for the logics of subinterval structures over dense orderings

Computation Tree Logic (CTL)

Introduction to Logic in Computer Science: Autumn 2006

3-Valued Abstraction-Refinement

Lecture Notes on Emptiness Checking, LTL Büchi Automata

Abstraction for Falsification

Model Checking for the -calculus. Paolo Zuliani , Spring 2011

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct.

Timo Latvala. February 4, 2004

Example. Lemma. Proof Sketch. 1 let A be a formula that expresses that node t is reachable from s

Temporal Logic. M φ. Outline. Why not standard logic? What is temporal logic? LTL CTL* CTL Fairness. Ralf Huuck. Kripke Structure

FORMAL METHODS LECTURE III: LINEAR TEMPORAL LOGIC

First-order resolution for CTL

Reasoning about Time and Reliability

Systems Verification. Alessandro Abate. Day 1 January 25, 2016

Double Header. Model Checking. Model Checking. Overarching Plan. Take-Home Message. Spoiler Space. Topic: (Generic) Model Checking

Reasoning with Probabilities. Eric Pacuit Joshua Sack. Outline. Basic probability logic. Probabilistic Epistemic Logic.

First Order Logic (FOL) 1 znj/dm2017

Verification Using Temporal Logic

Model checking, verification of CTL. One must verify or expel... doubts, and convert them into the certainty of YES [Thomas Carlyle]

Automata-Theoretic Model Checking of Reactive Systems

Linear Temporal Logic (LTL)

CS256/Winter 2009 Lecture #6. Zohar Manna

LTL and CTL. Lecture Notes by Dhananjay Raju

Model Checking: An Introduction

Optimal Decision Procedures for Satisfiability in Fragments of Alternating-time Temporal Logics

Model Checking. Temporal Logic. Fifth International Symposium in Programming, volume. of concurrent systems in CESAR. In Proceedings of the

Efficient Model-Checking of Weighted CTL with Upper-Bound Constraints

CTL Model checking. 1. finite number of processes, each having a finite number of finite-valued variables. Model-Checking

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Lecture Notes on Model Checking

THEORY OF SYSTEMS MODELING AND ANALYSIS. Henny Sipma Stanford University. Master class Washington University at St Louis November 16, 2006

arxiv: v2 [cs.lo] 22 Jul 2017

Propositional Logic: Models and Proofs

Introduction to Model Checking

A tableau-based decision procedure for a branching-time interval temporal logic

Automata-based Verification - III

Symmetry Reductions. A. Prasad Sistla University Of Illinois at Chicago

Chapter 3 Deterministic planning

Helsinki University of Technology Laboratory for Theoretical Computer Science Research Reports 99

Notes. Corneliu Popeea. May 3, 2013

CDS 270 (Fall 09) - Lecture Notes for Assignment 8.

An Introduction to Temporal Logics

Alternating Time Temporal Logics*

PSPACE-completeness of LTL/CTL model checking

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Reasoning about Memoryless Strategies under Partial Observability and Unconditional Fairness Constraints

Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

SFM-11:CONNECT Summer School, Bertinoro, June 2011

Model Checking in the Propositional µ-calculus

Finite-State Model Checking

PSL Model Checking and Run-time Verification via Testers

Transcription:

Chapter 6: Computation Tree Logic Prof. Ali Movaghar Verification of Reactive Systems

Outline We introduce Computation Tree Logic (CTL), a branching temporal logic for specifying system properties. A comparison to LTL based on expressiveness is provided. The chapter concludes with an extension called CTL * which subsumes both CTL and LTL. 2

Branching Time vs. Linear Time In Linear time at each moment of time there is only one possible successor state and thus each time moment has a unique possible future We can state properties over all possible computations that start in a state, but not easily about some of such computations 3

Branching Time vs. Linear Time (cont.) Sometimes we can overcome these problems: To check whether there exists some computation starting in s that satisfies ϕ we may check whether s = ϕ 4

Branching Time vs. Linear Time (cont.) But sometimes we cannot: The property for every computation it is always possible to return to the initial state cannot be stated or checked by LTL. Although it can be checked by a stronger property We may require a computation to always return to the initial state: s = start 5

Branching Time vs. Linear Time (cont.) We could solve this Problem if we could write the property: start: in any state ( ) of any possible computation ( ), there is a possibility ( ) to eventually return to the start state ( start) (This is actually a CTL property) But this not a valid nesting of an LTL property 6

Branching Time vs. Linear Time (cont.) Branching time refers to the fact that at each moment there may be several different possible futures. Instead of a sequence of states(a path) what we have here is a Tree of states. The tree rooted at state s represents all possible infinite computations in the transition system that start in s. 7

Computation Tree Logic: Syntax (State formulae) CTL has a two-stage syntax: CTL state formulae are formed over the set AP of atomic proposition according to the following grammar: Φ ::= true a Φ 1 Φ 2 Φ ϕ ϕ where a AP and ϕ is a path formula Note how every path formula is preceded by a quantifier 8

Computation Tree Logic: Syntax (Path formulae) CTL path formulae are formed according to the following grammar: ϕ ::= Φ Φ 1 UΦ 2 where Φ, Φ 1 and Φ 2 are state formulae (From now on, capital greek letters denote state formulae, and the small ones denote path formulae) Path formulae are as in LTL built by the nextstep and until operators, but they must not be combined with Boolean connectives 9

Computation Tree Logic: Deriving the Temporal Modalities eventually: Φ = (true U Φ) Φ holds potentially Φ = (true U Φ) Φ is inevitable always: Φ = Φ potentially always Φ Φ = Φ invariantly Φ 10

Computation Tree Logic: Deriving the Temporal Modalities (Cont.) always Φ cannot be obtained from the equation Φ = Φ as in LTL, since propositional logic operators cannot be applied to path formulae. We should exploit the duality of existential and universal quantification: Φ is not defined as Φ, but rather as Φ 11

Computation Tree Logic: Syntax Example 6.3.: The mutual exclusion property is described in CTL by the formula: ( crit1 crit2) CTL formulae of the form Φ expresses that Φ is infinitely often true on all paths thus the CTL formula ( crit1) ( crit2) specifies the Liveness property 12

Computation Tree Logic: Syntax (Cont.) Example 6.3. start expresses that in every reachable system state it is possible to return to the starting state(s). 13

CTL Semantics: Satisfaction Relation Given a transition system TS = (S, Act,, I,AP, L), the semantics of CTL formulae is defined by two satisfaction relations (both denoted by = TS, or briefly =): one for the state formulae and one for the path formulae. 14

CTL Semantics: Satisfaction Relation The satisfaction relation = is defined for state formulae by: 15

CTL Semantics: Satisfaction Relation For path, the satisfaction relation = for path formulae is defined by: 16

CTL Semantics: Semantics for Transition Systems Given a transition system TS, the satisfaction set Sat TS (Φ), or briefly Sat(Φ), for CTL-state formula Φ is defined by: Sat(Φ) = {s S s Φ} The transition system TS satisfies CTL formula Φ if and only if Φ holds in all initial states of TS: TS = Φ if and only if s 0 I. s 0 = Φ. This is equivalent to I Sat(Φ) 17

CTL Semantics: Semantics derivation For path fragment = s 0 s 1 s 2, The semantics of the derived path operator eventually is: = Φ iff s j = Φ for some j 0 As we know, Φ = ( Φ), from which we can derive: s = ( Φ) iff ( Paths(s). = ( Φ)), so: s = Φ iff Paths(s). [j] = Φ for all j>=0 18

CTL Semantics: Semantics derivation (Cont.) Therefore, Φ can be understood as a CTL path formula with the semantics: = s 0 s 1 s 2 = Φ if and only if s j = Φ for all j 0 Read Example 6.6 19

Computation Tree Logic: Semantics Example 6.7.: Consider the LTS below with the set of propositions AP={a,b} TS = ( a) TS = (au( a ( aub))) (The little graphs show states where the leading formulae hold) 20

Computation Tree Logic: Semantics Infinitely Often: We are going to prove the following: if s = a then Paths(s). [i] = a for infinitely many i The reverse of this Property is also true, as proved in Remark 6.8. Let s be a state, such that s = a We show that every infinite path fragment starting in s passes through an a-state infinitely often 21

Computation Tree Logic: Semantics (Cont.) From s = a we have = a Let = s 0 s 1 s 2... Paths(s) and j 0. We demonstrate that there exists an index i j with s i = a So, for s j we have s j = a [j ] = s j s j+1 Paths(s j ) Hence for all j we have: s j s j+1 s j+2 = a Which means there exists an i for which s i = a holds We can conclude that path visits an a-state infinitely often. 22

Computation Tree Logic: Semantics (Weak Until) The weak-until operator in CTL cannot be defined directly starting from the LTL definition ϕwψ = (ϕuψ) ( ϕ) since it does not yield a syntactically correct CTL formula. It should be defined using the LTL equivalence law ϕwψ = ((ϕ ψ)u ( ϕ ψ)) 23

W Computation Tree Logic: Semantics (Weak Until Cont.) The weak-until operator can be defined in CTL by: (ΦWΨ) = ((Φ Ψ)U( Φ Ψ)) (ΦWΨ) = ((Φ Ψ)U( Φ Ψ)) So, for (ΦWΨ) we can say that: = ΦWΨ iff = ΦUΨ or = (Φ Ψ), Or = ΦWΨ iff = ΦUΨ or = Φ. Which yields: (ΦWΨ) = (ΦUΨ) Φ 24

Computation Tree Logic: Semantics (Negation) It is possible that the statements TS =Φ and TS = Φ both hold Because of the fact that initial states are not necessarily unique TS ϕ iff Paths(TS).( = ϕ) Thus the statement TS ϕ holds if and only if there exists an initial state s 0 I with s 0 ϕ, (i.e. s 0 = ϕ) 25

Computation Tree Logic: Semantics (Negation Cont.) On the other hand, TS = ϕ requires that s 0 = ϕ for all s 0 I In the above figure we have that both TS a and TS a hold 26

CTL Semantics: Transition Systems with Terminal States For a finite maximal path fragment = s 0 s 1 s 2 s n of length n, s n is a terminal state: s = false iff s is a terminal state. Furthermore: 27

Computation Tree Logic: Equivalence of CTL Formulae CTL formulae Φ and Ψ are called equivalent whenever for any state s it holds that s = Φ if and only if s = Ψ Definition: CTL formulae Φ and Ψ (over AP) are called equivalent, denoted Φ Ψ, if Sat(Φ) = Sat(Ψ) for all transition systems TS over AP. Recall that the notion of CTL Formula is used for a CTL state formula 28

Computation Tree Logic: Equivalence of CTL Formulae Useful equivalency Rules: Dulaity laws: 29

Equivalence of CTL Formulae (Cont.) Expansion Laws: ( U ) is equivalent to the fact that the current state either satisfies, or it satisfies, and for some direct successor state, ( U ) holds 30

Equivalence of CTL Formulae (Cont.) Distributive Laws: 31

Computation Tree Logic: Normal Forms The basic operators, U, and U would have been sufficient to define the syntax of CTL. Although by the following definition we could omit all the universal quantifiers as well. 32

CTL Normal Forms: Existential Normal Form Defintion: For a AP, the set of CTL state formulae in existential normal form (ENF, for short) is given by: Φ ::= true a Φ 1 Φ 2 Φ Φ (Φ 1 UΦ 2 ) Φ. 33

CTL Normal Forms: Existential Normal Form (Con.) Theorem 6.14: For each CTL formula there exists an equivalent CTL formula in ENF. Proof: The following duality laws allow elimination of the universal path quantifiers: Φ = Φ (ΦUΨ) = ( ΨU( Φ Ψ)) Ψ 34

CTL Normal Forms: Positive Normal Form Definition: The set of CTL state formulae in positive normal form (PNF, for short) is given by: Φ ::= true false a a Φ 1 Φ 2 Φ 1 Φ 2 ϕ ϕ where a AP and the path formulae are given by ϕ ::= Φ Φ 1 UΦ 2 Φ 1 WΦ 2. 35

CTL Normal Forms: Positive Normal Form (Con.) Theorem 6.16: For each CTL formula there exists an equivalent CTL formula in PNF. Proof: Any CTL formula can be transformed into PNF using the following equivalence laws: 36

CTL Normal Forms: Release Operator In the rules for U and U the number of occurrences of Ψ (and Φ) is doubled, the length of an equivalent CTL formula may be exponentially longer than the original CTL formula. This exponential blowup can be avoided by using the release operator, which in CTL can be defined by: (Φ R Ψ) = (( Φ)U( Ψ)) (Φ R Ψ) = (( Φ)U( Ψ)) 37

Expressiveness of CTL vs. LTL There are properties that one can express in CTL, but that cannot be expressed in LTL, and vice versa Hence, the logics CTL and LTL are incomparable according to their expressiveness. Definition: CTL formula Φ and LTL formula ϕ (both over AP) are equivalent, denoted Φ ϕ, if for any transition system TS over AP: TS = Φ if and only if TS = ϕ 38

Expressiveness of CTL vs. LTL (Cont.) Dropping all (universal and existential) quantifiers is a safe way to generate an equivalent LTL formula, provided there are equivalent LTL formulae: As an example, the LTL formula a is equivalent to the CTL formula a However, a and a are not equivalent. 39

Expressiveness of CTL vs. LTL (Cont.) Theorem 6.18: Let Φ be a CTL formula, and ϕ the LTL formula that is obtained by eliminating all path quantifiers in Φ. Then: Φ ϕ or There does not exist any LTL formula that is equivalent to Φ. 40

Expressiveness of CTL vs. LTL (Cont.) Lemma 6.19. (Persistence): The CTL formula a and the LTL formula a are not equivalent. By theorem 6.18 it can be asserted that there is no LTL expression whatsoever which can describe the property a 41

Expressiveness of CTL vs. LTL (Cont.) Lemma 6.20. (Eventually an a-state with only direct a-successors): The CTL formula (a a) and the LTL formula (a a) are not equivalent. In addition to CTL formulas inexpressible in LTL, there are also LTL formulas which cannot be expressed in CTL. 42

Expressiveness of CTL vs. LTL (Cont.) Theorem 6.21. (Incomparable Expressiveness of CTL and LTL): a) There exist LTL formulae for which no equivalent CTL formula exists. This holds for, for instance: a and (a a). b) There exist CTL formulae for which no equivalent LTL formula exists. This holds for, for instance: a and (a a) and a. 43

CTL Model Checking CTL model checker: A decision algorithm that Checks whether TS = Φ for a given transition system TS and a CTL formula Φ Throughout this section, it is assumed that TS is finite, and has no terminal states CTL model checking can be performed by a recursive procedure that calculates the satisfaction set for all subformulae of Φ 44

CTL Model Checking (Cont.) We consider CTL formulae in ENF (CTL formulae built by the basic modalities, U, and.) This requires algorithms that generate Sat( Φ), Sat( (ΦUΨ)), and Sat( Φ) when Sat(Φ) and Sat(Ψ) are given 45

CTL Model Checking: Global Model-checking Procedure The basic procedure for CTL model checking is: The set Sat(Φ) of all states satisfying Φ is computed recursively It follows that TS = Φ if and only if I Sat(Φ), where I is the set of initial states of TS It is called global because satisfaction of all other states is verified besides the initial states. 46

CTL Model Checking: Global Modelchecking Procedure (Cont.) Sat(Φ) is computed in a bottom-up traversal of the parse tree of the CTL state formula Φ: The nodes of the parse tree represent the subformulae of Φ. The leaves stand for the constant true or an atomic proposition a AP. All inner nodes are labeled with an operator. For ENF formulae the labels of the inner nodes are,,, U, or. 47

CTL Model Checking: Global Modelchecking Procedure (Cont.) The children of a node v stand for the maximal genuine subformulae of the formula Ψ v that is represented by v. The Operator labeling a node says how to combine its maximal genuine subformulae. 48

CTL Model Checking: Global Modelchecking Procedure (Cont.) As soon as a certain subformula Ψ is computed, a Ψ is added to L(s) for every s Sat(Ψ) rather as an atomic proposition satisfied by s. 49

CTL Model Checking: Global Modelchecking Procedure (Cont.) Example 6.22: Φ = a (b U c) 50

CTL Model Checking: Global Modelchecking Procedure (Cont.) Once the subformulae Ψ and Ψ are treated, they can be replaced by the new atomic propositions a 1, a 2 The formula that is to be treated for the root node simply thus is: Φ = a 1 a 2. Sat(Φ) results from intersecting Sat(a 1 ) = Sat(Ψ) and Sat(a 2 ) = Sat(Ψ ) 51

CTL Model Checking: Global Modelchecking Procedure (Cont.) Theorem 6.23: For all CTL formulae Φ, Ψ over AP it holds that: 52

CTL Model Checking: Global Modelchecking Procedure (Cont.) These two last characterizations are based upon equation induced by the expansion laws for (ΦUΨ) and Φ respectively 53

Fixpoint Representation Let TS = (S, Act,, I,AP, L) be an arbitrary finite Transition System with no terminal state. The set P(S) of all subsets of S form a lattice under the set inclusion ordering. Based on first order logic, a subset S can be viewed as a predicate which is true for every s i which is a member of S. Each element S of the lattice is a predicate on S. A function that maps P(S) to P(S) is called a Predicate Transformer. 54

Fixpoint theory Let τ : P(S) P(S) be a predicate transformer, then: τ is Monotonic provided that P Q implies τ(p) τ(q); τ is U-continuous provided that P 1 P 2 implies τ(u i P i ) = U i τ(p i ); τ is -continuous provided that P 1 P 2 implies τ( i P i ) = i τ(p i ). 55

Fixpoint Theory: Predicate Transformer Properties Lemma 1: If S is finite and τ is monotonic, then τ is also U-continuous and -continuous. Lemma 2: If τ is monotonic, then for every i, τ i (False) τ i+1 (False) and τ i (True) τ i+1 (True). Lemma 3: If τ is monotonic and S is finite, then there is an integer i 0 such that for every j i 0, τ j (False) = τ i 0(False). Similarly, there is some j 0 such that for every j j 0, τ j (True) = τ j 0(True). 56

Fixpoint Theory: Predicate Transformer Properties (Cont.) Lemma 4: If τ is monotonic and S is finite, then there is an integer i 0 such that μz. τ(z) = τ i 0 (False). Similarly, there is some j 0 such that νz. τ(z) = τ j 0 (True). 57

Fixpoint theory: Greatest and Least Fixpoints Let τ i (Z) denote i applications of τ to Z. According to Tarski, any monotonic predicate transformer τ on P(S) always has a least fixpoint μz. τ(z), and a greatest fixpoint νz. τ(z) where μz. τ(z)= {Z τ(z) Z} and νz. τ(z)= U{Z τ(z) Z}. Additionally, if τ is U-continuous μz. τ(z) = U i τ i (False) and if τ is -continuous νz. τ(z) = i τ i (True). 58

CTL operators as greatest or least fixpoints If we identify each CTL formula f with the predicate {s M, s = f }, then each of the basic CTL operators may be characterized as a least or greatest fixpoint of an appropriate predicate transformer as follows: f 1 = μz. f 1 Z f 1 = μz. f 1 Z f 1 = νz. f 1 Z f 1 = νz. f 1 Z [f 1 U f 2 ] = μz. f 2 (f 1 Z) [f 1 U f 2 ] = μz. f 2 (f 1 Z) 59

Procedure for computing least fixpoint function Lfp(Tau : PredicateTransformer) : Predicate Q := False; Q := Tau(Q); while (Q Q ) do Q := Q ; Q := Tau(Q ); end while; return(q); end function 60

Procedure for computing greatest fixpoint function Gfp(Tau : PredicateTransformer) : Predicate Q := True; Q := Tau(Q); while (Q Q ) do Q := Q ; Q := Tau(Q ); end while; return(q); end function 61

Fixpoint Theory: Sequence of Approximations (for (puq)) p q p q s 0 p s 0 p Original Transition System τ 1 (False) p q p q s 0 p s 0 p τ 2 (False) τ 3 (False) 62

CTL Model Checking: Fixedpoint Equations Consider the case of (ΦUΨ): (ΦUΨ) Ψ (Φ (ΦUΨ)) We can describe the CTL formula (ΦUΨ) as a fixed-point of the logical equation F Ψ (Φ F) A fixed-point is simply a solution of the above equation 63

CTL Model Checking: Fixedpoint Equations (Cont.) There are other solutions too: (ΦWΨ) But (ΦUΨ) is the least solution to the former equation Whereas (ΦWΨ) is the largest solution In a similar way, Φ can be considered as the greatest fixed point of the logical equation F = Φ F 64

CTL Model Checking: Fixedpoint computation As an example, the algorithm to compute (Φ 1 UΦ 2 ) is given below: (Φ 1 UΦ 2 ) : T := Sat(Φ 2 ); (* compute the smallest fixed point *) while { s Sat(Φ 1 ) \ T Post(s) T } do let s {s Sat(Φ 1 ) \ T Post(s) T }; T := T {s}; od; return T; S \ T: all members of S which are not a member of T 65

Computation of the Satisfaction Sets 66

CTL Model Checking: Fixedpoint computation (Cont.) Example 6.26. Checking the formula Φ with Φ = ((a = c) (a b)) in the following transition system: 67

CTL Model Checking: Fixedpoint computation (Cont.) As we know, Φ = (true U Φ) Invoking the former algorithm given, Sat(true) and Sat((a = c) (a b)) are recursively computed. The states of set T are: 68

CTL Model Checking: Fixedpoint computation (Cont.) In the next two steps, s 6 and s 7 are added respectively, finally yielding the satisfaction set: s 6 s 7 69

CTL Model Checking: Alternative Algorithms 70

CTL Model Checking: Alternative Algorithms 71

CTL Model Checking: Alternative Algorithms A possibility to compute Sat( Φ) is to only consider the Φ-states of a transition system TS and ignore all Φ-states: from the TS given in example 6.26, consider the example with Φ = b: 72

CTL Model Checking: Alternative Algorithms (Cont.) In the next step, all nontrivial strongly connected components (SCCs) in the state graph induced by TS[Φ] are computed: Nontrivial SCC: A SCC containing at least one transition 73

CTL Model Checking: Alternative Algorithms (Cont.) Finally, all states which satisfy Φ and can reach a state in the strongly connected components are added: Theorem 6.29. s = Φ iff s = Φ and there is a nontrivial SCC in TS[Φ] reachable from s. 74

CTL Model Checking: Time and Space Complexity Let TS be a finite transition system with N states and K transitions The time complexity of Algorithm 14 (see page 348, partly described in slide 54) is in: O((N+K) Φ ) 75

CTL Model Checking: Time and Space Complexity (Cont.) Theorem 6.30. For transition system TS with N states and K transitions, and CTL formula Φ, the CTL model-checking problem TS = Φ can be determined in time O ((N+K) Φ ) CTL Model-checking is Linear in contrast to the exponential time Model-checking algorithm given for LTL 76

CTL Model Checking: Time and Space Complexity (Cont.) But this should not be interpreted as CTL model checking is more efficient than LTL model checking. LTL formulae may be exponentially shorter than any of their equivalent formulation in CTL. 77

CTL Model Checking: Time and Space Complexity (Cont.) Example 6.31. The Hamiltonian Path Problem (which is NP- complete): From Lemma 5.45, it follows that the Hamiltonian path problem for digraphs with n nodes can be encoded in LTL formula ϕ n whose length is polynomial in the number of nodes, n. 78

CTL Model Checking: Time and Space Complexity (Cont.) We want to find a Hamiltonian path in a directed graph G = (V,E) with V = {v 1,, v n } We want to define a Φ n such that: G contains a Hamiltonian path if and only if TS Φ n 79

CTL Model Checking: Time and Space Complexity (Cont.) Define TS = (V {b}, {τ},, V, V, L): The labels correspond to graph nodes, and the transitions are the same as edges, except that there is a transition to b added to every node. In this example, (a) is the original graph: 80

CTL Model Checking: Time and Space Complexity (Cont.) Let Φ n be defined as follows: Such that Ψ(v i1,..., v in ) is a CTL formula that is satisfied if and only if v i1, v i2,, v in is a Hamiltonian path in G. 81

CTL Model Checking: Time and Space Complexity (Cont.) The formulae Ψ(v i1,..., v in ) are inductively defined as follows: 1. Ψ(v i ) = v i 2. Ψ(v i1, v i2,, v in ) = v i1 Ψ(v i2,, v in ) if n > 1 Stated in words, Ψ(v i1, v i2,, v in ) holds if there exists a path on which v i1, v i2, successively hold. 82

CTL Model Checking: Time and Space Complexity (Cont.) According to this definition, it is easy to infer that: Sat(Ψ(v i1, v i2,, v in ) ) = {v i1 } if v i1, v i2,, v in is a Hamiltonian path in G otherwize Thus, TS Φ n iff there is an initial state s of TS for which s = Φ n, which is, there exists a v in G and a permutation i 11,, i of 1,, n such that v = v nn i and v i1,, v in is a Hamiltonian path in G. 83

CTL Model Checking: Time and Space Complexity (Cont.) By the enumeration of all possible permutations we obtain a formula with a length exponential in the number of vertices in the graph. And we do not expect a smaller formulae, as we know the Hamiltonian path problem is not yet solved polynomially. 84

Fairness in CTL Fairness assumptions can be added as premise to the LTL formula to be verified. TS = fair ϕ if and only if TS = (fair ϕ) Fairness constraints operate on the path level and replace the standard meaning for all/some paths of quantification with for all/some fair paths 85

Fairness in CTL (Cont.) If fair expresses the fairness condition on the path level, then CTL formulae that encode the intuitive meaning of (fair ϕ) and (fair ϕ) would be needed. However, these are not legal CTL formulas. Moreover, this approach is not possible for CTL, based on the fact that most fairness constraints cannot be encoded into a CTL formula: Persistence property a 86

Fairness in CTL (Cont.) Therefore, In order to deal with fairness constraints in CTL, the semantics of CTL is slightly modified such that the state formulae ϕ and ϕ are interpreted over all fair paths rather than over all possible paths. It is assumed that the given fixed fairness constraint is described by a formula as in LTL. 87

Fairness in CTL : CTL Fairness Assumptions Definition 6.32. A strong CTL fairness constraint (over AP) is a term of the form: where Φi and Ψi are CTL formulae over AP Weak and unconditional CTL fairness constraints are defined analogously by conjunctions of terms of the form ( Φi Ψi) and Ψi, respectively. 88

Fairness in CTL: CTL Fairness Assumptions (Cont.) A CTL Fairness Assumption is a conjunction of strong, weak, and unconditional CTL fairness constraints. Note that CTL fairness assumptions are not CTL path formulae, but they can be viewed as LTL formulae using CTL state formulae instead of atomic propositions. 89

Fairness in CTL: CTL Fairness Assumptions (Cont.) Let TS = (S, Act,, I,AP, L) be a transition system without terminal states, π be an infinite path fragment in TS, and fair a fixed CTL fairness assumption. π = fair denotes that π satisfies the formula fair, where = should be read as the LTL semantics. 90

Fairness in CTL: CTL Fairness Assumptions (Cont.) The semantics of CTL under fairness assumption fair is identical to the semantics given earlier, except, the path quantifications range over all fair paths rather than over all paths: FairPaths(s) = {π Paths(s) π = fair} And for the transition system TS: 91

Fairness in CTL: CTL Fairness Assumptions (Cont.) Definition 6.33. For state formulae, The satisfaction relation = fair for CTL fairness assumption fair is defined as: 92

Fairness in CTL: CTL Fairness Assumptions (Cont.) For a path π and path formulae the satisfaction relation = fair for CTL fairness assumption fair is defined as: where for path π = s 0 s 1 s 2 and integer i 0, π[i] denotes the (i+1)-th state of π, s i 93

Fairness in CTL: CTL Fairness Assumptions (Cont.) For CTL-state formula Φ, and CTL fairness assumption fair, the satisfaction set Sat fair (Φ) is defined by: Sat fair (Φ) = { s S s =fair Φ}. The transition system TS satisfies CTL formula Φ under fairness assumption fair if and only if Φ holds in all initial states of TS: TS = fair Φ if and only if s 0 I. s 0 = fair Φ. 94

CTL Model Checking with Fairness (Basic Idea) 95

Model Checking CTL with Fairness 96

Computation of Sat sfair ( a) 97

98

Time Complexity of Verifying under Fairness 99

Time Complexity of CTL Model Checking with Fairness 100

Fairness in CTL: CTL Fairness Assumption (Cont.) Read Example 6.35. Example 6.36. Mutual Exclusion: Consider the semaphore-based solution to the two-process mutual exclusion problem. The transition system of this concurrent program is denoted TS sem. 101

Fairness in CTL: CTL Fairness Assumption (Cont.) The CTL formula: Φ = ( crit 1 ) ( crit 2 ) Describes the liveness property that both processes infinitely often have access to the critical section. It follows that TS sem Φ (The semaphore solution does not fulfill the liveness property) 102

Fairness in CTL: CTL Fairness Assumption (Cont.) Again, consider the arbiter-based solution to the mutual exclusion problem. The decision as to which process will acquire access to the critical section is determined by a coin flipped by the arbiter. Consider the unconditional fairness assumption: ufair = head tail Which requires that the events heads and tails occur infinitely often with probability 1 it follows that: TS 1 Arbiter TS 2 Φ, and TS1 Arbiter TS2 ufair Φ 103

Syntax of CTL* CTL* state formulae over the set AP of atomic proposition, briefly called CTL* formulae, are formed according to the following grammar: Φ ::= true a Φ 1 Φ 2 Φ ϕ where a AP and ϕ is a path formula. The CTL* path formulae is given by the following grammar: ϕ ::= Φ ϕ 1 ϕ 2 ϕ ϕ ϕ 1 Uϕ 2 where Φ is a state formula, ϕ, ϕ 1, and ϕ 2 are path formulae 104

Satisfaction Relation for CTL* 105

CTL* Semantics for Tranition Systems 106

Embedding of LTL in CTL* 107

CTL* Expressiveness 108

Relationship between LTL, CTL, and CTL* 109

Some Equivalence Laws for CTL* 110

Maximal Proper State Subformula 111

Example of CTL* Model Checking 112

CTL* Model Checking Algorithm 113

Time Complexity of CTL* 114

Complexity of the Model Checking and Algorithms and Satisfiability Checking 115

Branching Time vs. Linear Time (in a Nutshell) 116