Linear Temporal Logic LTL

20
Understanding LTL By : Anit Thapaliya Software Engineering Department of Computer Science Kyonggi University, South Korea

Transcript of Linear Temporal Logic LTL

Page 1: Linear Temporal Logic LTL

Understanding LTLBy :

Anit Thapaliya Software Engineering

Department of Computer Science Kyonggi University, South Korea

Page 2: Linear Temporal Logic LTL

It is temporal logic with connectives that allow us to refer to the future.

It models the time as a sequence of states, extending infinitely to the future.

Definition

Page 3: Linear Temporal Logic LTL

ϕ ::= true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ | ϕ1Uϕ2Where, p belongs to APX= ‘next’: ϕ is true at next stepU= ‘until’: ϕ2 is true at some point, ϕ1 is true until that time

Syntax

Page 4: Linear Temporal Logic LTL

ϕ := true |

Explanation LTL

…{p1,p2} {p1,p2} {p2} {p1,p2} {p2}

Page 5: Linear Temporal Logic LTL

ϕ := true | p |

Explanation LTL

p = p1, p2, p3, p4, …

{p1,p2} {p2} {p1,p2} {p2}

Where p = AP (Every atomic proposition is LTL Formula)

{p1,p2}

Page 6: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ |

Explanation LTL

…¬P1{p1} {p2} {p2} {p2}

Where p = AP

{p2}

¬ϕ = if ϕ is an LTL formula then not of phi (¬ϕ) is also an LTL formula

Look at the first state it does not satisfy p1. hence, ¬P1 is true

Page 7: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ | ϕ1^ϕ2 |

Explanation LTL

P1 ^ P2

{p1,p2} {p2} {p1,p2} {p2}

Where p = AP

{p1,p2}

Φ1 & Φ1 are LTL Formual, then p1 & p2 are LTL formula

Look at the first state it satisfy p1 and p2. hence, P1 & P2 is true

^ stands for And

Page 8: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ |

Explanation LTL

Xp1 is true Xp2 is not true

X¬p2 is true

{p1} {p2} {p2} {p2}

Where p = AP

{p2}

If Φ is an LTL formula then, XΦ is also an LTL formula

Earlier, we are verifying the states by looking the first part now with Xp1 operator we have to look to next part. If the following part satisfy p1 then it is true. Note: Focused on second part following the first in sequence.

X stands for Next

Page 9: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ | ϕ1Uϕ2

Explanation LTL

p1 U p2

{p1} {p1} {p2} {p1}

Where p = AP

{p1}

If Φ1, Φ2 are LTL formula then, p1, p2 also LTL formula

We going further states in this part. That is p2 is true at some point in the future, until that point where p2 is p1 must be true.

Or p2 should definitely true at some point until when p1 must be true.

U stands for Until

Page 10: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ | ϕ1Uϕ2 Some Example

¬(p1 U p2)

{p1} {} {p2} {p1}

LTL Formula

{p1}

¬ (p1 U p2)

In this formula, p2 is true at some point which is true but until where p2 is true p1 is not completely true.Meaning

Here p2 is trueHere p1 is not true

Page 11: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ | ϕ1Uϕ2 Some LTL Formula

¬(p1 U p2)

{p1} {} {p2} {p1}

LTL Formula

{p1}

¬ (p1 U p2)

In this formula, p2 is true at some point which is true but until where p2 is true p1 is not completely true.Meaning

Here p2 is trueHere p1 is not true

Page 12: Linear Temporal Logic LTL

ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ | ϕ1Uϕ2 Some LTL Formula

…{p1} {p1} {p2} {p1,p3}

LTL Formula

{p1, p3}

p1 U (p2 ^ X p3)

In this formula, (p2 ^ X p3) is true at some point in the future until where p1 is also true. At the black state Xp3 is true because there is p3 in next state where as p2 is also true there. Lastly in all the yellow state p1 is present so p1 is true until (p2 ^ X p3).

Meaning (p2 ^ X p3) is true

Here p1 is true in all yellow state

Page 13: Linear Temporal Logic LTL

Word σ : A0 A1 A2 … ε AP Each Ai is a set of atomic proposition

Every words satisfies true Every sigma satisfy LTL formula Words (true) = AP

σ satisfies Pi if Pi ε A0 If the first letter A0 contain pi. Word s(Pi) = {A0 A1 A2 A3…. | Pi ε A0} ie Pi must

be in A0

Semantics of LTL Formula ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ

| ϕ1Uϕ2

Page 14: Linear Temporal Logic LTL

Word σ : A0 A1 A2 … ε AP Each Ai is a set of atomic proposition

σ satisfy ¬ϕ if σ does not satisfy ϕ Words(¬ϕ) = (Words (ϕ))’

σ satisfies ϕ1^ϕ2 if σ satisfy ϕ1 and σ satisfy ϕ2

Words (ϕ1^ϕ2) = Words (ϕ1) Intersection Words (ϕ2)

It means words must be common in ϕ1, ϕ2

Semantics of LTL Formula ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ

| ϕ1Uϕ2

Page 15: Linear Temporal Logic LTL

Word σ : A0 A1 A2 A3 … ε AP Each Ai is a set of atomic proposition

σ satisfies Xϕ if A1 A2 A3 ….. ϕWhat is words expect A0 must satisfy ϕ

σ satisfy ϕ1 U ϕ2 if there exists j Aj Aj+1….. Satisfy ϕ2 and for all Aj-1 (0<i<j Ai Ai+1 ) ….satisfy ϕ1

Semantics of LTL Formula ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ

| ϕ1Uϕ2

Except A0

Page 16: Linear Temporal Logic LTL

Word σ : A0 A1 A2 A3 … ε AP Each Ai is a set of atomic proposition

σ satisfies Xϕ if A1 A2 A3 ….. ϕWhat is words expect A0 must satisfy ϕWords (X ϕ)={A0 A1 A2…| A1 A2 .. ε Words (ϕ) }

σ satisfy ϕ1 U ϕ2 if there exists j Aj Aj+1….. Satisfy ϕ2 and for all Ai and Aj-1 (0<i<j Ai Ai+1 ) ….satisfy ϕ1

Words (ϕ1 U ϕ2) means all the suffix starting from Aj belongs to ϕ2 And all suffixes starting from Ai and Aj-1 belongs to ϕ1.

Semantics of LTL Formula ϕ := true | p | ¬ϕ | ϕ1^ϕ2 | Xϕ

| ϕ1Uϕ2

Page 17: Linear Temporal Logic LTL

σ satisfy true Uϕ if there exists j Aj Aj+1….. Satisfy ϕThis is because ture is always true for all Ai and Aj-1

(0<i<j Ai Ai+1 ) ….satisfy true

Semantics for Fϕ: true U ϕ

Semantics for Gϕ: ¬F ¬ϕ σ satisfy F ¬ϕ if there exists j Aj Aj+1…..

Satisfy ¬ϕσ satisfy ¬F ¬ϕ if σ does not Satisfy F ¬ϕ

Page 18: Linear Temporal Logic LTL

X & U are called temporal operators. Temporal operators means they are related

to time.

G global true now and forever (Rectangle in temporal logic )

F Eventually true now and some time in future (like diamond in temporal logic)

Page 19: Linear Temporal Logic LTL

Primary Temporal Logic Operators Eventually ◊ ϕ := true U ϕ (ϕ will become true at some

point in the future)Always □ ϕ := ¬◊¬ϕ ϕ is always true; (never

(eventually (¬ϕ))) p→ ◊q p implies eventually q (response) P → p U r p implies q until r (precedence) □ ◊p always eventually p (process) ◊□p eventually always p (stability) ◊p → ◊q eventually p implies eventually q (correlation)

More Operators & Formulas

Page 20: Linear Temporal Logic LTL

Thank You