34
Information Systems Analysis Temporal Logic and Timed Automata (3) CTL logic © Paweł Głuchowski, Wrocław University of Technology version 2.2

Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

Information Systems Analysis

Temporal Logicand Timed Automata

(3)

CTL logic

© Paweł Głuchowski, Wrocław University of Technologyversion 2.2

Page 2: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

2

Contents of the lecture

Characteristics of CTL logic● Time in Computation Tree Logic (CTL)

● What can CTL be applied to?

Page 3: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

3

Contents of the lecture

Syntax and semantics● Time structure (Kripke structure)

● Path operators

● Comparison of formulas with different path operators

Page 4: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

4

Contents of the lecture

Exemplary laws● Complementarity of path operators

and duality of temporal operators

Page 5: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

5

Contents of the lecture

Exemplary formulas● Examples

● Exercises

Page 6: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

6

Characteristics of CTL logic

● Time in Computation Tree Logic (CTL)

● What can CTL be applied to?

Page 7: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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).

Page 8: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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.

Page 9: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

9

Syntax and semantics

● Time structure (Kripke structure)

● Path operators

● Comparison of formulas with different path operators

Page 10: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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)

Page 11: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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 !

Page 12: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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

Page 13: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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.

Page 14: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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╞

Page 15: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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╞

Page 16: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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╞

Page 17: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

17

Exemplary laws

● Complementarity of path operatorsand duality of temporal operators

Page 18: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

18

Exemplary laws

Complementarity of path operators and duality of temporal operators● AGp EFp

● EGp AFp

● AFp EGp

● EFp AGp

● AXp EXp

● EXp AXp

Page 19: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

19

Exemplary formulas

● Examples

● Exercises

Page 20: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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

Page 21: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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)

Page 22: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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)

Page 23: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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)

Page 24: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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)

Page 25: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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

Page 26: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

26

Exemplary formulas

Exercise 2.Which formulas come from the formula AFAGp ?

● AGAFp

● AGEFp

● EGEFp

Page 27: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

27

Exemplary formulas

Exercise 2.Which formulas come from the formula AFAGp ?

● AGAFp does

● AGEFp

● EGEFp

Page 28: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

28

Exemplary formulas

Exercise 2.Which formulas come from the formula AFAGp ?

● AGAFp does

● AGEFp does

● EGEFp

Page 29: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

29

Exemplary formulas

Exercise 2.Which formulas come from the formula AFAGp ?

● AGAFp does

● AGEFp does

● EGEFp does

Page 30: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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:

Page 31: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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))))

Page 32: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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:

Page 33: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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)

Page 34: Information Systems Analysis Temporal Logic and Timed Automatastaff.iiar.pwr.wroc.pl/.../uploads/isa/logic_w3.pdf · 2015-11-22 · Information Systems Analysis Temporal Logic and

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