Computation Tree Logic
- B. Srivathsan
Chennai Mathematical Institute
Model Checking and Systems Verification January - April 2016
1/35
Computation Tree Logic B. Srivathsan Chennai Mathematical Institute - - PowerPoint PPT Presentation
Computation Tree Logic B. Srivathsan Chennai Mathematical Institute Model Checking and Systems Verification January - April 2016 1 / 35 Module 1: Tree behaviour of a transition system 2 / 35 { p 1 } { p 2 } s 0 s 1 Transition System s 3 s 2
Model Checking and Systems Verification January - April 2016
1/35
2/35
Transition System
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3}
3/35
Transition System
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3}
s0 s1 s3 s3 s3 s3
Paths
s0 s1 s2 s3 s2 s3
3/35
Transition System
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3}
s0 s1 s3 s3 s3 s3
Paths
s0 s1 s2 s3 s2 s3
{ p1 }{ p2 }{ p1,p3 }{ p1,p3 }{ p1,p3 }{ p1,p3 } ... { p1 }{ p2 }{ p2 }{ p1,p3 }{p2}{ p1,p3 }{p2}{ p1,p3 } ...
Traces
3/35
4/35
4/35
s0 s1 s3 s2 s3 s2 s3 s3 s2 s3 s2 s3
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3} 5/35
s0 s1 s3 s2 s3 s2 s3 s3 s2 s3 s2 s3
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3} 5/35
6/35
6/35
7/35
7/35
8/35
8/35
9/35
9/35
10/35
10/35
11/35
11/35
12/35
13/35
14/35
15/35
16/35
16/35
17/35
17/35
18/35
18/35
19/35
19/35
20/35
20/35
21/35
22/35
23/35
24/35
… Exists a path satisfying path property φ :
… All paths satisfy path property φ :
25/35
… Exists a path satisfying path property φ :
… All paths satisfy path property φ :
25/35
26/35
27/35
28/35
28/35
29/35
30/35
31/35
32/35
33/35
34/35
Computation tree E and A operators
35/35
2/25
… Path formulae
… Express properties of paths … LTL
… Properties on trees
… A and E operators … Mixing A and E 3/25
… Path formulae
… Express properties of paths … LTL
… Properties on trees
… A and E operators … Mixing A and E
3/25
φ :=
4/25
φ := true |
4/25
φ := true | pi | pi ∈ AP
4/25
φ := true | pi | φ1 ∧ φ2 | pi ∈ AP φ1,φ2 : State formulae
4/25
φ := true | pi | φ1 ∧ φ2 | ¬φ1 pi ∈ AP φ1,φ2 : State formulae
4/25
α :=
5/25
α := φ | φ : State formula
5/25
α := φ | α1 ∧ α2 | φ : State formula α1,α2 : Path formulae
5/25
α := φ | α1 ∧ α2 | ¬α1 | φ : State formula α1,α2 : Path formulae
5/25
α := φ | α1 ∧ α2 | ¬α1 | X α1 | φ : State formula α1,α2 : Path formulae
5/25
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | φ : State formula α1,α2 : Path formulae
5/25
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | φ : State formula α1,α2 : Path formulae
5/25
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
5/25
φ := true | pi | φ1 ∧ φ2 | ¬φ1 pi ∈ AP φ1,φ2 : State formulae
6/25
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | pi ∈ AP φ1,φ2 : State formulae α : Path formula
6/25
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
6/25
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
7/25
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae Examples: E F p1, A F A G p1, A F G p2, A p1, A E p1
7/25
8/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
9/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula … Every state satisfies true
9/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula … Every state satisfies true … State satisfies pi if its label contains pi
9/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula … Every state satisfies true … State satisfies pi if its label contains pi … State satisfies φ1 ∧ φ2 if it satisfies both φ1 and φ2
9/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula … Every state satisfies true … State satisfies pi if its label contains pi … State satisfies φ1 ∧ φ2 if it satisfies both φ1 and φ2 … State satisfies ¬ φ if it does not satisfy φ
9/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula … Every state satisfies true … State satisfies pi if its label contains pi … State satisfies φ1 ∧ φ2 if it satisfies both φ1 and φ2 … State satisfies ¬ φ if it does not satisfy φ … State satisfies E α if there exists a path starting from the state
satisfying α
9/25
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula … Every state satisfies true … State satisfies pi if its label contains pi … State satisfies φ1 ∧ φ2 if it satisfies both φ1 and φ2 … State satisfies ¬ φ if it does not satisfy φ … State satisfies E α if there exists a path starting from the state
satisfying α
… State satisfies A α if all paths starting from the state satisfy α
9/25
10/25
Path formulae
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
11/25
Path formulae
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae … Path satisfies φ if the initial state of the path satisfies φ
11/25
Path formulae
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae … Path satisfies φ if the initial state of the path satisfies φ … Rest standard semantics like LTL
11/25
∈
12/25
… E F p1: Exists a path where p1 is true sometime
13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true 13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 … In all paths, there exists a state such that every state in the
subtree below it contains p1
13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 … In all paths, there exists a state such that every state in the
subtree below it contains p1
… A F G p2: In all paths, there exists a state from which p2 is true
forever
13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 … In all paths, there exists a state such that every state in the
subtree below it contains p1
… A F G p2: In all paths, there exists a state from which p2 is true
forever
… A p1:
13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 … In all paths, there exists a state such that every state in the
subtree below it contains p1
… A F G p2: In all paths, there exists a state from which p2 is true
forever
… A p1:
… All paths satisfy p1 13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 … In all paths, there exists a state such that every state in the
subtree below it contains p1
… A F G p2: In all paths, there exists a state from which p2 is true
forever
… A p1:
… All paths satisfy p1 … All paths start with p1 13/25
… E F p1: Exists a path where p1 is true sometime … A F A G p1:
… In all paths, there exists a state where A G p1 is true … In all paths, there exists a state from which all paths satisfy G p1 … In all paths, there exists a state such that every state in the
subtree below it contains p1
… A F G p2: In all paths, there exists a state from which p2 is true
forever
… A p1:
… All paths satisfy p1 … All paths start with p1 … Same as p1! 13/25
14/25
15/25
16/25
17/25
18/25
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3}
19/25
s0 s1 s3 s2 s3 s2 s3 s3 s2 s3 s2 s3
s0 s1 s2 s3 {p1} {p2} {p2} {p1,p3} 20/25
21/25
22/25
22/25
22/25
23/25
23/25
24/25
Syntax and semantics State formulae, Path formulae LTL properties ⊆ CTL∗ properties
25/25
2/16
Restrict to a subset of CTL∗ which has efficient model-checking algorithms
3/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := φ | α1 ∧ α2 | ¬α1 | X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
4/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := X α1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
4/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := X φ1 | α1 U α2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
4/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := X φ1 | φ1 U φ2 | F α1 | G α1 φ : State formula α1,α2 : Path formulae
4/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := X φ1 | φ1 U φ2 | F φ1 | G α1 φ : State formula α1,α2 : Path formulae
4/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := X φ1 | φ1 U φ2 | F φ1 | G φ1 φ : State formula α1,α2 : Path formulae
4/16
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
4/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1 A p1
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1 A p1 E G F p1
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1 A p1 E G F p1 A (F p1 ∧ G p2)
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1 A p1 E G F p1 A (F p1 ∧ G p2) A ( p1 U ( E G p2 ) )
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1 A p1 E G F p1 A (F p1 ∧ G p2) A ( p1 U ( E G p2 ) ) A ( p1 U ( G p2 ) )
5/16
State formulae
φ := true | pi | φ1 ∧ φ2 | ¬φ1 | E α | A α pi ∈ AP φ1,φ2 : State formulae α : Path formula
Path formulae
α := X φ1 | φ1 U φ2 | F φ1 | G φ1
Legal CTL formulae Illegal CTL formulae E F p1 E F A G p1 A X p2 A F p1 ∧ A G p2 A F G p1 A p1 E G F p1 A (F p1 ∧ G p2) A ( p1 U ( E G p2 ) ) A ( p1 U ( G p2 ) ) Every temporal operator X, U, F, G has a corresponding A or E
5/16
6/16
non-crit wait crit exiting y>0:y:=y-1 y:=y+1 non-crit wait crit exiting y>0:y:=y-1 y:=y+1
Atomic propositions AP = { p1,p2,p3,p4 } p1: pr1.location=crit p2: pr1.location=wait p3: pr2.location=crit p4: pr2.location=wait Mutual exclusion: A G ¬ (p1 ∧ p3)
7/16
8/16
8/16
8/16
In all paths, eventually red is true forever
9/16
10/16
11/16
12/16
13/16
13/16
14/16
CTL∗ CTL LTL
15/16
CTL∗ CTL LTL
A G p
15/16
CTL∗ CTL LTL
E F A G p A G p
15/16
CTL∗ CTL LTL
E F A G p F G p A G p
15/16
CTL∗ CTL LTL
E F A G p F G p A G p E F A G p ∨ A F G q
15/16
Subset of CTL∗ Paired temporal and A-E operators Expressive powers
16/16