LTL Powerpoint
LTL Powerpoint
Andrei Popescu
University of Sheffield
These slides contain material from Denisa Diaconescu, Georg Struth and Traian Florin S, erb˘anut, ˘a
LTL
1
Overview
Formula equivalence
2
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”);
if (x = = 1) print(“hi”);
if (x = = 2) x = 0;
else x++;
}
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
p,r p,q p,r p,r p,q
x ←i x ←i 1 x ←i 2 x ←i 0 x ←i 1
0
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
p,r p,q p,r p,r p,q
x ←i x ←i 1 x ←i 2 x ←i 0 x ←i 1
0
Always p holds.
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
p,r p,q p,r p,r p,q
x ←i x ←i 1 x ←i 2 x ←i 0 x ←i 1
0
Always p holds. Always [p implies (q or r)].
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
p,r p,q p,r p,r p,q
x ←i x ←i 1 x ←i 2 x ←i 0 x ←i 1
0
Always p holds. Always [p implies (q or r)].
Never (q and r) holds.
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
p,r p,q p,r p,r p,q
x ←i x ←i 1 x ←i 2 x ←i 0 x ←i 1
0
Always p holds. Always [p implies (q or r)].
Never (q and r) holds. Always eventually q holds.
3
Basic Intuition
• Consider execution paths of a system into the future.
• Label states with atomic propositions p, q, r , . . . that hold along paths
at various points in time.
• LTL formulas can express regular patterns about these propositions
as execution proceeds.
while (x < 3) {
print(“hello”); Let p be “prints hello”,
if (x = = 1) print(“hi”); q be “prints hi”,
if (x = = 2) x = 0; r be “x is even”.
else x++; Say we start in a state where x is
} 0.
p,r p,q p,r p,r p,q
x ←i x ←i 1 x ←i 2 x ←i 0 x ←i 1
0
Always p holds. Always [p implies (q or r)].
Never (q and r) holds. Always eventually q holds.
3
Can you think of other
Syntax
4
Syntax
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U
ψ
4
Syntax
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U
ψ
Examples: □(p U (q U r ))
4
Syntax
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U
ψ
4
Syntax
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U
ψ
4
Syntax
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U
ψ
4
Syntax
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U ψ
ϕ ::= p | ¬ ϕ | ϕ ∨ ψ | ϕ ∧ ψ | ϕ → ψ | Q ϕ | ♦ ϕ | □ ϕ | ϕ U
ψ
5
Syntax – Examples and Non-Examples
5
Syntax – Examples and Non-Examples
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
6
Informal Semantics
7
Informal Semantics – Examples
•
s0 s1 s2 s3 s4 s5 s6 s7
7
Informal Semantics – Examples
•
s0 s1 s2 s3 s4 s5 s6 s7
•
s0 s1 s2 s3 s4 s5 s6 s7
7
Informal Semantics – Examples
□♦enabled means:
Always eventually enabled holds. In other words: Now and for all
future points, there is a point further up in the future where enabled
holds.
Another way to say this: enabled holds infinitely often.
•
•
s0 s1 s2 s3 s4 s5 s6 s7
8
Informal Semantics – Examples
□♦enabled means:
Always eventually enabled holds. In other words: Now and for all
future points, there is a point further up in the future where enabled
holds.
Another way to say this: enabled holds infinitely often.
•
•
s0 s1 s2 s3 s4 s5 s6 s7
♦ □ enabled means:
Eventually always enabled holds. In other words: Starting now or from
a future point, enabled will hold continuously for all points in the future.
•
•
s0 s1 s2 s3 s4 s5 s6 s7
8
Informal Semantics – Examples
□ (request → ♦grant) means:
Always [request implies eventually grant]. In other words: Always (i.e.,
now and at all points in the future), if request holds then eventually
grant holds (i.e., there exists a point further up in the future where
grant holds).
•
•
•
•
s0 s1 s2 s3 s4 s5 s6 s7
9
Informal Semantics – Examples
□ (request → ♦grant) means:
Always [request implies eventually grant]. In other words: Always (i.e.,
now and at all points in the future), if request holds then eventually
grant holds (i.e., there exists a point further up in the future where
grant holds).
•
•
•
•
s0 s1 s2 s3 s4 s5 s6 s7
•
s0 s1 s2 s3 s4 s5 s6 s7 9
Informal Semantics – Examples
□ (request → (request U grant)) means:
Always, request implies [request until grant]. In other words: At every
point in the future, if request holds than here exists a point further up in
the future where grant holds, and request holds continuously until that
point.
•
•
s0 s1 s2 s3 s4 s5 s6 s7
10
Informal Semantics – Examples
□ (request → (request U grant)) means:
Always, request implies [request until grant]. In other words: At every
point in the future, if request holds than here exists a point further up in
the future where grant holds, and request holds continuously until that
point.
•
•
s0 s1 s2 s3 s4 s5 s6 s7
s0
s1 s2 s3 s4 s5 s6 s7 s8
11
Practical Specification Patterns
□ (start →
active)
12
Practical Specification Patterns
□ (start → active)
□ (request → ♦grant)
12
Practical Specification Patterns
□ (start → active)
□ (request → ♦grant)
□♦enabled
12
Practical Specification Patterns
□ (start → active)
□ (request → ♦grant)
□♦enabled
□♦enabled → □♦run
12
Practical Specification Patterns
¬ ♦ □ ¬ active
13
Practical Specification Patterns
¬ ♦ □ ¬ active
• It is always the case that, when a lift is at the 2nd floor, travels
upwards and the 5th floor is requested, it will not change
direction until the 5th floor is reached:
13
Practical Specification Patterns
¬ ♦ □ ¬ active
• It is always the case that, when a lift is at the 2nd floor, travels
upwards and the 5th floor is requested, it will not change
direction until the 5th floor is reached:
13
Formal Semantics
14
Formal Semantics
14
Formal Semantics
14
Formal Semantics
14
Formal Semantics
14
Formal Semantics
14
Formal Semantics
14
Formal Semantics
14
Formal Semantics
15
Formal Semantics
15
Formal Semantics
15
Formal Semantics
15
Formal Semantics
15
Formal Semantics
15
Semantics of Atoms Illustrated
π |= p
p
s0 s1 s2 s3 s4
16
Semantics of “Next”
Illustrated
π |= Q p
p
s0 s1 s2 s3 s4
17
Semantics of “Eventually”
Illustrated
π |= ♦p
p
s0 s1 s2 s3 s4
18
Semantics of “Always” Illustrated
π |= □p
p p p p p
s0 s1 s2 s3 s4
19
Combined Semantics of “Eventually” and “Always”
Illustrated
π |= ♦□p
p p p
s0 s1 s2 s3 s4
20
Semantics of “Until” Illustrated
π |= p U
q
p p p q
s0 s1 s2 s3 s4
21
Exercise
s
22
Transition Systems and
Paths
23
Transition Systems and
Paths
23
Transition Systems and
Paths
23
Transition Systems and
Paths
23
Transition Systems and
Paths
23
Transition Systems and
Paths
such that every state has an outward transition, i.e., for all s1 ∈ S
there exists
s2 ∈ S with s1 → s2.
23
Transition Systems and
Paths
such that every state has an outward transition, i.e., for all s1 ∈ S
there exists
s2 ∈ S with s1 → s2.
23
Transition Systems and
Paths
such that every state has an outward transition, i.e., for all s1 ∈ S
there exists
s2 ∈ S with s1 → s2.
24
Transition Systems and Paths – Example
Recall the example with two parallel processes, where, for i ∈ {1, 2}:
• ni denotes “process i not in critical section”
• ri denotes “process i requesting to enter critical section”
• ci denotes “process i in critical section”
Atoms = {n1, n2, r1, r2, c1, c2}
n1n2
s0
s1 r1n2 n1r2 s5
c1n2 s2 s3 n1c2 s6
r1r2
s4 s7
c1r2 r1c2 24
Transition Systems and Paths – Example
Recall the example with two parallel processes, where, for i ∈ {1, 2}:
• ni denotes “process i not in critical section”
• ri denotes “process i requesting to enter critical section”
• ci denotes “process i in critical section”
Atoms = {n1, n2, r1, r2, c1, c2}
n1n2
s0
M = (S, → , L) where
• S = {s0, s1, . . . , s7}
s1 r1n2 n1r2 s5
• → = {(s0, s1), (s0,
s5), . . .}
c1n2 s2 s3 n1c2 s6 • L(s0) = {n1, n2}
r1r2 • L(s1) = {r1, n2}
s4 s7 • ...
c1r2 r1c2 24
Unwinding a Transition System
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree.
25
Unwinding a Transition System
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree. For example:
p, q
s0
s1 s2
q, r r
25
Unwinding a Transition System
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree. For example:
s0
p, q p, q
s1 q, r
s2
s0
r
s0 p, q
s2 s2
s1 s2 r r
q, r r s1 q, s2 s2 ...
r
r r
25
Unwinding a Transition System
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree. For example:
s0
p, q p, q
s1 q, r
s2
s0
r
s0 p, q
s2 s2
s1 s2 r r
q, r r s1 q, s2 s2 ...
r
r r
25
Unwinding a Transition System
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree. For example:
s0
p, q p, q
s1 q, r
s2
s0
r
s0 p, q
s2 s2
s1 s2 r r
q, r r s1 q, s2 s2 ...
r
r r
25
Unwinding a Transition System
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree. For example:
s0
p, q p, q
s1 q, r
s2
s0
r
s0 p, q
s2 s2
s1 s2 r r
q, r r s1 q, s2 s2 ...
r
r r
Visualise all paths from a given state s0 by unwinding the LTS to obtain an
infinite tree. For example:
s0
p, q p, q
s1 q, r
s2
s0
r
s0 p, q
s2 s2
s1 s2 r r
q, r r s1 q, s2 s2 ...
r
r r
26
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧
q
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧
q
2. M , s0 |= ¬r
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧
q
2. M , s0 |= ¬r
3. M , s0 |= Q r
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧ q
2. M , s0 |= ¬r
3. M , s0 |= Q r
4. M , s0 |= Q (q ∧ r
)
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧ q
2. M , s0 |= ¬r
3. M , s0 |= Q r
4. M , s0 |= Q (q ∧ r )
5. M , s0 |= □¬(p ∧ r
)
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
6. M , s2 |= □r
1. M , s0 |= p ∧ q
2. M , s0 |= ¬r
3. M , s0 |= Q r
4. M , s0 |= Q (q ∧ r )
5. M , s0 |= □¬(p ∧ r
)
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧ 6. M , s2 |= □r
q
2. M , s0 |= 7. M , s0 |=
¬r
3. M , s0 |= Q r ♦(¬q ∧ r ) →
♦□r
4. M , s0 |= Q (q ∧ r )
5. M , s0 |= □¬(p ∧ r
)
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧ 6. M , s2 |= □r
q
2. M , s0 |= 7. M , s0 |=
¬r
3. M , s0 |= Q r ♦(¬q ∧ r ) →
8. M , s0 |= □♦p
♦□r
4. M , s0 |= Q (q ∧ r )
5. M , s0 |= □¬(p ∧ r
)
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧ 6. M , s2 |= □r
q
2. M , s0 |= 7. M , s0 |=
¬r
3. M , s0 |= Q r ♦(¬q ∧ r ) →
8. M , s0 |= □♦p
♦□r
4. M , s0 |= Q (q ∧ r )
9. M , s0 |= □ ♦ p →
5. M , s0 |= □¬(p ∧ r □♦r
)
27
Satisfaction Relation for LTSs – Example
p, q
p, q s0
q, r
s0 s1 s2 r
s0
p, q
s2 r s2 r
s1 s2 s1
q, r ..
s2 r s2 r .
q, r r
.. .. ..
. . .
1. M , s0 |= p ∧ 6. M , s2 |= □r
q
2. M , s0 |= 7. M , s0 |=
¬r
3. M , s0 |= Q r ♦(¬q ∧ r ) →
8. M , s0 |= □♦p
♦□r
4. M , s0 |= Q (q ∧ r )
9. M , s0 |= □ ♦ p →
5. M , s0 |= □¬(p ∧ r □ ♦M
10. r , s |= □ ♦ r →
0
) □♦p
27
Homework Exercise 1
p
s0
p, r
p, q
• The safety property: Only one process may execute critical section
code at any point
• The liveness property: Whenever a process requests to enter its critical
section, it will eventually be allowed to do so.
• The non-blocking property: A process can always request to enter its
critical section.
29
Transition Systems and Paths – Example
Recall the example with two parallel processes, where, for i ∈ {1, 2}:
• ni denotes “process i not in critical section”
• ri denotes “process i requesting to enter critical section”
• ci denotes “process i in critical section”
Atoms = {n1, n2, r1, r2, c1, c2}
n1n2
s0
M = (S, → , L) where
• S = {s0, s1, . . . , s7}
s1 r1n2 n1r2 s5
• → = {(s0, s1), (s0,
s5), . . .}
c1n2 s2 s3 n1c2 s6 • L(s0) = {n1, n2}
r1r2 • L(s1) = {r1, n2}
s4 s7 • ...
c1r2 r1c2 30
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any
point. An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)).
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
which means (by the semantics of □ ) i
for all π ∈ Pathss L ¬(c1 ∧ c2)
0 ( M ) , for all i ≥ 0, π |=
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
which means (by the semantics of □ ) i
for all π ∈ Pathss L ¬(c1 ∧ c2)
0 ( M ) , for all i ≥ 0, π |=
which means (by the semantics of the propositional connectives and atoms)
for all π = t0t1t2 . . . ∈ Pathss0 ( M ) , for all i ≥ 0, not (c1 ∈ L(ti ) and c2 ∈ L(ti ))
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
which means (by the semantics of □ ) i
for all π ∈ Pathss L ¬(c1 ∧ c2)
0 ( M ) , for all i ≥ 0, π |=
which means (by the semantics of the propositional connectives and atoms)
for all π = t0t1t2 . . . ∈ Pathss0 ( M ) , for all i ≥ 0, not (c1 ∈ L(ti ) and c2 ∈
L(ti )) which is implied by
for all s ∈ S , not (c1 ∈ L(s) and c2 ∈ L(s))
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
which means (by the semantics of □ ) i
for all π ∈ Pathss L ¬(c1 ∧ c2)
0 ( M ) , for all i ≥ 0, π |=
which means (by the semantics of the propositional connectives and atoms)
for all π = t0t1t2 . . . ∈ Pathss0 ( M ) , for all i ≥ 0, not (c1 ∈ L(ti ) and c2 ∈
L(ti )) which is implied by
for all s ∈ S , not (c1 ∈ L(s) and c2 ∈ L(s))
which is true – can be checked by inspecting the system.
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
which means (by the semantics of □ ) i
for all π ∈ Pathss L ¬(c1 ∧ c2)
0 ( M ) , for all i ≥ 0, π |=
which means (by the semantics of the propositional connectives and atoms)
for all π = t0t1t2 . . . ∈ Pathss0 ( M ) , for all i ≥ 0, not (c1 ∈ L(ti ) and c2 ∈
L(ti )) which is implied by
for all s ∈ S , not (c1 ∈ L(s) and c2 ∈ L(s))
which is true – can be checked by inspecting the system.
31
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
Safety property: Only one process may execute critical section code at any point.
An LTL formula expressing this is ϕ = □ (¬(c1 ∧ c2)). Let’s prove that M , s0 |= ϕ.
M , s0 |= ϕ
means (by the semantics in an LTS)
for all π ∈ Pathss0 ( M ) , π |=L ϕ
which means (by the semantics of □ ) i
for all π ∈ Pathss L ¬(c1 ∧ c2)
0 ( M ) , for all i ≥ 0, π |=
which means (by the semantics of the propositional connectives and atoms)
for all π = t0t1t2 . . . ∈ Pathss0 ( M ) , for all i ≥ 0, not (c1 ∈ L(ti ) and c2 ∈
L(ti )) which is implied by
for all s ∈ S , not (c1 ∈ L(s) and c2 ∈ L(s))
which is true – can be checked by inspecting the system.
We conclude that M , s |= ϕ.
0
31
This was backwards reasoning, reducing the goal to something true.
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
An LTL formula expressing this is ϕ = □ ((r1 → ♦c 1 ) ∧ (r2 → ♦c2)).
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
We take π = s0(s1s3s7)∞.
π |=L ϕ
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
We take π = s0(s1s3s7)∞.
π |=L ϕ
implies, by the semantics of □ and ∧
(s1s3s7)∞ |=L r1 → ♦c1
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
We take π = s0(s1s3s7)∞.
π |=L ϕ
implies, by the semantics of □ and ∧
(s1s3s7)∞ |=L r1 → ♦c1
which implies, by the semantics of → and atoms (since r1 ∈ L(s1))
(s1s3s7)∞ |=L ♦c1
32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
We take π = s0(s1s3s7)∞.
π |=L ϕ
implies, by the semantics of □ and ∧
(s1s3s7)∞ |=L r1 → ♦c1
which implies, by the semantics of → and atoms (since r1 ∈ L(s1))
(s1s3s7)∞ |=L ♦c1
32
which implies, by the semantics of ♦ and atoms
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
We take π = s0(s1s3s7)∞.
π |=L ϕ
implies, by the semantics of □ and ∧
(s1s3s7)∞ |=L r1 → ♦c1
which implies, by the semantics of → and atoms (since r1 ∈ L(s1))
(s1s3s7)∞ |=L ♦c1
32
which implies, by the semantics of ♦ and atoms
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The liveness property: Whenever a process requests to enter its critical section,
it will eventually be allowed to do so.
prove that M , s0 |= ϕ.
By the semantics in an LTS, it suffices to find one π ∈ Paths0 ( M )
such that π |=L ϕ.
We take π = s0(s1s3s7)∞.
π |=L ϕ
implies, by the semantics of □ and ∧
(s1s3s7)∞ |=L r1 → ♦c1
which implies, by the semantics of → and atoms (since r1 ∈ L(s1))
(s1s3s7)∞ |=L ♦c1
which implies, by the semantics of ♦ and atoms 32
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The non-blocking property: A process can always request to enter its critical
section (provided it is not there already).
33
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The non-blocking property: A process can always request to enter its critical
section (provided it is not there already).
Let’s call a state t reachable from a state s if there is a finite path in M from s to
t.
33
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The non-blocking property: A process can always request to enter its critical
section (provided it is not there already).
Let’s call a state t reachable from a state s if there is a finite path in M from s to
t. We can express the non-blocking property for process 1 as follows:
NB1: For all states s reachable from s0 such that c1 ∈
; L(s), there exists a state t
33
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The non-blocking property: A process can always request to enter its critical
section (provided it is not there already).
Let’s call a state t reachable from a state s if there is a finite path in M from s to
t. We can express the non-blocking property for process 1 as follows:
NB1: For all states s reachable from s0 such that c1 ∈
; L(s), there exists a state t
33
Homework Exercise 2 – Solution
In the example with the two processes executed in parallel, determine whether
the following properties are expressible in LTL; and if yes, whether they hold (for s0). Let M
= (S, → , L) be that transition system.
The non-blocking property: A process can always request to enter its critical
section (provided it is not there already).
Let’s call a state t reachable from a state s if there is a finite path in M from s to
t. We can express the non-blocking property for process 1 as follows:
NB1: For all states s reachable from s0 such that c1 ∈
; L(s), there exists a state t
34
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
34
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
34
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
34
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
I
Clearly, NB1 is true for M and s0, but NB1 is not true for M and s0. Then,
34
by the choice of ϕ , we have M , s0 |= ϕ.
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
I
Clearly, NB1 is true for M and s0, but NB1 is not true for M and s0. Then,
34
by the choice of ϕ , we have
I
M , s0 |= ϕ. I I
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
I
Clearly, NB1 is true for M and s0, but NB1 is not true for M and s0. Then,
34
by the choice of ϕ , we have
I
M , s0 |= ϕ. I I
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
I
Clearly, NB1 is true for M and s0, but NB1 is not true for M and s0. Then,
34
by the choice of ϕ , we have
I
M , s0 |= ϕ. I I
Expressibility in LTL
NB1 expressible in LTL means: There exists an LTL formula ϕ such that, for all
Let’s assume NB1 expressible in LTL, and let ϕ be an LTL formula as above.
Let M = (S, → , L) and M I = (SI, → I , L I ) be the LTSs shown on the left
and on
r1
the right, respectively.
s0
s1
s0
I
Clearly, NB1 is true for M and s0, but NB1 is not true for M and s0. Then,
Homework: 34
by the choice ofModify the M
ϕ , we have
I
proof
, s0to|=show
ϕ. that NB is not expressible in LTL.
I I
Formula Equivalence
35
Formula Equivalence
35
Formula Equivalence
Note. If ϕ ≡ ψ, then ϕ and ψ will also be satisfied by the same LTSs in the
same states: Given any LTS M = (S, → , L) and any s ∈ S , we have
that M , s |= ϕ iff M , s |= ψ.
35
Formula Equivalence
Note. If ϕ ≡ ψ, then ϕ and ψ will also be satisfied by the same LTSs in the
same states: Given any LTS M = (S, → , L) and any s ∈ S , we have
that M , s |= ϕ iff M , s |= ψ.
35
Some Formula
Equivalences
Propositional tautologies:
¬(ϕ ∧ ψ) ≡ ¬ϕ ∨ ¬(ϕ ∨ ψ) ≡ ¬ϕ ∧
¬ψ ¬ψ
36
Some Formula Equivalences
Propositional tautologies:
¬(ϕ ∧ ψ) ≡ ¬ϕ ∨ ¬(ϕ ∨ ψ) ≡ ¬ϕ ∧
¬ψ ¬ψ
Duality laws:
¬Q ϕ ≡ Q¬ϕ ¬ □ϕ ≡ ¬ ♦ ϕ ≡ □¬ϕ
♦¬ ϕ
36
Some Formula Equivalences
Propositional tautologies:
¬(ϕ ∧ ψ) ≡ ¬ϕ ∨ ¬(ϕ ∨ ψ) ≡ ¬ϕ ∧
¬ψ ¬ψ
Duality laws:
¬Q ϕ ≡ Q¬ϕ ¬ □ϕ ≡ ¬ ♦ ϕ ≡ □¬ϕ
♦¬ ϕ
Distributive laws:
□ ( ϕ ∧ ψ) ≡ □ ϕ ∧ ♦ ( ϕ ∨ ψ) ≡ ♦ ϕ ∨ Q (ϕ U ψ) ≡ Q ϕ U
□ψ ♦ψ Qψ
36
Some Formula Equivalences
Propositional tautologies:
¬(ϕ ∧ ψ) ≡ ¬ϕ ∨ ¬(ϕ ∨ ψ) ≡ ¬ϕ ∧
¬ψ ¬ψ
Duality laws:
¬Q ϕ ≡ Q¬ϕ ¬ □ϕ ≡ ¬ ♦ ϕ ≡ □¬ϕ
♦¬ ϕ
Distributive laws:
□ ( ϕ ∧ ψ) ≡ □ ϕ ∧ ♦ ( ϕ ∨ ψ) ≡ ♦ ϕ ∨ Q (ϕ U ψ) ≡ Q ϕ U
□ψ ♦ψ Qψ
Note:
□ ( ϕ ∨ ψ) /≡ □ ϕ ∨ ♦ ( ϕ ∧ ψ) /≡ ♦ ϕ ∧ ♦ψ
□ψ
36
Some Formula Equivalences
Inter-definability laws:
♦ ϕ ≡ ¬ □¬ϕ □ ϕ ≡ ¬ ♦¬ ϕ ♦ϕ
≡ T Uϕ
37
Some Formula Equivalences
Inter-definability laws:
♦ ϕ ≡ ¬ □¬ϕ □ ϕ ≡ ¬ ♦¬ ϕ ♦ϕ
≡ T Uϕ
♦♦ϕ ≡ ♦ϕ □□ϕ ≡ □ϕ (ϕ U ψ) U ψ ≡ ϕ U ϕ U (ϕ U ψ) ≡ ϕ U
ψ ψ
37
Some Formula Equivalences
Inter-definability laws:
♦ ϕ ≡ ¬ □¬ϕ □ ϕ ≡ ¬ ♦¬ ϕ ♦ϕ
≡ T Uϕ
♦♦ϕ ≡ ♦ϕ □□ϕ ≡ □ϕ (ϕ U ψ) U ψ ≡ ϕ U ψ ϕ U (ϕ U ψ) ≡ ϕ U
ψ
Absorption laws:
37
Some Formula Equivalences
Inter-definability laws:
♦ ϕ ≡ ¬ □¬ϕ □ ϕ ≡ ¬ ♦¬ ϕ ♦ϕ
≡ T Uϕ
♦♦ϕ ≡ ♦ϕ □□ϕ ≡ □ϕ (ϕ U ψ) U ψ ≡ ϕ U ϕ U (ϕ U ψ) ≡ ϕ U
ψ ψ
Absorption laws:
Expansion
laws:
♦ϕ ≡ ϕ ∨ Q □ϕ ≡ ϕ ∧ Q ϕ U ψ ≡ ψ ∨ (ϕ ∧ Q (ϕ U
♦ϕ □ϕ ψ))
37
Proving Formula
Equivalences
♦ ϕ ≡ ¬ □¬ ϕ
38
Proving Formula Equivalences
♦ ϕ ≡ ¬ □¬ ϕ
38
Proving Formula Equivalences
♦ ϕ ≡ ¬ □¬ ϕ
38
Proving Formula
Equivalences
39
Proving Formula
Equivalences
39
Proving Formula Equivalences
39
Proving Formula Equivalences
39
Proving Formula Equivalences
39
Proving Formula Equivalences
39
Proving Formula Equivalences
39
Proving Formula Equivalences
39
Proving Formula
Equivalences
40
Proving Formula
Equivalences
Proving that π |= ¬ □ ¬ ϕ implies π |=
♦ϕ: Assume π |= ¬ □ ¬ ϕ.
40
Proving Formula Equivalences
40
Proving Formula Equivalences
40
Proving Formula Equivalences
40
Proving Formula Equivalences
40
Proving Formula Equivalences
40
Proving Formula Equivalences
40
Proving Formula Equivalences
Choose from the previous two slides any three laws (except for
the propositional tautologies) and prove them.
Hint. Take the approach shown above, using the semantics of formulas
and logical reasoning.
41
Summary of the Discussed
Concepts
42
Further Reading
43