Information Systems Analysis
Temporal Logicand Timed Automata
(3)
CTL logic
© Paweł Głuchowski, Wrocław University of Technologyversion 2.2
2
Contents of the lecture
Characteristics of CTL logic● Time in Computation Tree Logic (CTL)
● What can CTL be applied to?
3
Contents of the lecture
Syntax and semantics● Time structure (Kripke structure)
● Path operators
● Comparison of formulas with different path operators
4
Contents of the lecture
Exemplary laws● Complementarity of path operators
and duality of temporal operators
5
Contents of the lecture
Exemplary formulas● Examples
● Exercises
6
Characteristics of CTL logic
● Time in Computation Tree Logic (CTL)
● What can CTL be applied to?
7
Characteristics of CTL logic
Computation Tree Logic (CTL) is an “extension” of LTL with variants of the flow of time.
Time in CTL● Time is: point–like, branching (left–sided linear), left–sided
finite (unlimited from the “present” moment to the future).
8
Characteristics of CTL logic
What can CTL be applied to?● to describe and analyse deterministic and indeterministic:
● algorithms,
● properties of algorithms;
● where there may be different variants of the flow of time.
9
Syntax and semantics
● Time structure (Kripke structure)
● Path operators
● Comparison of formulas with different path operators
10
Syntax and semantics
Time structure (Kripke structure)M = (S,R,L)
S — a set of states (states represent moments): s0,s1,s2,…S
R — a binary relations between states: every state has at least one consequente state: (xS)(yS)((x,y)R)
L — labeling of every state with a set of atomic propositions AP which are true in this state: L:SxAP→{true, false}
The structure M is a tree, that consists of paths.
A path is a sequence of states (x = s0, s1, s2, ...): (i)((si,si+1)R)
11
Syntax and semantics
Time structure (Kripke structure)Let AP be a set of atomic propositions; let i{0,1,...}.
A formula is generated by rules S1, S2 and S3:
S1: every propositions pAP is a formula:
si╞ p if L(si,p) = true
S2: if p and q are formulas, then pq and p are formulas too:
si╞ pq if si╞ p and si╞ q si╞ p if not si╞ p
The rule S3 is different then the rule S3 of LTL !
12
Syntax and semantics
Time structure (Kripke structure)S3: if p and q are formulas, then A(pUq), E(pUq), AXp and EXpare formulas too:
si╞ A(pUq) if for every path si,si+1,…(k i) ((sk╞ q) (j, i j < k) (sj╞ p))
si╞ E(pUq) if for some path si,si+1,…(k i) ((sk╞ q) (j, i j < k) (sj╞ p))
si╞ AXp if for every path si,si+1,… si+1╞ p
si╞ EXp if for some path si,si+1,… si+1╞ p
13
Syntax and semantics
Path operators● Every temporal operator (U,X,F,G) is assigned to one path
operator A or E, e.g. AX, E(pUq), AGAF
(AGF is incorrect for lack of a path operator by F).
● Path operators allow to use temporal operators for:
A — every possible path (future flow of time),
E — some possible path (future flow of time).
Priority sequence of operators and logic connectives is the same as for LTL logic, only that every temporal operator makes an unbreakable pair with one path operator.
14
Syntax and semantics
Comparison of formulas with different path operators● AGp
— p is true at every state (moment)of every possible path (future):AGp A(p U false)
● EGp— p is true at every state (moment)of some possible path (future):EGp E(p U false)
blue point: si╞ pblack point: si╞ true
s0╞
s0╞
15
Syntax and semantics
Comparison of formulas with different path operators● AFp
— p is true at some state (moment)of every possible path (future):AFp A(true U p)
● EFp— p is true at some state (moment)of some possible path (future):EFp E(true U p)
blue point: si╞ pblack point: si╞ true
s0╞
s0╞
16
Syntax and semantics
Comparison of formulas with different path operators● A(pUq)
— on every possible path:q is true in some stateand p is true in allsubsequent states.
● E(pUq)— on some possible path:q is true in some stateand p is true in allsubsequente states.
blue point: si╞ porange point: si╞ qblack point: si╞ true
s0╞
s0╞
17
Exemplary laws
● Complementarity of path operatorsand duality of temporal operators
18
Exemplary laws
Complementarity of path operators and duality of temporal operators● AGp EFp
● EGp AFp
● AFp EGp
● EFp AGp
● AXp EXp
● EXp AXp
19
Exemplary formulas
● Examples
● Exercises
20
Exemplary formulas
Examples● s0╞ EFAGp
— from some moment of some future:at every moment of every possible consequentfuture p is true.
● s0╞ p (p AFq)— p is true now and, if p is true now,then q will be true at some momentof every possible consequente future.
blue point: si╞ p,orange point: si╞ q,black point: si╞ true
21
Exemplary formulas
Exercise 1.Which formulas are equal to the formula p EXE(pUq) ?
● p A(pUq)
● p E(pUq)
● p EFq E(pUq)
22
Exemplary formulas
Exercise 1.Which formulas are equal to the formula p EXE(pUq) ?
● p A(pUq) is not
● p E(pUq)
● p EFq E(pUq)
23
Exemplary formulas
Exercise 1.Which formulas are equal to the formula p EXE(pUq) ?
● p A(pUq) is not
● p E(pUq) is not
● p EFq E(pUq)
24
Exemplary formulas
Exercise 1.Which formulas are equal to the formula p EXE(pUq) ?
● p A(pUq) is not
● p E(pUq) is not
● p EFq E(pUq) (p EFq) E(pUq) p EFq E(pUq)
25
Exemplary formulas
Exercise 1.Which formulas are equal to the formula p EXE(pUq) ?
● p A(pUq) is not
● p E(pUq) is not
● p EFq E(pUq) (p EFq) E(pUq) p EFq E(pUq) is not
26
Exemplary formulas
Exercise 2.Which formulas come from the formula AFAGp ?
● AGAFp
● AGEFp
● EGEFp
27
Exemplary formulas
Exercise 2.Which formulas come from the formula AFAGp ?
● AGAFp does
● AGEFp
● EGEFp
28
Exemplary formulas
Exercise 2.Which formulas come from the formula AFAGp ?
● AGAFp does
● AGEFp does
● EGEFp
29
Exemplary formulas
Exercise 2.Which formulas come from the formula AFAGp ?
● AGAFp does
● AGEFp does
● EGEFp does
30
Exemplary formulas
Exercise 3.Write the following property as a CTL formula:
● p is true now and at every moment of some variant of the future,
● and p is true now and at every odd moment only of some other variant of the future:
31
Exemplary formulas
Exercise 3.Write the following property as a CTL formula:
● p is true now and at every moment of some variant of the future,
● and p is true now and at every odd moment only of some other variant of the future:
p EXEGp EX(p EG(p EX(p EG(pEXp))))
32
Exemplary formulas
Exercise 4.Write the following property as a CTL formula:
● If p is true, then:
● q is true at some three moments of every variant of subsequent future;
● or q is false at every moment of some variant of subsequent future except the moment when pis true:
33
Exemplary formulas
Exercise 4.Write the following property as a CTL formula:
● If p is true, then:
● q is true at some three moments of every variant of subsequent future;
● or q is false at every moment of some variant of subsequent future except the moment when pis true:
p AF(q AXAF(q AXAFq)) (q EXEGq)
The end
Literature:● E.A. Emerson “Temporal and modal logic”, 1995● R. Klimek “Zastosowanie logiki temporalnej w specyfikacji i weryfikacji oprogramowania – w stronę
czasu rzeczywistego”, in: “Wykłady zaproszone. Systemy Czasu Rzeczywistego 2000”, 2001