Is Constructive Logic relevant for Computer Science? Thorsten - - PowerPoint PPT Presentation

is constructive logic relevant for computer science
SMART_READER_LITE
LIVE PREVIEW

Is Constructive Logic relevant for Computer Science? Thorsten - - PowerPoint PPT Presentation

Is Constructive Logic relevant for Computer Science? Thorsten Altenkirch University of Nottingham BCTCS 05 p.1/16 Birth of Modern Mathematics BCTCS 05 p.2/16 Birth of Modern Mathematics Isaac Newton (1642 - 1727) BCTCS 05 p.2/16


slide-1
SLIDE 1

Is Constructive Logic relevant for Computer Science?

Thorsten Altenkirch University of Nottingham

BCTCS 05 – p.1/16

slide-2
SLIDE 2

Birth of Modern Mathematics

BCTCS 05 – p.2/16

slide-3
SLIDE 3

Birth of Modern Mathematics

Isaac Newton (1642 - 1727)

BCTCS 05 – p.2/16

slide-4
SLIDE 4

Birth of Modern Mathematics

Isaac Newton (1642 - 1727) 1687: Philosophiae Naturalis Principia Mathematica

BCTCS 05 – p.2/16

slide-5
SLIDE 5

19/20th century: Foundations?

BCTCS 05 – p.3/16

slide-6
SLIDE 6

19/20th century: Foundations?

Frege (1848-1925) Russell (1872-1970)

BCTCS 05 – p.3/16

slide-7
SLIDE 7
  • 1925: ZF set theory

Zermelo (1871-1953) Fraenkel (1891-1965)

BCTCS 05 – p.4/16

slide-8
SLIDE 8
  • 1925: ZF set theory

Zermelo (1871-1953) Fraenkel (1891-1965)

End of story ?

BCTCS 05 – p.4/16

slide-9
SLIDE 9

Mathematics is universal

The foundations which are good for mathematical reasoning within natural sciences are equally useful in Computer Science.

BCTCS 05 – p.5/16

slide-10
SLIDE 10

Constructivism?

BCTCS 05 – p.6/16

slide-11
SLIDE 11

Constructivism?

Computer Science focusses on constructive solutions to problems.

BCTCS 05 – p.6/16

slide-12
SLIDE 12

Constructivism?

Computer Science focusses on constructive solutions to problems.

Classical Mathematics is based on the platonic idea of truth.

BCTCS 05 – p.6/16

slide-13
SLIDE 13

Constructivism?

Computer Science focusses on constructive solutions to problems.

Classical Mathematics is based on the platonic idea of truth.

Constructive Mathematics is based on the notion of evidence or proof.

BCTCS 05 – p.6/16

slide-14
SLIDE 14

BHK: Programs are evidence

BCTCS 05 – p.7/16

slide-15
SLIDE 15

BHK: Programs are evidence

Brouwer (1881-1966) Heyting (1898-1980) Kolmogorov (1903-1987)

BCTCS 05 – p.7/16

slide-16
SLIDE 16 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, classically

BCTCS 05 – p.8/16

slide-17
SLIDE 17 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, classically

☞ ✌ ✍ ✎ ✏ ☞✒✑ ✓ ✌ ✔ ✍ ✕ ✖ ✏ ☞ ✑ ✌ ✔ ☞ ✑ ✍ ✎ ✏ ✗ ✖ ✘ ✘ ✘ ✘ ✘ ✙ ✘ ✘ ✙ ✘ ✘ ✙ ✘ ✙ ✘ ✘ ✘ ✙ ✘ ✙ ✙ ✘ ✘ ✙ ✙ ✘ ✘ ✘ ✘ ✙ ✙ ✘ ✙ ✙ ✙ ✙ ✙ ✙ ✘ ✙ ✙ ✙ ✙ ✙ ✙ ✙ ✙ ✙

BCTCS 05 – p.8/16

slide-18
SLIDE 18 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, classically

☞ ✌ ✍ ✎ ✏ ☞✒✑ ✓ ✌ ✔ ✍ ✕ ✖ ✏ ☞ ✑ ✌ ✔ ☞ ✑ ✍ ✎ ✏ ✗ ✖ ✘ ✘ ✘ ✘ ✘ ✙ ✘ ✘ ✙ ✘ ✘ ✙ ✘ ✙ ✘ ✘ ✘ ✙ ✘ ✙ ✙ ✘ ✘ ✙ ✙ ✘ ✘ ✘ ✘ ✙ ✙ ✘ ✙ ✙ ✙ ✙ ✙ ✙ ✘ ✙ ✙ ✙ ✙ ✙ ✙ ✙ ✙ ✙ ✁

The same truth table shows that

☞✒✑ ✓ ✌ ✔ ✍ ✕ ✚ ✗ ✓ ☞✒✑ ✌ ✕ ✔ ✓ ☞✒✑ ✍ ✕

BCTCS 05 – p.8/16

slide-19
SLIDE 19

BHK semantics

BCTCS 05 – p.9/16

slide-20
SLIDE 20

BHK semantics

Evidence for

☞ ✑ ✌

is given by pairs:

✛✢✜ ✣ ✤ ✥ ✑ ✦ ✏ ✓ ✥★✧ ✦ ✕

BCTCS 05 – p.9/16

slide-21
SLIDE 21

BHK semantics

Evidence for

☞ ✑ ✌

is given by pairs:

✛✢✜ ✣ ✤ ✥ ✑ ✦ ✏ ✓ ✥★✧ ✦ ✕ ✁

Evidence for

☞ ✔ ✌

is tagged evidence for

  • r

.

✩✫✪ ✛ ✪ ✥ ✔ ✦ ✏ ✬✮✭ ✯ ✥ ✰ ✬✮✭✱ ✦

BCTCS 05 – p.9/16

slide-22
SLIDE 22

BHK semantics

Evidence for

☞ ✑ ✌

is given by pairs:

✛✢✜ ✣ ✤ ✥ ✑ ✦ ✏ ✓ ✥★✧ ✦ ✕ ✁

Evidence for

☞ ✔ ✌

is tagged evidence for

  • r

.

✩✫✪ ✛ ✪ ✥ ✔ ✦ ✏ ✬✮✭ ✯ ✥ ✰ ✬✮✭✱ ✦ ✁

Evidence for

☞ ✏ ✗ ✌

is a program constructing evidence for

from evidence for

.

✛✢✜ ✣ ✤ ✥ ✏ ✗ ✦ ✏ ✥ ✲ ✦

BCTCS 05 – p.9/16

slide-23
SLIDE 23 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, constructively

BCTCS 05 – p.10/16

slide-24
SLIDE 24 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, constructively

✳✵✴ ✴ ✥ ✑ ✓ ✦ ✔ ✶ ✕ ✲ ✓ ✥ ✑ ✦ ✕ ✔ ✓ ✥ ✑ ✶ ✕ ✳ ✓ ✥ ✧ ✬✮✭ ✯ ✦ ✕ ✏ ✬✮✭ ✯ ✓ ✥★✧ ✦ ✕ ✳ ✓ ✥ ✧ ✬✮✭✱ ✶ ✕ ✏ ✬ ✭ ✱ ✓ ✥★✧ ✶ ✕

BCTCS 05 – p.10/16

slide-25
SLIDE 25 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, constructively

✳✵✴ ✴ ✥ ✑ ✓ ✦ ✔ ✶ ✕ ✲ ✓ ✥ ✑ ✦ ✕ ✔ ✓ ✥ ✑ ✶ ✕ ✳ ✓ ✥ ✧ ✬✮✭ ✯ ✦ ✕ ✏ ✬✮✭ ✯ ✓ ✥★✧ ✦ ✕ ✳ ✓ ✥ ✧ ✬✮✭✱ ✶ ✕ ✏ ✬ ✭ ✱ ✓ ✥★✧ ✶ ✕ ✁

The program is invertible, because the right hand sides are patterns.

BCTCS 05 – p.10/16

slide-26
SLIDE 26 ✂☎✄ ✆ ✝ ✞ ✟ ✠ ✡ ☛ ✆ ✂☎✄ ✝ ✠ ✞ ✆ ✂ ✄ ✟ ✠

, constructively

✳✵✴ ✴ ✥ ✑ ✓ ✦ ✔ ✶ ✕ ✲ ✓ ✥ ✑ ✦ ✕ ✔ ✓ ✥ ✑ ✶ ✕ ✳ ✓ ✥ ✧ ✬✮✭ ✯ ✦ ✕ ✏ ✬✮✭ ✯ ✓ ✥★✧ ✦ ✕ ✳ ✓ ✥ ✧ ✬✮✭✱ ✶ ✕ ✏ ✬ ✭ ✱ ✓ ✥★✧ ✶ ✕ ✁

The program is invertible, because the right hand sides are patterns.

This shows that the types are isomorphic.

BCTCS 05 – p.10/16

slide-27
SLIDE 27

Predicate logic

BCTCS 05 – p.11/16

slide-28
SLIDE 28

Predicate logic

Evidence for

✷✹✸ ✴ ✺✼✻ ✽ ✸

is a function

which assigns to each

✿ ✴ ✺

evidence for

✽ ✿

.

BCTCS 05 – p.11/16

slide-29
SLIDE 29

Predicate logic

Evidence for

✷✹✸ ✴ ✺✼✻ ✽ ✸

is a function

which assigns to each

✿ ✴ ✺

evidence for

✽ ✿

.

Evidence for

❀ ✸ ✴ ✺✼✻ ✽ ✸

is a pair

✓ ✿ ✧ ❁ ✕

where

✿ ✴ ✺

and

❁ ✴ ✽ ✿

.

BCTCS 05 – p.11/16

slide-30
SLIDE 30

Predicate logic

Evidence for

✷✹✸ ✴ ✺✼✻ ✽ ✸

is a function

which assigns to each

✿ ✴ ✺

evidence for

✽ ✿

.

Evidence for

❀ ✸ ✴ ✺✼✻ ✽ ✸

is a pair

✓ ✿ ✧ ❁ ✕

where

✿ ✴ ✺

and

❁ ✴ ✽ ✿

.

We need dependent types!

BCTCS 05 – p.11/16

slide-31
SLIDE 31

Propositions = Types

BCTCS 05 – p.12/16

slide-32
SLIDE 32

Propositions = Types

Per Martin-L¨

  • f

BCTCS 05 – p.12/16

slide-33
SLIDE 33

Propositions = Types

Per Martin-L¨

  • f

Martin-L¨

  • f Type Theory

BCTCS 05 – p.12/16

slide-34
SLIDE 34

Propositions = Types

Per Martin-L¨

  • f

Martin-L¨

  • f Type Theory

Implementations: NuPRL, LEGO, ALF , COQ, AGDA, Epigram . . .

BCTCS 05 – p.12/16

slide-35
SLIDE 35

BCTCS 05 – p.13/16

slide-36
SLIDE 36 ❂ ✁

We cannot prove

☞ ✔ ❃ ☞

, where

❃ ☞ ✏ ☞ ✏ ✗ ❄

, for an undecided proposition

.

BCTCS 05 – p.13/16

slide-37
SLIDE 37 ❂ ✁

We cannot prove

☞ ✔ ❃ ☞

, where

❃ ☞ ✏ ☞ ✏ ✗ ❄

, for an undecided proposition

.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❉✮❊ ❋❍● ■ ❅ ✔ ❃ ❉✮❊ ❋

BCTCS 05 – p.13/16

slide-38
SLIDE 38 ❂ ✁

We cannot prove

☞ ✔ ❃ ☞

, where

❃ ☞ ✏ ☞ ✏ ✗ ❄

, for an undecided proposition

.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❉✮❊ ❋❍● ■ ❅ ✔ ❃ ❉✮❊ ❋

is provable, i.e. Prime is decidable.

BCTCS 05 – p.13/16

slide-39
SLIDE 39 ❂ ✁

We cannot prove

☞ ✔ ❃ ☞

, where

❃ ☞ ✏ ☞ ✏ ✗ ❄

, for an undecided proposition

.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❉✮❊ ❋❍● ■ ❅ ✔ ❃ ❉✮❊ ❋

is provable, i.e. Prime is decidable.

Indeed, the proof is the program which decides Prime.

BCTCS 05 – p.13/16

slide-40
SLIDE 40 ❂ ✁

We cannot prove

☞ ✔ ❃ ☞

, where

❃ ☞ ✏ ☞ ✏ ✗ ❄

, for an undecided proposition

.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❉✮❊ ❋❍● ■ ❅ ✔ ❃ ❉✮❊ ❋

is provable, i.e. Prime is decidable.

Indeed, the proof is the program which decides Prime.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❏✫❇ ❑ ❈ ❅ ✔ ❃ ❏✫❇ ❑ ❈ ❅

BCTCS 05 – p.13/16

slide-41
SLIDE 41 ❂ ✁

We cannot prove

☞ ✔ ❃ ☞

, where

❃ ☞ ✏ ☞ ✏ ✗ ❄

, for an undecided proposition

.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❉✮❊ ❋❍● ■ ❅ ✔ ❃ ❉✮❊ ❋

is provable, i.e. Prime is decidable.

Indeed, the proof is the program which decides Prime.

✁ ✷✹❅ ✴ ❆✫❇ ❈ ✻ ❏✫❇ ❑ ❈ ❅ ✔ ❃ ❏✫❇ ❑ ❈ ❅

is not provable, because Halt is undecidable.

BCTCS 05 – p.13/16

slide-42
SLIDE 42

The classical Babelfish

BCTCS 05 – p.14/16

slide-43
SLIDE 43

The classical Babelfish

Classical reasoner says: Babelfish translates to:

BCTCS 05 – p.14/16

slide-44
SLIDE 44

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌

BCTCS 05 – p.14/16

slide-45
SLIDE 45

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕

BCTCS 05 – p.14/16

slide-46
SLIDE 46

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕ ❀ ✸ ✴ ✺✼✻ ✽ ✸

BCTCS 05 – p.14/16

slide-47
SLIDE 47

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕ ❀ ✸ ✴ ✺✼✻ ✽ ✸ ❃ ✷ ✸ ✴ ✺✼✻ ❃ ✽ ✸

BCTCS 05 – p.14/16

slide-48
SLIDE 48

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕ ❀ ✸ ✴ ✺✼✻ ✽ ✸ ❃ ✷ ✸ ✴ ✺✼✻ ❃ ✽ ✸ ✁

Negative translation

BCTCS 05 – p.14/16

slide-49
SLIDE 49

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕ ❀ ✸ ✴ ✺✼✻ ✽ ✸ ❃ ✷ ✸ ✴ ✺✼✻ ❃ ✽ ✸ ✁

Negative translation

✁ ☞ ✔ ❃ ☞

is traslated to

❃ ✓ ❃ ☞✒✑ ❃ ❃ ☞ ✕

BCTCS 05 – p.14/16

slide-50
SLIDE 50

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕ ❀ ✸ ✴ ✺✼✻ ✽ ✸ ❃ ✷ ✸ ✴ ✺✼✻ ❃ ✽ ✸ ✁

Negative translation

✁ ☞ ✔ ❃ ☞

is traslated to

❃ ✓ ❃ ☞✒✑ ❃ ❃ ☞ ✕

which is constructively provable.

BCTCS 05 – p.14/16

slide-51
SLIDE 51

The classical Babelfish

Classical reasoner says: Babelfish translates to:

☞ ✔ ✌ ❃ ✓ ❃ ☞✒✑ ❃ ✌ ✕ ❀ ✸ ✴ ✺✼✻ ✽ ✸ ❃ ✷ ✸ ✴ ✺✼✻ ❃ ✽ ✸ ✁

Negative translation

✁ ☞ ✔ ❃ ☞

is traslated to

❃ ✓ ❃ ☞✒✑ ❃ ❃ ☞ ✕

which is constructively provable.

A classical reasoner is somebody who is unable to say anything positive.

BCTCS 05 – p.14/16

slide-52
SLIDE 52

The Axiom of Choice ?

BCTCS 05 – p.15/16

slide-53
SLIDE 53

The Axiom of Choice ?

✁ ✷ ✸ ✴ ✺✼✻ ❀✹▲ ✴ ▼ ✻ ◆ ✸ ▲ ❖ P ❀ ✾ ✴ ✺ ✲ ▼ ✻ ✷ ✸ ✴ ✺✼✻ ◆ ✸ ✓ ✾ ✸ ✕

BCTCS 05 – p.15/16

slide-54
SLIDE 54

The Axiom of Choice ?

✁ ✷ ✸ ✴ ✺✼✻ ❀✹▲ ✴ ▼ ✻ ◆ ✸ ▲ ❖ P ❀ ✾ ✴ ✺ ✲ ▼ ✻ ✷ ✸ ✴ ✺✼✻ ◆ ✸ ✓ ✾ ✸ ✕

is provable constructively.

BCTCS 05 – p.15/16

slide-55
SLIDE 55

The Axiom of Choice ?

✁ ✷ ✸ ✴ ✺✼✻ ❀✹▲ ✴ ▼ ✻ ◆ ✸ ▲ ❖ P ❀ ✾ ✴ ✺ ✲ ▼ ✻ ✷ ✸ ✴ ✺✼✻ ◆ ✸ ✓ ✾ ✸ ✕

is provable constructively.

However, its negative translation:

✷✹✸ ✴ ✺✼✻ ❃ ✷ ▲ ✴ ▼ ✻ ❃ ◆ ✸ ▲ P ❖ P ❃ ✷ ✾ ✴ ✺ ✲ ▼ ✻ ❃ ✷ ✸ ✴ ✺✼✻ ◆ ✸ ✓ ✾ ✸ ✕

is not.

BCTCS 05 – p.15/16

slide-56
SLIDE 56

The Axiom of Choice ?

✁ ✷ ✸ ✴ ✺✼✻ ❀✹▲ ✴ ▼ ✻ ◆ ✸ ▲ ❖ P ❀ ✾ ✴ ✺ ✲ ▼ ✻ ✷ ✸ ✴ ✺✼✻ ◆ ✸ ✓ ✾ ✸ ✕

is provable constructively.

However, its negative translation:

✷✹✸ ✴ ✺✼✻ ❃ ✷ ▲ ✴ ▼ ✻ ❃ ◆ ✸ ▲ P ❖ P ❃ ✷ ✾ ✴ ✺ ✲ ▼ ✻ ❃ ✷ ✸ ✴ ✺✼✻ ◆ ✸ ✓ ✾ ✸ ✕

is not.

There is empirical evidence that CAC is consistent.

BCTCS 05 – p.15/16

slide-57
SLIDE 57

Summary

BCTCS 05 – p.16/16