0 The evil that men do lives after them. Julius Caesar , by William - - PowerPoint PPT Presentation

0
SMART_READER_LITE
LIVE PREVIEW

0 The evil that men do lives after them. Julius Caesar , by William - - PowerPoint PPT Presentation

Temporal Logic: The Lesser of Three Evils Leslie Lamport Microsoft Research 0 The evil that men do lives after them. Julius Caesar , by William Shakespeare 0 Where I Started Making sure my concurrent algorithms were right. Proving the


slide-1
SLIDE 1

Temporal Logic: The Lesser of Three Evils

Leslie Lamport Microsoft Research

slide-2
SLIDE 2

The evil that men do lives after them.

Julius Caesar, by William Shakespeare

slide-3
SLIDE 3

Where I Started

Making sure my concurrent algorithms were right. Proving the Correctness of Multiprocess Programs (IEEE TSE, 1977) Proved: Safety Properties: Invariance Liveness Properties: P ❀ ◗

1

slide-4
SLIDE 4

Where I Started

Making sure my concurrent algorithms were right. Proving the Correctness of Multiprocess Programs (IEEE TSE, 1977) Proved: Safety Properties: Invariance Liveness Properties: P ❀ ◗

1

slide-5
SLIDE 5

Where I Started

Making sure my concurrent algorithms were right. Proving the Correctness of Multiprocess Programs (IEEE TSE, 1977) Proved: Safety Properties: Invariance Liveness Properties: P ❀ ◗

1

slide-6
SLIDE 6

Where I Started

Making sure my concurrent algorithms were right. Proving the Correctness of Multiprocess Programs (IEEE TSE, 1977) Proved: Safety Properties: Invariance Liveness Properties: P ❀ ◗

1

slide-7
SLIDE 7

Where I Started

Making sure my concurrent algorithms were right. Proving the Correctness of Multiprocess Programs (IEEE TSE, 1977) Proved: Safety Properties: Invariance Liveness Properties: P ❀ ◗

1

slide-8
SLIDE 8

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-9
SLIDE 9

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-10
SLIDE 10

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-11
SLIDE 11

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-12
SLIDE 12

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-13
SLIDE 13

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-14
SLIDE 14

My Introduction to Temporal Logic

In 1977–78, Susan Owicki started a little seminar on Amir’s 1977 FOCS paper. It sounded like formal nonsense to me, but I attended anyway. I discovered that: It was simple: One primitive temporal operator ✷ ✸

= ¬✷¬ It worked beautifully for liveness: P ❀ ◗

= ✷(P ⇒ ✸◗) Eventually, Susan and I wrote Proving Liveness Properties of Concurrent Programs (TOPLAS, 1982).

2

slide-15
SLIDE 15

Specification

Around 1980, my colleagues and I started trying to write specifications. Instead of stating some properties about an algorithm, say exactly what it has to do. Write the properties an algorithm/system/protocol should have.

3

slide-16
SLIDE 16

Specification

Around 1980, my colleagues and I started trying to write specifications. Instead of stating some properties about an algorithm, say exactly what it has to do. Write the properties an algorithm/system/protocol should have.

3

slide-17
SLIDE 17

Specification

Around 1980, my colleagues and I started trying to write specifications. Instead of stating some properties about an algorithm, say exactly what it has to do. Write the properties an algorithm/system/protocol should have.

3

slide-18
SLIDE 18

Specification

Around 1980, my colleagues and I started trying to write specifications. Instead of stating some properties about an algorithm, say exactly what it has to do. Write the properties an algorithm/system/protocol should have.

3

slide-19
SLIDE 19

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-20
SLIDE 20

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-21
SLIDE 21

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-22
SLIDE 22

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-23
SLIDE 23

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-24
SLIDE 24

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-25
SLIDE 25

Temporal logic seemed ideal for this.

We had been using an exogenous logic: | = ❋ (validity of ❋) depends on underlying system. Just had to switch to an endogenous logic: Single notion of | = . System specified by temporal logic formula ❙ | = ❋ becomes | = ❙ ⇒ ❋

4

slide-26
SLIDE 26

It Didn’t Work!

My colleagues spent days unsuccessfully trying to specify a FIFO queue. The reason was obvious: the simple logic of Amir’s 1977 paper was not expressive enough. An arms race ensued. Who could invent the biggest, most powerful temporal logic? I was not immune:

TIMESETS — A New Method for Temporal Reasoning About Programs (in LNCS 131, 1981)

5

slide-27
SLIDE 27

It Didn’t Work!

My colleagues spent days unsuccessfully trying to specify a FIFO queue. The reason was obvious: the simple logic of Amir’s 1977 paper was not expressive enough. An arms race ensued. Who could invent the biggest, most powerful temporal logic? I was not immune:

TIMESETS — A New Method for Temporal Reasoning About Programs (in LNCS 131, 1981)

5

slide-28
SLIDE 28

It Didn’t Work!

My colleagues spent days unsuccessfully trying to specify a FIFO queue. The reason was obvious: the simple logic of Amir’s 1977 paper was not expressive enough. An arms race ensued. Who could invent the biggest, most powerful temporal logic? I was not immune:

TIMESETS — A New Method for Temporal Reasoning About Programs (in LNCS 131, 1981)

5

slide-29
SLIDE 29

It Didn’t Work!

My colleagues spent days unsuccessfully trying to specify a FIFO queue. The reason was obvious: the simple logic of Amir’s 1977 paper was not expressive enough. An arms race ensued. Who could invent the biggest, most powerful temporal logic? I was not immune:

TIMESETS — A New Method for Temporal Reasoning About Programs (in LNCS 131, 1981)

5

slide-30
SLIDE 30

It Didn’t Work!

My colleagues spent days unsuccessfully trying to specify a FIFO queue. The reason was obvious: the simple logic of Amir’s 1977 paper was not expressive enough. An arms race ensued. Who could invent the biggest, most powerful temporal logic? I was not immune:

TIMESETS — A New Method for Temporal Reasoning About Programs (in LNCS 131, 1981)

5

slide-31
SLIDE 31

The Real Problem

Writing a specification as a list of properties doesn’t work. No one can understand the consequences of a list of properties.

6

slide-32
SLIDE 32

The Real Problem

Writing a specification as a list of properties doesn’t work. No one can understand the consequences of a list of properties.

6

slide-33
SLIDE 33

The Real Problem

Writing a specification as a list of properties doesn’t work. No one can understand the consequences of a list of properties.

6

slide-34
SLIDE 34

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-35
SLIDE 35

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-36
SLIDE 36

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-37
SLIDE 37

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-38
SLIDE 38

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-39
SLIDE 39

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-40
SLIDE 40

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-41
SLIDE 41

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Alpha memory specification model allowed this: Initially: ① = ② = 0 Process 1: if ① = 23 then ② := 42 Process 2: if ② = 42 then ① := 23 After execution: ① = 23, ② = 42

7

slide-42
SLIDE 42

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Itanium memory specification document. We wrote a TLA+ specification and used our tools to check the document’s tiny examples. We found several errors.

7

slide-43
SLIDE 43

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Itanium memory specification document. We wrote a TLA+ specification and used our tools to check the document’s tiny examples. We found several errors.

7

slide-44
SLIDE 44

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. The original Itanium memory specification document. We wrote a TLA+ specification and used our tools to check the document’s tiny examples. We found several errors.

7

slide-45
SLIDE 45

An Example: Weak Memory Models

Typically specified by axioms. Even their designers don’t understand them. No one can figure out from a list of axioms what a tiny bit of concurrent code can do.

8

slide-46
SLIDE 46

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-47
SLIDE 47

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-48
SLIDE 48

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-49
SLIDE 49

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-50
SLIDE 50

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-51
SLIDE 51

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-52
SLIDE 52

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-53
SLIDE 53

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-54
SLIDE 54

What works

Specify liveness with Amir’s original temporal logic. Specify safety by a state machine (abstract program). How to do this in temporal logic: Generalize Amir’s temporal logic. Don’t add new temporal operators. Do generalize elementary formulas from state predicates to transition predicates. But that’s another story.

9

slide-55
SLIDE 55

What is Evil About Temporal Logic

A fundamental rule of ordinary math: to prove ❆ ⇒ ❇, we assume ❆ and prove ❇. The Deduction Principle: P ◗ P ⇒ ◗ The deduction principle is not valid for temporal logic (and other modal logics). For example, a basic rule of temporal logic asserts that if P is true then it is always true. P ✷P

9

slide-56
SLIDE 56

What is Evil About Temporal Logic

A fundamental rule of ordinary math: to prove ❆ ⇒ ❇, we assume ❆ and prove ❇. The Deduction Principle: P ◗ P ⇒ ◗ The deduction principle is not valid for temporal logic (and other modal logics). For example, a basic rule of temporal logic asserts that if P is true then it is always true. P ✷P

9

slide-57
SLIDE 57

What is Evil About Temporal Logic

A fundamental rule of ordinary math: to prove ❆ ⇒ ❇, we assume ❆ and prove ❇. The Deduction Principle: P ◗ P ⇒ ◗ The deduction principle is not valid for temporal logic (and other modal logics). For example, a basic rule of temporal logic asserts that if P is true then it is always true. P ✷P

9

slide-58
SLIDE 58

What is Evil About Temporal Logic

A fundamental rule of ordinary math: to prove ❆ ⇒ ❇, we assume ❆ and prove ❇. The Deduction Principle: P ◗ P ⇒ ◗ The deduction principle is not valid for temporal logic (and other modal logics). For example, a basic rule of temporal logic asserts that if P is true then it is always true. P ✷P

9

slide-59
SLIDE 59

What is Evil About Temporal Logic

A fundamental rule of ordinary math: to prove ❆ ⇒ ❇, we assume ❆ and prove ❇. The Deduction Principle: P ◗ P ⇒ ◗ The deduction principle is not valid for temporal logic (and other modal logics). For example, a basic rule of temporal logic asserts that if P is true then it is always true. P ✷P

9

slide-60
SLIDE 60

From P ◗ P ⇒ ◗ and P ✷P by substituting ✷P for ◗ we deduce P ⇒ ✷P which asserts that if P is true now then it is always true.

10

slide-61
SLIDE 61

From P ◗ P ⇒ ◗ and P ✷P by substituting ✷P for ◗ we deduce P ⇒ ✷P which asserts that if P is true now then it is always true.

10

slide-62
SLIDE 62

From P ◗ P ⇒ ◗ and P ✷P by substituting ✷P for ◗ we deduce P ⇒ ✷P which asserts that if P is true now then it is always true.

10

slide-63
SLIDE 63

From P ◗ P ⇒ ◗ and P ✷P by substituting ✷P for ◗ we deduce P ⇒ ✷P which asserts that if P is true now then it is always true.

10

slide-64
SLIDE 64

From P ◗ P ⇒ ◗ and P ✷P by substituting ✷P for ◗ we deduce P ⇒ ✷P which asserts that if P is true now then it is always true. ★★★★ ★★★★★ ★★ ★★★★★ ★★ ★★★★★ ★★ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝ ❝

N O T

10

slide-65
SLIDE 65

In modal logics, implication (P ⇒ ◗) and inference ( P ◗ ) are different. This is confusing. Martín Abadi and I once believed a false result for several days because this confused us. A logic that can confuse Martín is evil.

10

slide-66
SLIDE 66

In modal logics, implication (P ⇒ ◗) and inference ( P ◗ ) are different. This is confusing. Martín Abadi and I once believed a false result for several days because this confused us. A logic that can confuse Martín is evil.

10

slide-67
SLIDE 67

In modal logics, implication (P ⇒ ◗) and inference ( P ◗ ) are different. This is confusing. Martín Abadi and I once believed a false result for several days because this confused us. A logic that can confuse Martín is evil.

10

slide-68
SLIDE 68

In modal logics, implication (P ⇒ ◗) and inference ( P ◗ ) are different. This is confusing. Martín Abadi and I once believed a false result for several days because this confused us. A logic that can confuse Martín is evil.

10

slide-69
SLIDE 69

Greater Evil #1

Temporal logic is modal because it has an implicit time variable. A solution: make time explicit. For example: P ❀ ◗ becomes ∀ t : (P(t) ⇒ ∃ s ≥ t : ◗(s)) . This makes formulas ugly and hard to understand. Trying to eliminate this is what led Amir to temporal logic. (He was inspired by Nissim Francez’s thesis.)

11

slide-70
SLIDE 70

Greater Evil #1

Temporal logic is modal because it has an implicit time variable. A solution: make time explicit. For example: P ❀ ◗ becomes ∀ t : (P(t) ⇒ ∃ s ≥ t : ◗(s)) . This makes formulas ugly and hard to understand. Trying to eliminate this is what led Amir to temporal logic. (He was inspired by Nissim Francez’s thesis.)

11

slide-71
SLIDE 71

Greater Evil #1

Temporal logic is modal because it has an implicit time variable. A solution: make time explicit. For example: P ❀ ◗ becomes ∀ t : (P(t) ⇒ ∃ s ≥ t : ◗(s)) . This makes formulas ugly and hard to understand. Trying to eliminate this is what led Amir to temporal logic. (He was inspired by Nissim Francez’s thesis.)

11

slide-72
SLIDE 72

Greater Evil #1

Temporal logic is modal because it has an implicit time variable. A solution: make time explicit. For example: P ❀ ◗ becomes ∀ t : (P(t) ⇒ ∃ s ≥ t : ◗(s)) . This makes formulas ugly and hard to understand. Trying to eliminate this is what led Amir to temporal logic. (He was inspired by Nissim Francez’s thesis.)

11

slide-73
SLIDE 73

Greater Evil #1

Temporal logic is modal because it has an implicit time variable. A solution: make time explicit. For example: P ❀ ◗ becomes ∀ t : (P(t) ⇒ ∃ s ≥ t : ◗(s)) . This makes formulas ugly and hard to understand. Trying to eliminate this is what led Amir to temporal logic. (He was inspired by Nissim Francez’s thesis.)

11

slide-74
SLIDE 74

Greater Evil #1

Temporal logic is modal because it has an implicit time variable. A solution: make time explicit. For example: P ❀ ◗ becomes ∀ t : (P(t) ⇒ ∃ s ≥ t : ◗(s)) . This makes formulas ugly and hard to understand. Trying to eliminate this is what led Amir to temporal logic. (He was inspired by Nissim Francez’s thesis.)

11

slide-75
SLIDE 75

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-76
SLIDE 76

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-77
SLIDE 77

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-78
SLIDE 78

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-79
SLIDE 79

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-80
SLIDE 80

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-81
SLIDE 81

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-82
SLIDE 82

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-83
SLIDE 83

Greater Evil #2

Use a programming logic. Some programming logics: Hoare Logic (Tony Hoare 1968)

Dynamic Logic (Vaughan Pratt 1974) Weakest Preconditions (Edsger Dijkstra 1975) Action Systems (Ralph Back ∼1983) What they have in common: programs appear in formulas of the “logic”. Why are they evil? First a digression.

12

slide-84
SLIDE 84

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-85
SLIDE 85

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-86
SLIDE 86

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-87
SLIDE 87

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-88
SLIDE 88

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-89
SLIDE 89

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-90
SLIDE 90

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-91
SLIDE 91

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-92
SLIDE 92

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-93
SLIDE 93

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while Two-Phase Handshake, an important hardware protocol

14

slide-94
SLIDE 94

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . See festschrift for Willem-Paul de Roever. Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while

15

slide-95
SLIDE 95

We can derive Program 2 from Program 1 by substituting ♣ + q mod 2 for ① . See festschrift for Willem-Paul de Roever. Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while

15

slide-96
SLIDE 96

A derivation is a refinement proof run backwards. Refinement is substitution. Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while

15

slide-97
SLIDE 97

A derivation is a refinement proof run backwards. Refinement is substitution. Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while

15

slide-98
SLIDE 98

How do you substitute ♣ + q mod 2 for ① in a program? It can’t be done. Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while

16

slide-99
SLIDE 99

How do you substitute ♣ + q mod 2 for ① in a program? It can’t be done. Program 1: initially ① = 0 while TRUE do if ① = 0 then Pr♦❞ else ❈♦♥s end if; ① := ① + 1 mod 2 end while Program 2: initially ♣ = q = 0 Process 1: while TRUE do await ♣ = q ; Prod ; ♣ := ♣ + 1 mod 2 end while Process 2: while TRUE do await ♣ = q ; Cons ; q := q + 1 mod 2 end while

16

slide-100
SLIDE 100

Why Programming Logics are Evil

Substitution of an expression for a variable is a fundamental

  • peration of mathematics.

A logic that doesn’t permit substitution is evil. Program refinement is based on substitution. A programming logic that doesn’t permit substitution is especially evil. Refinement by substitution is not a problem with temporal logic. Temporal logic is a lesser evil.

17

slide-101
SLIDE 101

Why Programming Logics are Evil

Substitution of an expression for a variable is a fundamental

  • peration of mathematics.

A logic that doesn’t permit substitution is evil. Program refinement is based on substitution. A programming logic that doesn’t permit substitution is especially evil. Refinement by substitution is not a problem with temporal logic. Temporal logic is a lesser evil.

17

slide-102
SLIDE 102

Why Programming Logics are Evil

Substitution of an expression for a variable is a fundamental

  • peration of mathematics.

A logic that doesn’t permit substitution is evil. Program refinement is based on substitution. A programming logic that doesn’t permit substitution is especially evil. Refinement by substitution is not a problem with temporal logic. Temporal logic is a lesser evil.

17

slide-103
SLIDE 103

Why Programming Logics are Evil

Substitution of an expression for a variable is a fundamental

  • peration of mathematics.

A logic that doesn’t permit substitution is evil. Program refinement is based on substitution. A programming logic that doesn’t permit substitution is especially evil. Refinement by substitution is not a problem with temporal logic. Temporal logic is a lesser evil.

17

slide-104
SLIDE 104

Why Programming Logics are Evil

Substitution of an expression for a variable is a fundamental

  • peration of mathematics.

A logic that doesn’t permit substitution is evil. Program refinement is based on substitution. A programming logic that doesn’t permit substitution is especially evil. Refinement by substitution is not a problem with temporal logic. Temporal logic is a lesser evil.

17

slide-105
SLIDE 105

Why Programming Logics are Evil

Substitution of an expression for a variable is a fundamental

  • peration of mathematics.

A logic that doesn’t permit substitution is evil. Program refinement is based on substitution. A programming logic that doesn’t permit substitution is especially evil. Refinement by substitution is not a problem with temporal logic. Temporal logic is a lesser evil.

17

slide-106
SLIDE 106

A Necessary Evil

Temporal logic is the best way I know of to reason about systems—especially for liveness properties. Someone as good as Amir would not have done anything evil unless it was necessary. We are all grateful that he did it. I am grateful that I had the privilege of being his colleague. He was a great scientist and a wonderful human being.

17

slide-107
SLIDE 107

A Necessary Evil

Temporal logic is the best way I know of to reason about systems—especially for liveness properties. Someone as good as Amir would not have done anything evil unless it was necessary. We are all grateful that he did it. I am grateful that I had the privilege of being his colleague. He was a great scientist and a wonderful human being.

17

slide-108
SLIDE 108

A Necessary Evil

Temporal logic is the best way I know of to reason about systems—especially for liveness properties. Someone as good as Amir would not have done anything evil unless it was necessary. We are all grateful that he did it. I am grateful that I had the privilege of being his colleague. He was a great scientist and a wonderful human being.

17

slide-109
SLIDE 109

A Necessary Evil

Temporal logic is the best way I know of to reason about systems—especially for liveness properties. Someone as good as Amir would not have done anything evil unless it was necessary. We are all grateful that he did it. I am grateful that I had the privilege of being his colleague. He was a great scientist and a wonderful human being.

17

slide-110
SLIDE 110

A Necessary Evil

Temporal logic is the best way I know of to reason about systems—especially for liveness properties. Someone as good as Amir would not have done anything evil unless it was necessary. We are all grateful that he did it. I am grateful that I had the privilege of being his colleague. He was a great scientist and a wonderful human being.

17

slide-111
SLIDE 111

A Necessary Evil

Temporal logic is the best way I know of to reason about systems—especially for liveness properties. Someone as good as Amir would not have done anything evil unless it was necessary. We are all grateful that he did it. I am grateful that I had the privilege of being his colleague. He was a great scientist and a wonderful human being.

17

slide-112
SLIDE 112

Thank you.

17