Unit-7: Linear Temporal Logic B. Srivathsan Chennai Mathematical Institute NPTEL-course July - November 2015 1 / 13
Module 1: Introduction to LTL 2 / 13
Transition Systems + G, F, X, GF + NuSMV State-space Büchi Automata LTL CTL Automata explosion Unit: 5,6 Unit: 7,8 Unit: 4 Unit: 9 Unit: 10 3 / 13
AP = { p 1 , p 2 } Transition System Property { p 1 } { p 1 , p 2 } request=1 request=1 ready busy P request=0 request=0 ready busy { p 2 } {} Transition system TS satisfies property P if Traces( TS ) ⊆ P 4 / 13
Specifying properties G, F, X, GF ω -regular expressions Finite Automata 5 / 13
Specifying properties G, F, X, GF ω -regular expressions Finite Automata Here: Another formalism - Linear Temporal Logic 5 / 13
{ p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... φ := 6 / 13
{ p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... φ := true | 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 φ := true | p i | p i ∈ AP 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 p 1 ∧ p 2 φ := true | p i | φ 1 ∧ φ 2 | φ 1 , φ 2 : LTL formulas p i ∈ AP 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 p 1 ∧ p 2 φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | φ 1 , φ 2 : LTL formulas p i ∈ AP 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 p 1 ∧ p 2 ¬ p 1 { p 2 } { p 1 } { p 2 } { p 2 } { p 2 } ... φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | φ 1 , φ 2 : LTL formulas p i ∈ AP 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 p 1 ∧ p 2 ¬ p 1 { p 2 } { p 1 } { p 2 } { p 2 } { p 2 } ... X p 1 φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 , φ 2 : LTL formulas p i ∈ AP 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 p 1 ∧ p 2 ¬ p 1 { p 2 } { p 1 } { p 2 } { p 2 } { p 2 } ... X p 1 X ( p 1 ∧ ¬ p 2 ) φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 , φ 2 : LTL formulas p i ∈ AP 6 / 13
p 2 { p 1 , p 2 } { p 1 , p 2 } { p 2 } { p 1 , p 2 } { p 2 } ... p 1 p 1 ∧ p 2 ¬ p 1 { p 2 } { p 1 } { p 2 } { p 2 } { p 2 } ... X p 1 X ( p 1 ∧ ¬ p 2 ) { p 1 } { p 1 } { p 1 } { p 2 } { p 1 } ... p 1 U p 2 φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 φ 1 , φ 2 : LTL formulas p i ∈ AP 6 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) { p 1 , p 3 } { p 1 , p 3 } { p 1 } { p 1 } { p 2 } ... p 1 U ( p 2 ∧ X p 3 ) 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) { p 1 , p 3 } { p 1 , p 3 } { p 1 } { p 1 } { p 2 } ... p 1 U ( p 2 ∧ X p 3 ) { p 1 } { } { } { p 2 } { p 1 } ... X ( ¬ p 1 U p 2 ) 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) { p 1 , p 3 } { p 1 , p 3 } { p 1 } { p 1 } { p 2 } ... p 1 U ( p 2 ∧ X p 3 ) { p 1 } { } { } { p 2 } { p 1 } ... X ( ¬ p 1 U p 2 ) { p 2 } { p 3 } { p 2 } { } { p 1 } ... true U p 1 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) { p 1 , p 3 } { p 1 , p 3 } { p 1 } { p 1 } { p 2 } ... p 1 U ( p 2 ∧ X p 3 ) { p 1 } { } { } { p 2 } { p 1 } ... X ( ¬ p 1 U p 2 ) { p 2 } { p 3 } { p 2 } { } { p 1 } ... true U p 1 { p 1 } { p 1 , p 2 } { p 1 } { p 1 , p 2 } { p 1 } ... ¬ ( true U ¬ p 1 ) 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) { p 1 , p 3 } { p 1 , p 3 } { p 1 } { p 1 } { p 2 } ... p 1 U ( p 2 ∧ X p 3 ) { p 1 } { } { } { p 2 } { p 1 } ... X ( ¬ p 1 U p 2 ) { p 2 } { p 3 } { p 2 } { } { p 1 } ... F p 1 true U p 1 { p 1 } { p 1 , p 2 } { p 1 } { p 1 , p 2 } { p 1 } ... ¬ ( true U ¬ p 1 ) 7 / 13
φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 { p 1 } { p 1 } {} { p 2 } { p 1 } ... ¬ ( p 1 U p 2 ) { p 1 , p 3 } { p 1 , p 3 } { p 1 } { p 1 } { p 2 } ... p 1 U ( p 2 ∧ X p 3 ) { p 1 } { } { } { p 2 } { p 1 } ... X ( ¬ p 1 U p 2 ) { p 2 } { p 3 } { p 2 } { } { p 1 } ... F p 1 true U p 1 { p 1 } { p 1 , p 2 } { p 1 } { p 1 , p 2 } { p 1 } ... G p 1 ¬ ( true U ¬ p 1 ) 7 / 13
Derived operators ◮ φ 1 ∨ φ 2 : ¬ ( ¬ φ 1 ∧ ¬ φ 2 ) ( Or ) ◮ φ 1 → φ 2 : ¬ φ 1 ∨ φ 2 ( Implies ) ◮ F φ : true U φ ( Eventually ) ◮ G φ : ¬ F ¬ φ ( Always ) 8 / 13
G F φ ( Infinitely often ) φ φ φ ... ... ... ... 9 / 13
G F φ ( Infinitely often ) φ φ φ ... ... ... ... F G φ ( Eventually forever ) φ φ φ φ ... ... 9 / 13
Coming next: More examples 10 / 13
Atomic propositions AP = { crit 1 , wait 1 , crit 2 , wait 2 } crit 1 : pr1.location=crit wait 1 : pr1.location=wait crit 2 : pr2.location=crit wait 2 : pr2.location=wait non-crit wait non-crit wait ||| y:=y+1 y>0:y:=y-1 y:=y+1 y>0:y:=y-1 exiting crit exiting crit 11 / 13
◮ Safety: both processes cannot be in critical section simultaneously G ( ¬ crit 1 ∨ ¬ crit 2 ) ◮ Liveness: each process visits critical section infinitely often G F crit 1 ∧ G F crit 2 12 / 13
Summary φ := true | p i | φ 1 ∧ φ 2 | ¬ φ 1 | X φ | φ 1 U φ 2 … G φ : ¬ F ¬ φ … F φ : true U φ ( Always ) ( Eventually ) 13 / 13
Recommend
More recommend