Date post: | 14-Apr-2018 |
Category: |
Documents |
Upload: | vinit-patel |
View: | 215 times |
Download: | 0 times |
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 1/40
CTL vs. LTL
Robert Bellarmine Krug
Department of Computer SciencesUniversity of Texas at Austin
May 25, 2010
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 2/40
Outline
1. Some Definitions And Notation
2. LTL
3. CTL
4. CTL vs. LTL
CTL vs. LTL (2 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 3/40
Outline
1. Some Definitions And Notation
2. LTL
3. CTL
4. CTL vs. LTL
CTL vs. LTL Some Definitions And Notation (3 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 4/40
Kripke Structures — Definition
Let AP be a set of labels — i.e., a set of atomic propositions suchas Boolean expressions over variables, constants, and predicatesymbols.A Kripke structure is a 4-tuple, M = (S , I ,R , L):
a finite set of states, S , a set of initial states, I ⊆ S ,
a transition relation, R ⊆ S × S where∀s ∈ S , ∃s ∈ S such that (s , s ) ∈ R ,
a labeling function, L, from states to the power set of atomicpropositions, L : S → 2AP .
CTL vs. LTL Some Definitions And Notation (4 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 5/40
Kripke Structure — An Example
S = {s 0, s 1, s 2, s 3}
I = {s 0}R = {{s 0, s 1}
{s 0, s 2}{s 1, s 1}
{s 1, s 3}{s 2, s 0}{s 2, s 3}{s 3, s 0}}
L = {{s 0, {p }}{s 1, {p , q }}{s 2, {p , r }}{s 3, {v }}}
p
p, r
s_0 s_1
s_2 s_3
p, q
v
CTL vs. LTL Some Definitions And Notation (5 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 6/40
Infinite Paths
LTL and CTL are concerned only with infinite paths. From hereon, π will always denote an infinite path. Furthermore, π0 willalways denote π’s first element, π1 its second element, and so on.
π = (π0, π1, π2, . . .) is an infinite path in M if it respects M ’stransition relation, i.e., ∀i , (πi , πi +1) ∈ R .
πi denotes π’s i th suffix, i.e., πi = (πi , πi +1, πi +2, . . .)
(πi ) j = (πi , πi +1, πi +2, . . .) j = (πi + j , πi + j +1, πi + j +2, . . .) = πi + j
CTL vs. LTL Some Definitions And Notation (6 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 7/40
Outline
1. Some Definitions And Notation
2. LTL
3. CTL
4. CTL vs. LTL
CTL vs. LTL LTL (7 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 8/40
LTL BNF Syntax
A well-formed LTL formula, φ, is recursively defined by the BNFformula:
φ ::= ; top, or true| ⊥ ; bottom, or false| p ; p ranges over AP
| ¬φ ; negation
| φ ∧ φ ; conjunction| φ ∨ φ ; disjunction| X φ ; next time| F φ ; eventually| G φ ; always| φU φ ; until
From here on, lowercase letters such as p , q , and r , will denoteatomic propositions. Greek letters such as φ and ψ will denoteformulae.
CTL vs. LTL LTL (8 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 9/40
LTL Semantics — the Basics
We now define the binary satisfaction relation, denoted by , for
LTL formulae. This satisfaction is with respect a pair — M , π, aKripke structure and a path thereof.
First, the basics:
M , π true is always satisfied
M , π ⊥false is never satisfied
(M , π p ) if and only if (p ∈ L(π0))atomic propositions are satisfied when they are members of the path’s first element’s labels
CTL vs. LTL LTL (9 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 10/40
LTL Semantics — Boolean Combinations
The use of the Boolean operators ¬, ∧, and ∨ in LTL formulae is adeliberate pun on their mathematical meanings.
(M , π ¬φ) if and only if (M , π φ)
(M , π φ ∧ ψ) if and only if [(M , π φ) ∧ (M , π ψ)]
(M , π φ ∨ ψ) if and only if [(M , π φ) ∨ (M , π ψ)]
CTL vs. LTL LTL (10 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 11/40
LTL Semantics — Temporal Operators
(M , π X φ) if and only if (M , π1 φ)
next time φ
(M , π F φ) if and only if (∃i such that M , πi φ)eventually φ
(M , π G φ) if and only if (∀i such that M , πi φ)
always φ
(M , π φU ψ) if and only if [ ∃i such that (∀ j < i (M , π j φ)) ∧ (M , πi ψ)]
φ until ψ
N.B., The U used here is the “strong until.” There is also a “weakuntil,” φU w ψ is equivalent to (φU ψ) ∨ (G φ).
CTL vs. LTL LTL (11 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 12/40
Xp — Example Path
M , (π0, π1, . . .) Xp
p
ππ1
0
CTL vs. LTL LTL (12 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 13/40
Fp — Example Path
M , (π0, π1, π2, π3, . . .) Fp
p
π π
π π
0 1
2 3
CTL vs. LTL LTL (13 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 14/40
Gp — Example Path
M , (π0, π1, π2, π3, . . .) Gp
p p
pp
π π
π π
0 1
32
CTL vs. LTL LTL (14 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 15/40
pUq — Example Path
M , (π0, π1, π2, π3, . . .) pUq
p
p q
p
π π
π π
0 1
2 3
CTL vs. LTL LTL (15 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 16/40
pUq — Another Example Path
M , (π0, . . .) pUq
q
π0
CTL vs. LTL LTL (16 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 17/40
More LTL Semantics
(M M φ) if and only if ∀π such that π0 ∈ I , (M , π φ)A model, or Kripke structure, satisfies an LTL formula, whenall its paths do.
(φ ≡ ψ) if and only if ∀M [(M M φ) ⇔ (M M ψ)]Two LTL formulae are equivalent when they are satisfied bythe same Kripke structures.
CTL vs. LTL LTL (17 / 40)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 18/40
An LTL Equivalence
X (φ ∧ ψ) ≡ X φ ∧ X ψ
By the previous slide, this is true if, for all M and π:
[M , π X (φ ∧ ψ)] ⇔ [M , π (X φ ∧ X ψ)]
[M , π X (φ ∧ ψ)] =
[M , π1 (φ ∧ ψ)] =
[(M , π1 φ) ∧ (M , π1 ψ)] =
[(M , π X φ) ∧ (M , π X ψ)] =
[M , π (X φ ∧ X ψ)]
by definition of X
by definition of ∧
by definition of X
by definition of ∧
CTL vs. LTL LTL (18 / 40)
S M LTL E i l
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 19/40
Some More LTL Equivalences
X (φ ∧ ψ) ≡ X φ ∧ X ψ
X (φ ∨ ψ) ≡ X φ ∨ X ψ
X (φU ψ) ≡ (X φUX ψ)¬X φ ≡ X ¬φ
F (φ ∨ ψ) ≡ F φ ∨ F ψ
G (φ ∧ ψ) ≡ G φ ∧ G ψ¬F φ ≡ G ¬φ
(φ ∧ ψ)U ρ ≡ (φU ρ) ∧ (ψU ρ)
ρU (φ ∨ ψ) ≡ (ρU φ) ∨ (ρU ψ)
FF φ ≡ F φ
GG φ ≡ G φ
CTL vs. LTL LTL (19 / 40)
O li
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 20/40
Outline
1. Some Definitions And Notation
2. LTL
3. CTL
4. CTL vs. LTL
CTL vs. LTL CTL (20 / 40)
CTL BNF S t
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 21/40
CTL BNF SyntaxA well-formed CTL formula, φ, is recursively defined by the BNFformula (N.B., AX , AF , etc., are each single symbols, not pairs of symbols):
φ ::= | ⊥| p
| ¬φ
| φ ∧ φ
| φ ∨ φ
| AX φ ; A — for all paths| AF φ
| AG φ| φAU φ
| EX φ ; E — there exists a path| EF φ
| EG φ
| φEU ψCTL vs. LTL CTL (21 / 40)
CTL S ti th B i
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 22/40
CTL Semantics — the Basics
As for LTL, we now define the satisfaction relation. Again, thissatisfaction is with respect to a pair, but this time M , s , a Kripkestructure and a state thereof. This change from path to statecreates a very different logic.
M , s M , s ⊥
(M , s p ) if and only if (p ∈ L(s ))atomic propositions are satisfied when they are members of
the state’s labels
CTL vs. LTL CTL (22 / 40)
CTL Se a tics Boolea Co bi atio s
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 23/40
CTL Semantics — Boolean Combinations
As for LTL, the use of the Boolean operators ¬, ∧, and ∨ in CTLformulae is a deliberate pun on their mathematical meanings.
(M , s
¬φ) if and only if (M , s
φ) (M , s φ ∧ ψ) if and only if ((M , s φ) ∧ (M , s ψ))
(M , s φ ∨ ψ) if and only if ((M , s φ) ∨ (M , s ψ))
CTL vs. LTL CTL (23 / 40)
CTL Semantics Temporal Operators the A team
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 24/40
CTL Semantics — Temporal Operators, the A team
(M , s AX φ) if and only if (∀π such that π0 = s ,M , π1 φ)
for all paths starting at s , next time φ
(M , s AF φ) if and only if (∀π such that π0 = s ,∃i such that M , πi φ)
for all paths starting at s , eventually φ
(M , s AG φ) if and only if (∀π such that π0 = s ,∀i M , πi φ)
for all paths starting at s , always φ
(M , s φAU ψ) if and only if
(∀π such that π0 = s ,∃i such that(∀ j < i (M , π j φ)) ∧ (M , πi ψ))for all paths starting at s , φ until ψ
CTL vs. LTL CTL (24 / 40)
CTL Semantics Temporal Operators the E team
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 25/40
CTL Semantics — Temporal Operators, the E team
(M , s EX φ) if and only if (∃π such that π0 = s ,M , π1 φ)
there exists a path such that next time φ
(M , s EF φ) if and only if (∃π such that π0 = s ,∃i such that M , πi φ)
there exists a path such that eventually φ
(M , s EG φ) if and only if (∃π such that π0 = s ,∀i M , πi φ)
there exists a path such that always φ
(M , s φEU ψ) if and only if
(∃π such that π0 = s ,∃i such that(∀ j < i (M , π j φ)) ∧ (M , πi ψ))there exists a path such that φ until ψ
CTL vs. LTL CTL (25 / 40)
AXp
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 26/40
AXp
S = {s 0, s 1, s 2, s 3}I = {s 0}
R = {{s 0, s 1}{s 0, s 2}{s 1, s 1}{s 1, s 3}{s 2, s 0}{s 2, s 3}{s 3, s 0}}
L = {{s 0, {p }}{s 1, {p , q }}{s 2, {p , r }}{s 3, {v }}}
M , s 0 AXp
p
p, r
s_0 s_1
s_2 s_3
p, q
v
CTL vs. LTL CTL (26 / 40)
EFv
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 27/40
EFv
S = {s 0, s 1, s 2, s 3}I = {s 0}
R = {{s 0, s 1}{s 0, s 2}{s 1, s 1}{s 1, s 3}{s 2, s 0}{s 2, s 3}{s 3, s 0}}
L = {{s 0, {p }}{s 1, {p , q }}{s 2, {p , r }}{s 3, {v }}}
M , s 0 EFv
p
p, r
s_0 s_1
s_2 s_3
p, q
v
CTL vs. LTL CTL (27 / 40)
AG(p ∨ v)
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 28/40
AG (p ∨ v )
S = {s 0, s 1, s 2, s 3}I = S
R = {{s 0, s 1}{s 0, s 2}{s 1, s 1}{s 1, s 3}{s 2, s 0}{s 2, s 3}{s 3, s 0}}
L = {{s 0, {p }}
{s 1, {p , q }}{s 2, {p , r }}{s 3, {v }}}
M , s 0 AG (p ∨ v )
p
p, r
s_0 s_1
s_2 s_3
p, q
v
CTL vs. LTL CTL (28 / 40)
pEUv
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 29/40
pEUv
S = {s 0, s 1, s 2, s 3}I = S
R = {{s 0, s 1}{s 0, s 2}{s 1, s 1}{s 1, s 3}{s 2, s 0}{s 2, s 3}{s 3, s 0}}
L = {{s 0, {p }}
{s 1, {p , q }}{s 2, {p , r }}{s 3, {v }}}
M , s 0 pEUv
p
p, r
s_0 s_1
s_2 s_3
p, q
v
CTL vs. LTL CTL (29 / 40)
More CTL Semantics
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 30/40
More CTL Semantics
(M M φ) if and only if ∀s ∈ I , (M , s φ)A model, or Kripke structure, satisfies a CTL formula, whenall its states do.
(φ ≡ ψ) if and only if ∀M [(M M φ) ⇔ (M M ψ)]Two CTL formulae are equivalent when they are satisfied bythe same Kripke structures.
CTL vs. LTL CTL (30 / 40)
Some CTL Equivalences
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 31/40
Some CTL Equivalences
AX (φ ∧ ψ) ≡ AX φ ∧ AX ψ
EX (φ ∨ ψ) ≡ EX φ ∨ EX ψ¬AX φ ≡ EX ¬φ
EF (φ ∨ ψ) ≡ EF φ ∨ EF ψ
AG (φ ∧ ψ) ≡ AG φ ∧ AG ψ
¬AF φ ≡ EG ¬φ¬EF φ ≡ AG ¬φ
AFAF φ ≡ AF φ
EFEF φ ≡ EF φAGAG φ ≡ AG φ
EGEG φ ≡ EG φ
CTL vs. LTL CTL (31 / 40)
Outline
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 32/40
Outline
1. Some Definitions And Notation
2. LTL
3. CTL
4. CTL vs. LTL
CTL vs. LTL CTL vs. LTL (32 / 40)
Complexity
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 33/40
p y
|φ| = n, |M | = m
CTL: O (mn)
LTL: O (m2n) — (and PSpace complete)
CTL vs. LTL CTL vs. LTL (33 / 40)
Intuitiveness
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 34/40
IBM Journal or Research and Development: Formal VerificationMade Easy, 1997
We found only simple CTL equations to be
comprehensible; nontrivial equations are hard to
understand and prone to error.
CAV’98: On the Fly Model Checking, 1998
CTL is difficult to use for most users and requires a
new way of thinking about hardware.
CTL vs. LTL CTL vs. LTL (34 / 40)
LTL and CTL Equivalence
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 35/40
q
A CTL formula φCTL and an LTL formula φLTL are equivalent if they are satisfied by the same Kripke structures:
φCTL ≡ φLTL if and only if [(M M φCTL) ⇔ (M M φLTL)]
CTL vs. LTL CTL vs. LTL (35 / 40)
E
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 36/40
Any CTL formula necessitating E cannot be expressed in LTL.
Example: EXp
CTL vs. LTL CTL vs. LTL (36 / 40)
G
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 37/40
For any CTL formula φCTL and LTL formula φLTL such thatφCTL ≡ φLTL,
AG φCTL ≡ G φLTL
CTL vs. LTL CTL vs. LTL (37 / 40)
AFAXp
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 38/40
FXp ≡ XFp ≡ AXAFp ≡ AFAXp
The below example satisfies AXAFp , but not AFAXp . The latter of
these says that, starting in any state, along all paths we willeventually reach a state, all of whose immediate successors satisfyp .
s_0 s_1
s_2
s_3 s_4
p
p
CTL vs. LTL CTL vs. LTL (38 / 40)
AFAGp
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 39/40
FGp ≡ AFAGp
The below example satisfies FGp , but not AFAGp . The latter saysthat starting in any state, along all paths we will eventually reach apart of the model from which all successors satisfy p . But considerthe path cycling through s 0 — then s 1 will always be a potential
successor.
p p
CTL vs. LTL CTL vs. LTL (39 / 40)
GFp ⇒ GFq
7/27/2019 Fuctional Verification
http://slidepdf.com/reader/full/fuctional-verification 40/40
(GFp ≡ AGAFp ), but (GFp ⇒ GFq ) ≡ (AGAFp ⇒ AGAFq )
While GFp ≡ AGAFp , the above implications are not equivalent.
The LTL formula is an implication about paths, but the two partsof the CTL formula determine subsets of states independantly. Thebelow example satisfies AGAFp ⇒ AGAFq but not GFp ⇒ GFq .The CTL is trivially satisfied, because AGAFp is not satisfied. The
LTL is not satisfied, because the path cycling through s 0 foreversatisfies GFp but not GFq .
s_0 s_2s_1
p q
CTL vs. LTL CTL vs. LTL (40 / 40)