An Introduction to Dialectica Realizability Pierre-Marie Pdrot - - PowerPoint PPT Presentation

an introduction to dialectica realizability
SMART_READER_LITE
LIVE PREVIEW

An Introduction to Dialectica Realizability Pierre-Marie Pdrot - - PowerPoint PPT Presentation

An Introduction to Dialectica Realizability Pierre-Marie Pdrot INRIA 22th July 2016 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pierre-Marie Pdrot (INRIA)


slide-1
SLIDE 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

An Introduction to Dialectica Realizability

Pierre-Marie Pédrot

INRIA

22th July 2016

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 1 / 101

slide-2
SLIDE 2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Once upon a time...

Cataclysm: Gödel’s incompleteness theorem (1931)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 2 / 101

slide-3
SLIDE 3

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Once upon a time...

Cataclysm: Gödel’s incompleteness theorem (1931) We do not fight alienation with an alienated logic.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 2 / 101

slide-4
SLIDE 4

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Once upon a time...

Cataclysm: Gödel’s incompleteness theorem (1931) We do not fight alienation with an alienated logic. Justifying arithmetic differently ... Intuitionistic logic!

Double-negation translation (1933) Dialectica (30’s, published in 1958)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 2 / 101

slide-5
SLIDE 5

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Once upon a time...

The name comes from the journal it was published in Also known as Gödel’s functional interpretation Strange beast typical of German-style logic

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 3 / 101

slide-6
SLIDE 6

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 4 / 101

slide-7
SLIDE 7

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Part I Undusting Dialectica

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 5 / 101

slide-8
SLIDE 8

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 6 / 101

slide-9
SLIDE 9

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Overview

What is Dialectica?

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 7 / 101

slide-10
SLIDE 10

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Overview

What is Dialectica? A realizability interpretation of HA That preserves intuitionistic content (∨, ∃)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 7 / 101

slide-11
SLIDE 11

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Overview

What is Dialectica? A realizability interpretation of HA That preserves intuitionistic content (∨, ∃) But interprets two semi-classical principles:

Markov’s principle Independence of premises

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 7 / 101

slide-12
SLIDE 12

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Overview

What is Dialectica? A realizability interpretation of HA That preserves intuitionistic content (∨, ∃) But interprets two semi-classical principles:

Markov’s principle Independence of premises

Let us discuss each point in more detail.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 7 / 101

slide-13
SLIDE 13

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Realizability?

Consider some target programming language Define a meta notion of a program p realizing a formula A p ⊩ A Extract proofs to programs π ⊢ A ⇝ π• ⊩ A Preserve soundness there is no p s.t. p ⊩ ⊥ Hope it realizes more there are p, A s.t. p ⊩ A but no π ⊢ A

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 8 / 101

slide-14
SLIDE 14

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Realizability!

Some interesting remarks: Dialectica somehow predates the notion of realizability

Kleene ∼ 1945 Kreisel ∼ 1959

Actually Kreisel realizability is a byproduct of Dialectica Kreisel: “Dialectica too complicated, let us do simpler!” You’ve been warned...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 9 / 101

slide-15
SLIDE 15

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Preserves intuitionistic content?

This means that: A realizer of A ∨ B provides you with a realizer of A or a realizer of B A realizer of ∃x : N. A provides you with an integer n and realizer of A[x := n]

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 10 / 101

slide-16
SLIDE 16

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Markov’s principle?

¬(∀n ∈ N. ¬P n) MP ∃n ∈ N. P n Requires P decidable Naive computational justification: unbounded loop

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 11 / 101

slide-17
SLIDE 17

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Independence of Premises?

P → ∃m ∈ N. Q m IP ∃m ∈ N. P → Q m Requires P computationally irrelevant (e.g. P := ¬P ′) Naive computational justification: dummy argument

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 12 / 101

slide-18
SLIDE 18

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Warning

I’ll present the historical version of Gödel Features a lot of horrible kludges, hacks and tricks

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 13 / 101

slide-19
SLIDE 19

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Warning

I’ll present the historical version of Gödel Features a lot of horrible kludges, hacks and tricks ... yet in a modernized fashion

⇝ in particular, stick to classical realizability Zeitgeist ⇝ terms, types, stacks, orthogonality...

So that it is readable by a computer scientist! Cleaned-up version afterwards

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 13 / 101

slide-20
SLIDE 20

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Warning

I’ll present the historical version of Gödel Features a lot of horrible kludges, hacks and tricks ... yet in a modernized fashion

⇝ in particular, stick to classical realizability Zeitgeist ⇝ terms, types, stacks, orthogonality...

So that it is readable by a computer scientist! Cleaned-up version afterwards

Wunderbar... Ça valide ça?

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 13 / 101

slide-21
SLIDE 21

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 14 / 101

slide-22
SLIDE 22

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Source theory

We will look at the translation of Heyting arithmetic. Intuitionistic First-order, one-sorted over integers Usual natural deduction on sequents Γ ⊢ A Usual axioms for integers t, u ::= x | 0 | S t | t + u | t × u A, B ::= ⊥ | ⊤ | A ∨ B | A ∧ B | A → B | ∀x. A | ∃x. A | t = u

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 15 / 101

slide-23
SLIDE 23

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Source theory

We will look at the translation of Heyting arithmetic. Intuitionistic First-order, one-sorted over integers Usual natural deduction on sequents Γ ⊢ A Usual axioms for integers t, u ::= x | 0 | S t | t + u | t × u A, B ::= ⊥ | ⊤ | A ∨ B | A ∧ B | A → B | ∀x. A | ∃x. A | t = u I’ll not present the rules for it is annoying...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 15 / 101

slide-24
SLIDE 24

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Target language

We’ll use Gödel’s famous System T. Pedantic name for simply-typed λ-calculus + integers Very limited, this will require a lot of hacks σ, τ ::= N | σ ⇒ τ M, N ::= x | λx. M | M N | 0 | S M | rec M N P

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 16 / 101

slide-25
SLIDE 25

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Target language (typing)

We’ll use usual simple types, together with

Γ ⊢ 0 : N Γ ⊢ M : N Γ ⊢ S M : N Γ ⊢ N0 : σ Γ ⊢ NS : N ⇒ σ ⇒ σ Γ ⊢ M : N Γ ⊢ rec N0 NS M : σ

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 17 / 101

slide-26
SLIDE 26

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Target language (reduction)

Again, this is the usual λ-calculus plus integer recursion. (λx. M) N →β M[x := N] rec N0 NS 0 →β N0 rec N0 NS (S M) →β NS M (rec N0 NS M)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 18 / 101

slide-27
SLIDE 27

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Meta-theory

I don’t want to dwell too much on this, but We’ll reason intuitionistically all of the time Mostly about term equivalence generated by →β No fancy stuff

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 19 / 101

slide-28
SLIDE 28

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Hacking in System T

There are many things we’re lacking in System T! booleans pairs algebraic datatypes ...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 20 / 101

slide-29
SLIDE 29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Hacking in System T

There are many things we’re lacking in System T! booleans pairs algebraic datatypes ... We actually need them for the Dialectica interpretation... Let us do a bit of assembly to emulate them.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 20 / 101

slide-30
SLIDE 30

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Booleans

That one is easy! B := N tt := 0 ff := S 0 if M then N else P := rec N (λ__. P) M Everything works as expected.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 21 / 101

slide-31
SLIDE 31

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sequences

That one is hairy... I’ll consider sequences of System T types: ⃗ σ System T terms: ⃗ M Variables: ⃗ x and I’ll write empty sequence ∅ concatenation ⃗ M; ⃗ N implicit lifting from an object to a singleton and forget about the⃗ · when I’m fed up with it.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 22 / 101

slide-32
SLIDE 32

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sequences (moar)

Due to associativity, there are natural notations for sequences: ⃗ σ ⇒ τ := σ1 ⇒ . . . ⇒ σn ⇒ τ (a type) σ ⇒ ⃗ τ := (σ ⇒ τ1) ; . . . ; (σ ⇒ τn) (a sequence of types)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 23 / 101

slide-33
SLIDE 33

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sequences (moar)

Due to associativity, there are natural notations for sequences: ⃗ σ ⇒ τ := σ1 ⇒ . . . ⇒ σn ⇒ τ (a type) σ ⇒ ⃗ τ := (σ ⇒ τ1) ; . . . ; (σ ⇒ τn) (a sequence of types) This induces a similar structure on abstraction and application: λ⃗

  • x. M

:= λx1 . . . xn. M (a term) λx. ⃗ M := (λx. M1) ; . . . ; (λx. Mn) (a sequence of terms) M ⃗ N := M N1 . . . Nn (a term) ⃗ M N := (M1 N) ; . . . ; (Mn N) (a sequence of terms)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 23 / 101

slide-34
SLIDE 34

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sequences (moar)

Due to associativity, there are natural notations for sequences: ⃗ σ ⇒ τ := σ1 ⇒ . . . ⇒ σn ⇒ τ (a type) σ ⇒ ⃗ τ := (σ ⇒ τ1) ; . . . ; (σ ⇒ τn) (a sequence of types) This induces a similar structure on abstraction and application: λ⃗

  • x. M

:= λx1 . . . xn. M (a term) λx. ⃗ M := (λx. M1) ; . . . ; (λx. Mn) (a sequence of terms) M ⃗ N := M N1 . . . Nn (a term) ⃗ M N := (M1 N) ; . . . ; (Mn N) (a sequence of terms) Typing and reduction are pointwise compatible with this sequencification.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 23 / 101

slide-35
SLIDE 35

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sequences (moar)

In particular, ∅ ⇒ τ := τ (a type) σ ⇒ ∅ := ∅ (a sequence of types) and λ∅. M := M (a term) λx. ∅ := ∅ (a sequence of terms) M ∅ := M (a term) ∅ N := ∅ (a sequence of terms)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 24 / 101

slide-36
SLIDE 36

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Gödel’s anatomy

To any HA formula A, associate a meta formula

Witness Counter Orthogonality

Sequence of types Sequence of types

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 25 / 101

slide-37
SLIDE 37

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Gödel’s anatomy

To any HA formula A, associate a meta formula

Witness Counter Orthogonality

Sequence of types Sequence of types

To any HA proof π ⊢ A, associate a meta proof of ∀⃗ x : C(A). AD[π•, ⃗ x] where π• : W(A)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 25 / 101

slide-38
SLIDE 38

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Building bridges

Intuitively, seen through Krivine’s realizability, W(A) ≡ |A|, typed truth values C(A) ≡ ||A||, typed falsity values M ⊩ A ≡ ∀⃗ x : C(A). M ⊥A ⃗ x (assumes implicitly M : W(A)) Yet, actually in Krivine realizability |A| ⊆ Λ and ||A|| ⊆ Π are untyped Orthogonality untyped as well: M ⊥ π ≡ ⟨M | π⟩ ⊆ ‚ M ⊩ A ≡ ∀π ∈ ||A||. M ⊥ π (Another alternative explanation as logical games.)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 26 / 101

slide-39
SLIDE 39

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Roadmap

We’re going to do the following in the next slides: Define W(·), C(·) and ⊥(·) by induction on the type State the soundness theorem abstractly Look at a few key cases from the proof and get an idea of the realizers Then we’ll have a look at what we got new.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 27 / 101

slide-40
SLIDE 40

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica translation (easy cases)

W(A ∧ B) := W(A) ; W(B) C(A ∧ B) := C(A) ; C(B) MA ⊥A ΠA MB ⊥B ΠB MA ; MB ⊥A∧B ΠA ; ΠB W(A ∨ B) := B ; W(A) ; W(B) C(A ∨ B) := C(A) ; C(B) MA ⊥A ΠA tt ; MA ; MB ⊥A∨B ΠA ; ΠB MB ⊥B ΠB ff ; MA ; MB ⊥A∨B ΠA ; ΠB

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 28 / 101

slide-41
SLIDE 41

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica translation (easy cases)

W(⊤) := ∅ C(⊤) := ∅ ∅ ⊥⊤ ∅ W(⊥) := ∅ C(⊥) := ∅ (no orthogonality) W(t = u) := ∅ C(t = u) := ∅ t = u ∅ ⊥t=u ∅

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 29 / 101

slide-42
SLIDE 42

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica translation (first-order)

W(∀x. A) := N ⇒ W(A) C(∀x. A) := N ; C(A) M N ⊥A[x:=N] Π M ⊥∀x. A N ; Π W(∃x. A) := N ; W(A) C(∃x. A) := N ⇒ C(A) M ⊥A[x:=N] Π N N ; M ⊥∃x. A Π

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 30 / 101

slide-43
SLIDE 43

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica translation (first-order)

W(∀x. A) := N ⇒ W(A) C(∀x. A) := N ; C(A) M N ⊥A[x:=N] Π M ⊥∀x. A N ; Π W(∃x. A) := N ; W(A) C(∃x. A) := N ⇒ C(A) M ⊥A[x:=N] Π N N ; M ⊥∃x. A Π

(I’m a bit cheating here for pedagogical purposes.)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 30 / 101

slide-44
SLIDE 44

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica translation: the wondrous intuitionistic arrow

The mysterious part of the Dialectica translation comes from the arrow... W(A → B) := (W(A) ⇒ W(B)) ; (W(A) ⇒ C(B) ⇒ C(A)) C(A → B) := W(A) ; C(B) if N ⊥A Φ N Π then M N ⊥B Π M ; Φ ⊥A→B N ; Π The witness of an arrow has a second, fancy component!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 31 / 101

slide-45
SLIDE 45

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Remarks

The W(·) translation corresponds essentially to Kreisel extraction. ... except for the arrow.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 32 / 101

slide-46
SLIDE 46

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Remarks

The W(·) translation corresponds essentially to Kreisel extraction. ... except for the arrow. Most of the logical content is pushed into the meta ... thanks to the orthogonality.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 32 / 101

slide-47
SLIDE 47

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Remarks

The W(·) translation corresponds essentially to Kreisel extraction. ... except for the arrow. Most of the logical content is pushed into the meta ... thanks to the orthogonality. Hacks are quite clear, e.g. A + B ∼ B × A × B

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 32 / 101

slide-48
SLIDE 48

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Easy result

Our realizability interpretation is trivially consistent. Theorem (Consistency) There is no System T sequence of terms M ⊩ ⊥.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 33 / 101

slide-49
SLIDE 49

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Easy result

Our realizability interpretation is trivially consistent. Theorem (Consistency) There is no System T sequence of terms M ⊩ ⊥.

Proof.

Assume such sequence M, then there should not be ⃗ x : C(⊥) by definition

  • f ⊥⊥. But C(⊥) ≡ ∅ and the empty sequence is trivially inhabited, which

contradicts the above statement. Note that we do have paraproofs of falsity...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 33 / 101

slide-50
SLIDE 50

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (overview)

We will now sketch the proof of the following statement. Theorem (Soundness) If ⊢HA A, then there is a sequence of System T terms M ⊩ A.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 34 / 101

slide-51
SLIDE 51

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (overview)

We will now sketch the proof of the following statement. Theorem (Soundness) If ⊢HA A, then there is a sequence of System T terms M ⊩ A. We will prove a generalized statement by induction on the proof. Theorem (Generalized soundness) If π : Γ1, . . . , Γn ⊢HA A, then there is: a sequence of terms π• : W(Γ) ⇒ W(A) n sequences of terms π◦

i : W(Γ) ⇒ C(A) ⇒ C(Γi)

s.t. for all M : W(Γ) and Π : C(A), if for all i ≤ n, Mi ⊥Γi π◦

i M Π

then π•M ⊥A Π

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 34 / 101

slide-52
SLIDE 52

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Enters technique

The theorem relies on two essential facts of the translation. All System T types are inhabited. The ⊥A relation is decidable in System T for all A, i.e. there is a term of type W(A) ⇒ C(A) ⇒ B which internalizes ⊥A.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 35 / 101

slide-53
SLIDE 53

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Enters technique

The theorem relies on two essential facts of the translation. All System T types are inhabited. The ⊥A relation is decidable in System T for all A, i.e. there is a term of type W(A) ⇒ C(A) ⇒ B which internalizes ⊥A.

Proof.

By induction on the considered type.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 35 / 101

slide-54
SLIDE 54

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Hack, hack, hack your bloat

This allows to define two families of System T terms: The dummy terms ✠A : C(A) The merge terms ⊕A : C(A) ⇒ C(A) ⇒ W(A) ⇒ C(A) s.t. for all Π, Ξ : C(A) and M : W(A), M ⊥A (Π ⊕M

A Ξ)

iff M ⊥A Π and M ⊥A Ξ.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 36 / 101

slide-55
SLIDE 55

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Hack, hack, hack your bloat

This allows to define two families of System T terms: The dummy terms ✠A : C(A) The merge terms ⊕A : C(A) ⇒ C(A) ⇒ W(A) ⇒ C(A) s.t. for all Π, Ξ : C(A) and M : W(A), M ⊥A (Π ⊕M

A Ξ)

iff M ⊥A Π and M ⊥A Ξ.

Proof.

Take an arbitrary inhabitant of C(A) for ✠A Define Π ⊕M

A Ξ := if M ⊥A Π then Ξ else Π

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 36 / 101

slide-56
SLIDE 56

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (Axiom)

Let us give the interpretation of the rule (axm) Γ1, . . . , Γn ⊢ Γk : axm• : W(Γ) ⇒ W(Γk) axm• := λx1 . . . xn. xk axm◦

k

: W(Γ) ⇒ C(Γk) ⇒ C(Γk) axm◦

k

:= λx1 . . . xn. λπ. π axm◦

i

: W(Γ) ⇒ C(Γk) ⇒ C(Γi) (i ̸= k) axm◦

i

:= λx1 . . . xn. λπ. ✠Γi

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 37 / 101

slide-57
SLIDE 57

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (Axiom)

Let us give the interpretation of the rule (axm) Γ1, . . . , Γn ⊢ Γk : axm• : W(Γ) ⇒ W(Γk) axm• := λx1 . . . xn. xk axm◦

k

: W(Γ) ⇒ C(Γk) ⇒ C(Γk) axm◦

k

:= λx1 . . . xn. λπ. π axm◦

i

: W(Γ) ⇒ C(Γk) ⇒ C(Γi) (i ̸= k) axm◦

i

:= λx1 . . . xn. λπ. ✠Γi We easily show for all γ : W(Γ) and π : C(Γk): ∧

i

γi ⊥Γi axm◦

i γ π

− → axm• γ ⊥Γk π

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 37 / 101

slide-58
SLIDE 58

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (Axiom)

Everything has been done implicitly with sequences in the previous slide! The actual demacroified sequence of terms is less palatable...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 38 / 101

slide-59
SLIDE 59

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (λ-abstraction)

Rule q : Γ, A ⊢ B p : Γ ⊢ A → B : p•        p•

+

: W(Γ) ⇒ W(A) ⇒ W(B) p•

+

:= λγ. λx. q• γ x p•

: W(Γ) ⇒ W(A) ⇒ C(B) ⇒ C(A) p•

:= λγ. λx. λπ. q◦

A γ x π

p◦

i

: W(Γ) ⇒ W(A) ⇒ C(B) ⇒ C(Γi) p◦

i

:= λγ. λx. λπ. q◦

Γi γ x π

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 39 / 101

slide-60
SLIDE 60

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (λ-abstraction)

Rule q : Γ, A ⊢ B p : Γ ⊢ A → B : p•        p•

+

: W(Γ) ⇒ W(A) ⇒ W(B) p•

+

:= λγ. λx. q• γ x p•

: W(Γ) ⇒ W(A) ⇒ C(B) ⇒ C(A) p•

:= λγ. λx. λπ. q◦

A γ x π

p◦

i

: W(Γ) ⇒ W(A) ⇒ C(B) ⇒ C(Γi) p◦

i

:= λγ. λx. λπ. q◦

Γi γ x π

Need to show for all γ : W(Γ), x : W(A) and π : C(B): ∧

i

γi ⊥Γi p◦

i γ x π

− → x ⊥A p•

− γ x π

− → p•

+ γ x ⊥B π

which comes directly from hypothesis on q.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 39 / 101

slide-61
SLIDE 61

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (application)

Rule q : Γ ⊢ A → B r : Γ ⊢ A p : Γ ⊢ B : p• : W(Γ) ⇒ W(B) p• := λγ. q•

+ γ (r• γ)

p◦

i

: W(Γ) ⇒ C(B) ⇒ C(Γi) p◦

i

:= λγ. λπ. (q◦

i γ (r• γ) π) ⊕γi Γi (r◦ i γ (q• − γ (r• γ) π))

Need to show for all γ : W(Γ) and π : C(B): ∧

i

γi ⊥Γi p◦

i γ π

− → p• γ ⊥B π which implies a bit of work...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 40 / 101

slide-62
SLIDE 62

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness (other cases)

Essentially, Nullary connectives are trivial The one atomic formula t = u is pushed back in the meta The (−)• translation is more or less identity on the underlying proof-term The (−)◦

i translation merges all available counters

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 41 / 101

slide-63
SLIDE 63

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Stepping back

We now see where the technical apparatus is needed. The ✠A terms are used to implement weakening The ⊕A terms are used to implement contraction Linear logicians should be jumping on their seats by now

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 42 / 101

slide-64
SLIDE 64

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Stepping back

We now see where the technical apparatus is needed. The ✠A terms are used to implement weakening The ⊕A terms are used to implement contraction Linear logicians should be jumping on their seats by now Note that this is not the standard presentation of Dialectica. Usually, realizers are not explicitly written Here, we can already get a rough idea of what is going on

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 42 / 101

slide-65
SLIDE 65

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Stepping back

We now see where the technical apparatus is needed. The ✠A terms are used to implement weakening The ⊕A terms are used to implement contraction Linear logicians should be jumping on their seats by now Note that this is not the standard presentation of Dialectica. Usually, realizers are not explicitly written Here, we can already get a rough idea of what is going on

Later!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 42 / 101

slide-66
SLIDE 66

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 43 / 101

slide-67
SLIDE 67

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

You are Here

We’ve proved the soudness theorem, therefore Dialectica is a realizability interpretation of HA.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 44 / 101

slide-68
SLIDE 68

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

You are Here

We’ve proved the soudness theorem, therefore Dialectica is a realizability interpretation of HA. We preserve good properties... Dialectica preserves positives. Yet, as for Kreisel and Krivine realizability, we get more! Dialectica interprets MP and IP. i.e. there are term sequences MP ⊩ MP and IP ⊩ IP.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 44 / 101

slide-69
SLIDE 69

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Constructivity

It is obvious to check that proofs of positive connectives are preserved! If b ; M1 ; M2 ⊩ A ∨ B then b tells you which realizer is the good one. If n ; M ⊩ ∃x. A then n is a correct witness and M realizes that. (Remember:) W(A ∨ B) := B ; W(A) ; W(B) W(∃x. A) := N ; W(A)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 45 / 101

slide-70
SLIDE 70

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Premises, what are they needed for?

P → ∃m. Q m IP ∃m. P → Q m This is only true for irrelevant P!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 46 / 101

slide-71
SLIDE 71

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Premises, what are they needed for?

P → ∃m. Q m IP ∃m. P → Q m This is only true for irrelevant P! Luckily, we can define this through the Dialectica. Definition (Irrelevance) A formula A is irrelevant whenever both W(A) = ∅ and C(A) = ∅.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 46 / 101

slide-72
SLIDE 72

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Premises, what are they needed for?

P → ∃m. Q m IP ∃m. P → Q m This is only true for irrelevant P! Luckily, we can define this through the Dialectica. Definition (Irrelevance) A formula A is irrelevant whenever both W(A) = ∅ and C(A) = ∅. Theorem (Irrelevance) The negative propositional fragment A− is irrelevant. A−, B− ::= ⊥ | ⊤ | t = u | A− ∧ B− | A− → B−

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 46 / 101

slide-73
SLIDE 73

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Address IP

Assume P irrelevant, we have W((P → ∃m. Q m) → ∃m. (P → Q m)) =        W(P → ∃m. Q m) ⇒ N W(P → ∃m. Q m) ⇒ W(P → Q m) W(P → ∃m. Q m) ⇒ C(∃m. P → Q m) ⇒ W(P) W(P → ∃m. Q m) ⇒ C(∃m. P → Q m) ⇒ C(∃m. Q m) =    N ⇒ W(Q m) ⇒ N N ⇒ W(Q m) ⇒ W(Q m) N ⇒ W(Q m) ⇒ (N ⇒ C(Q m)) ⇒ N ⇒ C(Q m) as W(P → A) = W(A)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 47 / 101

slide-74
SLIDE 74

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

IP, at last

Therefore, just take IP•

N

: N ⇒ W(Q m) ⇒ N IP•

N

:= λn _. n IP•

Q m

: N ⇒ W(Q m) ⇒ W(Q m) IP•

Q m

:= λ_ p. p IP•

: N ⇒ W(Q m) ⇒ (N ⇒ C(Q m)) ⇒ N ⇒ C(Q m) IP•

:= λ_ _ k. k

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 48 / 101

slide-75
SLIDE 75

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

IP, at last

Therefore, just take IP•

N

: N ⇒ W(Q m) ⇒ N IP•

N

:= λn _. n IP•

Q m

: N ⇒ W(Q m) ⇒ W(Q m) IP•

Q m

:= λ_ p. p IP•

: N ⇒ W(Q m) ⇒ (N ⇒ C(Q m)) ⇒ N ⇒ C(Q m) IP•

:= λ_ _ k. k Proving that this is a proper realizer is trivial, this is mostly a projection. IP• ⊩ (P → ∃m. Q m) → ∃m. (P → Q m)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 48 / 101

slide-76
SLIDE 76

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Reflexions on IP

Actually, IP is mostly an accident It works for about the same reasons as in usual realizability Namely, irrelevant stuff is erased by the translation The realizer does not take advantage of the added structure “IP is merely a consequence of realizability.”

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 49 / 101

slide-77
SLIDE 77

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Towards MP

¬(∀n. ¬P n) MP ∃n. P n Let us try to realize this assuming P is decidable! A quick introductory remark: our target language is strongly normalizing... We can’t write the naive loop algorithm from intuitionistic realizability!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 50 / 101

slide-78
SLIDE 78

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Towards MP

¬(∀n. ¬P n) MP ∃n. P n Let us try to realize this assuming P is decidable! A quick introductory remark: our target language is strongly normalizing... We can’t write the naive loop algorithm from intuitionistic realizability! We’ll do much better.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 50 / 101

slide-79
SLIDE 79

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Nein

First, let’s scrutinize the interpretation of negation. ¬A := A → ⊥ We have: W(¬A) = W(A) ⇒ C(A) C(¬A) = W(A) and M ̸⊥A Φ M Φ ⊥¬A M

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 51 / 101

slide-80
SLIDE 80

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Nein

First, let’s scrutinize the interpretation of negation. ¬A := A → ⊥ We have: W(¬A) = W(A) ⇒ C(A) C(¬A) = W(A) and M ̸⊥A Φ M Φ ⊥¬A M Negation highly asymmetrical, not degenerate!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 51 / 101

slide-81
SLIDE 81

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Unfolding...

We have then: W(¬∀n. ¬P n → ∃n. P n) =    W(¬Ψ) ⇒ N W(¬Ψ) ⇒ W(P n) W(¬Ψ) ⇒ C(∃n. P n) ⇒ C(¬Ψ) =    (W(Ψ) ⇒ N) ⇒ (W(Ψ) ⇒ W(P n)) ⇒ N (W(Ψ) ⇒ N) ⇒ (W(Ψ) ⇒ W(P n)) ⇒ W(P n) (W(Ψ) ⇒ N) ⇒ (W(Ψ) ⇒ W(P n)) ⇒ C(∃n. P n) ⇒ W(Ψ) where Ψ := ∀n. ¬P n.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 52 / 101

slide-82
SLIDE 82

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Simplifying things drastically

But P is decidable, so wlog we can assume it is irrelevant, thus: W(P n) = ∅ W(¬∀n. ¬P n) = ∅ and then W(¬∀n. ¬P n → ∃n. P n) =    (W(Ψ) ⇒ N) ⇒ (W(Ψ) ⇒ W(P n)) ⇒ N (W(Ψ) ⇒ N) ⇒ (W(Ψ) ⇒ W(P n)) ⇒ W(P n) (W(Ψ) ⇒ N) ⇒ (W(Ψ) ⇒ W(P n)) ⇒ C(∃n. P n) ⇒ W(Ψ) =    N ⇒ N ∅ ∅

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 53 / 101

slide-83
SLIDE 83

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Markov’s principle

It’s pretty clear how to provide a term of the expected type: MP• : W(¬∀n. ¬P n → ∃n. P n) MP• := λn. n

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 54 / 101

slide-84
SLIDE 84

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Markov’s principle

It’s pretty clear how to provide a term of the expected type: MP• : W(¬∀n. ¬P n → ∃n. P n) MP• := λn. n The realizibility condition amounts to prove for all n : N: ∅ ̸⊥∀n. ¬P n n − → n ⊥∃n. P n ∅ ¬¬∅⊥P n ∅ − → ∅ ⊥P n ∅ This is true intuitionistically thanks to decidability...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 54 / 101

slide-85
SLIDE 85

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Markov’s principle?

Something fishy going on here. The realizer is suspiciously simple... The realizability condition makes appear classical-looking stuff The integer is provided by the reverse part of the negation “MP is using the Dialectica translation in-depth.”

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 55 / 101

slide-86
SLIDE 86

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

End of Part I

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 56 / 101

slide-87
SLIDE 87

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Part II A Functional Functional Interpretation

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 57 / 101

slide-88
SLIDE 88

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Can I haz Curry-Howard?

Let us forget the 50’s, and rather jump directly to the 90’s. Take seriously the computational content Dialectica as a typed object Works of De Paiva, Hyland, etc. Get rid of Gödel’s hacks: Proper datatypes No more sequences! Stop ugly encodings

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 58 / 101

slide-89
SLIDE 89

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A systematic approach

“Realizability interpretations tend to hide a programming translation.” Logic Programming Kreisel modified realizability Identity translation Krivine classical realizability Lafont-Reus-Streicher CPS Gödel Dialectica realizability ?

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 59 / 101

slide-90
SLIDE 90

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A systematic approach

“Realizability interpretations tend to hide a programming translation.” Logic Programming Kreisel modified realizability Identity translation Krivine classical realizability Lafont-Reus-Streicher CPS Gödel Dialectica realizability A fancy one!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 59 / 101

slide-91
SLIDE 91

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A systematic approach

“Realizability interpretations tend to hide a programming translation.” Logic Programming Kreisel modified realizability Identity translation Krivine classical realizability Lafont-Reus-Streicher CPS Gödel Dialectica realizability A fancy one! Gives first-class status to stacks Features a computationally relevant substitution Mix of LRS with delimited continuations Requires computational (finite) multisets M

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 59 / 101

slide-92
SLIDE 92

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Target programming language

Instead of System T, we take a simply-typed λ-calculus with datatypes. σ, τ ::= . . . | σ × τ | σ + τ | 0 | 1 and add the proper pattern-matchings and constructors. We interpret everything directly into System T (no sequences!).

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 60 / 101

slide-93
SLIDE 93

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The same, with types

If we wish to put more types in there:

W C ⊤ 1 1 ⊥ 1 1 A ∧ B W(A) × W(B) C(A) × C(B) A ∨ B W(A) + W(B) C(A) × C(B) A → B   W(A) ⇒ W(B) × W(A) ⇒ C(B) ⇒ C(A)   W(A) × C(B)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 61 / 101

slide-94
SLIDE 94

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The same, with types

If we wish to put more types in there:

W C ⊤ 1 1 ⊥ 1 1 A ∧ B W(A) × W(B) C(A) × C(B) A ∨ B W(A) + W(B) C(A) × C(B) A → B   W(A) ⇒ W(B) × W(A) ⇒ C(B) ⇒ C(A)   W(A) × C(B)

Orthogonality is adapted in a direct way (sequences → pairs). Observe how W(A) and C(A) are always inhabited

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 61 / 101

slide-95
SLIDE 95

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Not too hastily

We could give a computational content right now

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 62 / 101

slide-96
SLIDE 96

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Not too hastily

We could give a computational content right now But it would be a special case, taking advantage of some encodings Let us use our our favorite tool: Linear Logic.

It factorizes Dialectica! A genuine exponential! With real chunks of sum types!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 62 / 101

slide-97
SLIDE 97

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Not too hastily

We could give a computational content right now But it would be a special case, taking advantage of some encodings Let us use our our favorite tool: Linear Logic.

It factorizes Dialectica! A genuine exponential! With real chunks of sum types! (Do not worry too much if you know nothing about LL, this is mainly for general culture purposes.)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 62 / 101

slide-98
SLIDE 98

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 63 / 101

slide-99
SLIDE 99

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Linearized Dialectica

As forecasted on the previous slide, we essentially apply the following modifications: Introduction of duality with sum types Call-by-name decomposition of the arrow: A → B ≡ !A ⊸ B

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 64 / 101

slide-100
SLIDE 100

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Linearized Dialectica

As forecasted on the previous slide, we essentially apply the following modifications: Introduction of duality with sum types Call-by-name decomposition of the arrow: A → B ≡ !A ⊸ B Now we will be translating LL into LJ.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 64 / 101

slide-101
SLIDE 101

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Requirements

We will be interpreting the formulæ of linear logic: A, B ::= A ⊗ B | A ` B | A ⊕ B | A & B | !A | ?A It is therefore sufficient to define W(A), C(A) and ⊥A for each A.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 65 / 101

slide-102
SLIDE 102

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Requirements

We will be interpreting the formulæ of linear logic: A, B ::= A ⊗ B | A ` B | A ⊕ B | A & B | !A | ?A It is therefore sufficient to define W(A), C(A) and ⊥A for each A. Taking inspiration from the double-orthogonality models, we require: W(A⊥) ≡ C(A) and conversely; thus ⊥A ⊆ W(A) × C(A) ≡ W(A) × W(A⊥)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 65 / 101

slide-103
SLIDE 103

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Forget the dual

⇝ It is sufficient to define our structures on positive types ⇝ We will get them for dual connectives... by duality. We define therefore: u ̸⊥A x x ⊥A⊥ u

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 66 / 101

slide-104
SLIDE 104

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sum types

W C A & B W(A) × W(B) C(A) + C(B) A ⊕ B W(A) + W(B) C(A) × C(B)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 67 / 101

slide-105
SLIDE 105

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sum types

W C A & B W(A) × W(B) C(A) + C(B) A ⊕ B W(A) + W(B) C(A) × C(B) v ⊥A z2 inr v ⊥A⊕B (z1, z2) u ⊥A z1 inl u ⊥A⊕B (z1, z2)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 67 / 101

slide-106
SLIDE 106

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Linear decomposition

W C A → B { W(A) ⇒ W(B) W(A) ⇒ C(B) ⇒ C(A) W(A) × C(B) A ⊸ B { W(A) ⇒ W(B) C(B) ⇒ C(A) W(A) × C(B) !A W(A) W(A) ⇒ C(A)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 68 / 101

slide-107
SLIDE 107

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Linear decomposition

W C A → B { W(A) ⇒ W(B) W(A) ⇒ C(B) ⇒ C(A) W(A) × C(B) A ⊸ B { W(A) ⇒ W(B) C(B) ⇒ C(A) W(A) × C(B) !A W(A) W(A) ⇒ C(A) u ⊥A ψ y → φ u ⊥B y (φ, ψ) ⊥A⊸B (u, y) u ⊥A z u u ⊥!A z

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 68 / 101

slide-108
SLIDE 108

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Handwaving justification

The interpretation of arrow forces its reversibility: A ⊸ B ∼ = B⊥ ⊸ A⊥

⇝ Like the two-way proofnet wires

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 69 / 101

slide-109
SLIDE 109

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Handwaving justification

The interpretation of arrow forces its reversibility: A ⊸ B ∼ = B⊥ ⊸ A⊥

⇝ Like the two-way proofnet wires

The bang connective is a shift :

⇝ Opponent may wait for the player to play and inspect its answer

Duality is rôle swapping

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 69 / 101

slide-110
SLIDE 110

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

About linearity

We’re not linear by chance.

1Assuming we’ve defined 1. 2May contain nuts. Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 70 / 101

slide-111
SLIDE 111

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

About linearity

We’re not linear by chance. Indeed, in Dialectica, we do not realize the following morphisms: ⊢ A ⊸ 11 ⊢ A ⊸ A ⊗ A Hence we have true linear constraints!2

1Assuming we’ve defined 1. 2May contain nuts. Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 70 / 101

slide-112
SLIDE 112

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 71 / 101

slide-113
SLIDE 113

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intepretation of the call-by-name λ-calculus

Let us now try to translate the good old λ-calculus through Dialectica. First through the call-by-name linear decomposition into LL; Then into LJ with the linear Dialectica.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 72 / 101

slide-114
SLIDE 114

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intepretation of the call-by-name λ-calculus

Let us now try to translate the good old λ-calculus through Dialectica. First through the call-by-name linear decomposition into LL; Then into LJ with the linear Dialectica. We already did that when translating HA. I’m just expliciting the proof terms we were translating!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 72 / 101

slide-115
SLIDE 115

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Brief reminder

We recall here the call-by-name translation of the λ-calculus into LL: [ [A ⇒ B] ] ≡ ![ [A] ] ⊸ [ [B] ] [ [Γ ⊢ A] ] ≡ ⊗ ![ [Γ] ] ⊢ [ [A] ] Indeed, we recover the same translation as before: W(A ⇒ B) ∼ = (W(A) ⇒ W(B)) × (W(A) ⇒ C(B) ⇒ C(A)) C(A ⇒ B) ∼ = W(A) × C(A) with the same orthogonality. if u ⊥A φ u π then f u ⊥B π (f, φ) ⊥A⇒B (u, π)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 73 / 101

slide-116
SLIDE 116

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Say it again?

In order to interpret the λ-calculus, we need the same structure as in the intepretation of HA.

Dummy term

For all type A, there exists ⊢ ✠A : W(A).

Merge term

The ⊥A relation is decidable. In particular, there exists some λ-term ⊕A : C(A) ⇒ C(A) ⇒ W(A) ⇒ C(A) with the following behaviour: π1 ⊕x

A π2 ∼

= if x ⊥A π1 then π2 else π1

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 74 / 101

slide-117
SLIDE 117

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Did you solve the organization issue?

If we were to use the translation as is, we would bump up into an unbearable bureaucracy. Instead, we are going to use the following isomorphism. [ [x1 : Γ1, . . . xn : Γn ⊢ t : A] ] ∼ = W(Γ) ⇒          W(A) C(A) ⇒ C(Γ1) . . . C(A) ⇒ C(Γn)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 75 / 101

slide-118
SLIDE 118

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Did you solve the organization issue?

If we were to use the translation as is, we would bump up into an unbearable bureaucracy. Instead, we are going to use the following isomorphism. [ [x1 : Γ1, . . . xn : Γn ⊢ t : A] ] ∼ = W(Γ) ⇒          W(A) C(A) ⇒ C(Γ1) . . . C(A) ⇒ C(Γn) Which results in the following translations: [ [⃗ x : Γ ⊢ t : A] ] ≡                ⃗ x : W(Γ) ⊢ t• : W(A) ⃗ x : W(Γ) ⊢ t◦

x1 : C(A) ⇒ C(Γ1)

. . . ⃗ x : W(Γ) ⊢ t◦

xn : C(A) ⇒ C(Γn)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 75 / 101

slide-119
SLIDE 119

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Translation

For (−)• : x• ≡ x (λx. t)• ≡ ( λx. t•, λx π. t◦

x π

) (t u)• ≡ (fst t•) u•

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 76 / 101

slide-120
SLIDE 120

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Translation II

For t◦

x :

x◦

x

≡ λπ. π : C(A) → C(A) y◦

x

≡ λπ. ✠Γi : C(A) → C(Γi) (λy. t)◦

x≡

λ(y, π). t◦

x π

: W(A) × C(B) → C(Γi) (t u)◦

x ≡

λπ. u◦

x ((snd t•) π u•) ⊕x Γi t◦ x (u•, π)

: C(B) → C(Γi)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 77 / 101

slide-121
SLIDE 121

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

It just works... Does it?

Soundness

If ⊢ t : A, then ⊢ t• : W(A), and in addition, for all π : C(A), t• ⊥A π.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 78 / 101

slide-122
SLIDE 122

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

It just works... Does it?

Soundness

If ⊢ t : A, then ⊢ t• : W(A), and in addition, for all π : C(A), t• ⊥A π. Sadness The translation is not stable by β-reduction. The Dialectica translation is not a program translation.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 78 / 101

slide-123
SLIDE 123

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Almost there

Using ✠ and ⊕ is another hack by Gödel. They rely on typing They are non-canonical They have no algebraic properties

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 79 / 101

slide-124
SLIDE 124

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Almost there

Using ✠ and ⊕ is another hack by Gödel. They rely on typing They are non-canonical They have no algebraic properties We need finite multisets M!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 79 / 101

slide-125
SLIDE 125

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Minor revision

We just change C(!A) ≡ W(A) → M C(A) This gives: W(A ⇒ B) := (W(A) ⇒ W(B)) × (W(A) ⇒ C(B) ⇒ M C(A)) C(A ⇒ B) := W(A) × C(A) if for all ρ ∈ φ u π, u ⊥A ρ then f u ⊥B π (f, φ) ⊥A⇒B (u, π) Term interpretation is almost unchanged:

⇝ ✠ is the empty multiset; ⊕ is the union

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 80 / 101

slide-126
SLIDE 126

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Minor revision (II)

This variant is actually well-known. The previous translation is essentially the Diller-Nahm translation.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 81 / 101

slide-127
SLIDE 127

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Minor revision (II)

This variant is actually well-known. The previous translation is essentially the Diller-Nahm translation. ... for totally different reasons It does not require the decidability of atoms Not at all motivated by proof-as-program considerations

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 81 / 101

slide-128
SLIDE 128

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What about the computational content?

This gives us the following types for the translation: [ [⃗ x : Γ ⊢ t : A] ] ≡                ⃗ x : W(Γ) ⊢ t• : W(A) ⃗ x : W(Γ) ⊢ t◦

x1 : C(A) → M C(Γ1)

. . . ⃗ x : W(Γ) ⊢ t◦

xn : C(A) → M C(Γn)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 82 / 101

slide-129
SLIDE 129

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What about the computational content?

This gives us the following types for the translation: [ [⃗ x : Γ ⊢ t : A] ] ≡                ⃗ x : W(Γ) ⊢ t• : W(A) ⃗ x : W(Γ) ⊢ t◦

x1 : C(A) → M C(Γ1)

. . . ⃗ x : W(Γ) ⊢ t◦

xn : C(A) → M C(Γn)

t• is clearly the lifting of t;

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 82 / 101

slide-130
SLIDE 130

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What about the computational content?

This gives us the following types for the translation: [ [⃗ x : Γ ⊢ t : A] ] ≡                ⃗ x : W(Γ) ⊢ t• : W(A) ⃗ x : W(Γ) ⊢ t◦

x1 : C(A) → M C(Γ1)

. . . ⃗ x : W(Γ) ⊢ t◦

xn : C(A) → M C(Γn)

t• is clearly the lifting of t; What on earth is t◦

xi?

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 82 / 101

slide-131
SLIDE 131

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

An unbearable suspense

A small interlude of advertisement definitions to reintroduce you to the KAM.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 83 / 101

slide-132
SLIDE 132

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

An unbearable suspense

A small interlude of advertisement definitions to reintroduce you to the KAM.

Closures c ::= (t, σ) Environments σ ::= ∅ | σ + (x := c) Stacks π ::= ε | c · π Processes p ::= ⟨c | π⟩ Push ⟨(t u, σ) | π⟩ → ⟨(t, σ) | (u, σ) · π⟩ Pop ⟨(λx. t, σ) | c · π⟩ → ⟨(t, σ + (x := c)) | π⟩ Grab ⟨(x, σ + (x := c)) | π⟩ → ⟨c | π⟩ Garbage ⟨(x, σ + (y := c)) | π⟩ → ⟨(x, σ) | π⟩ The Krivine Machine™

This variant has explicit substitutions...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 83 / 101

slide-133
SLIDE 133

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Duality, duality!

It is easy to observe the following similarity: Dialectica realizability C(A ⇒ B) := W(A) × C(B) Krivine realizability ||A ⇒ B|| := |A| · ||B||

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 84 / 101

slide-134
SLIDE 134

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Duality, duality!

It is easy to observe the following similarity: Dialectica realizability C(A ⇒ B) := W(A) × C(B) Krivine realizability ||A ⇒ B|| := |A| · ||B|| Thus Dialectica gives a first-class status to Krivine stacks (like LRS). In particular, the (−)• translation naturally extends to stacks.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 84 / 101

slide-135
SLIDE 135

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Closures all the way down

Let:

a term ⃗ x : Γ ⊢ t : A ⇝ ⃗ x : W(Γ) ⊢ t◦

xi : C(A) ⇒ M C(Γi)

a closure σ ⊢ Γ ⇝ σ• : W(Γ) a stack ⊢ π : A⊥ ⇝ π• : C(A)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 85 / 101

slide-136
SLIDE 136

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Closures all the way down

Let:

a term ⃗ x : Γ ⊢ t : A ⇝ ⃗ x : W(Γ) ⊢ t◦

xi : C(A) ⇒ M C(Γi)

a closure σ ⊢ Γ ⇝ σ• : W(Γ) a stack ⊢ π : A⊥ ⇝ π• : C(A)

Then (t◦

xi{⃗

x := σ•}) π• : M C(Γi) is made of the stacks encountered by xi while evaluating ⟨(t, σ) | π⟩, i.e. (t◦

xi{⃗

x := σ•}) π• = [ρ1; . . . ρm] ⟨(t, σ) | π⟩ − →∗ ⟨(xi, σ1) | ρ1⟩ . . . . . . − →∗ ⟨(xi, σm) | ρm⟩

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 85 / 101

slide-137
SLIDE 137

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Look

x◦

x

≡ λπ. [π] : C(A) → M C(A) y◦

x

≡ λπ. [ ] : C(A) → M C(Γi) (λy. t)◦

x

≡ λ(y, π). t◦

x π

: W(A) × C(B) → M C(Γi) (t u)◦

x

≡ λπ. (((snd t•) π u•) > >= u◦

x) ⊕ t◦ x (u•, π)

: C(B) → M C(Γi)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 86 / 101

slide-138
SLIDE 138

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Look

x◦

x

≡ λπ. [π] : C(A) → M C(A) y◦

x

≡ λπ. [ ] : C(A) → M C(Γi) (λy. t)◦

x

≡ λ(y, π). t◦

x π

: W(A) × C(B) → M C(Γi) (t u)◦

x

≡ λπ. (((snd t•) π u•) > >= u◦

x) ⊕ t◦ x (u•, π)

: C(B) → M C(Γi)

(We can generalize to algebraic datatypes directly.)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 86 / 101

slide-139
SLIDE 139

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Implementation-wise

For computer scientists: Dialectica instruments dereferencing by:

1 capturing the current stack 2 storing it somewhere 3 returning it when the function returns

This is the only effect I know of which is sensitive to substitution. Hence the linearish nature...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 87 / 101

slide-140
SLIDE 140

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica Reloaded

The standard Dialectica only returns one stack

⇝ the first non-dummy stack, dynamically tested

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 88 / 101

slide-141
SLIDE 141

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica Reloaded

The standard Dialectica only returns one stack

⇝ the first non-dummy stack, dynamically tested

This is somehow a weak form of delimited control

⇝ Inspectable stacks: ∼A vs. ¬A ⇝ First class access to those stacks with (−)◦

x

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 88 / 101

slide-142
SLIDE 142

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dialectica Reloaded

The standard Dialectica only returns one stack

⇝ the first non-dummy stack, dynamically tested

This is somehow a weak form of delimited control

⇝ Inspectable stacks: ∼A vs. ¬A ⇝ First class access to those stacks with (−)◦

x

We can do the same thing with other calling conventions

⇝ The protohistoric Dialectica was call-by-name ⇝ Choose your favorite translation into LL!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 88 / 101

slide-143
SLIDE 143

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Simulating the KAM simulation

Actually, there is something wrong.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 89 / 101

slide-144
SLIDE 144

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Simulating the KAM simulation

Actually, there is something wrong. Produced stacks are the right ones...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 89 / 101

slide-145
SLIDE 145

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Simulating the KAM simulation

Actually, there is something wrong. Produced stacks are the right ones... They have the right multiplicity...

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 89 / 101

slide-146
SLIDE 146

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Simulating the KAM simulation

Actually, there is something wrong. Produced stacks are the right ones... They have the right multiplicity... But they are not respecting the KAM order! This is because of finite multisets

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 89 / 101

slide-147
SLIDE 147

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Simulating the KAM simulation

Actually, there is something wrong. Produced stacks are the right ones... They have the right multiplicity... But they are not respecting the KAM order! This is because of finite multisets The faulty one is the application case (more generally duplication). (t u)x ≡ λπ. (((snd t•) π u•) > >= u◦

x) ⊕ t◦ x (u•, π)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 89 / 101

slide-148
SLIDE 148

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A deep issue

The KAM imposes us sequentiality We want to reflect it into the translation

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 90 / 101

slide-149
SLIDE 149

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A deep issue

The KAM imposes us sequentiality We want to reflect it into the translation Alas, no way to do that The ` translation is far too symmetrical

⇝ We want interleaving ⇝ Dialectica can’t achieve it as is ⇝ Polarization? Tensorial logic? Dump Dialectica?

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 90 / 101

slide-150
SLIDE 150

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

What about realized principles?

We do not reach the historic Dialectica. IP comes from the realizability part (no IP) In our setting we only realize a weak version of MP

  • MP : ∼ (∀x. ∼P x) → ∃x. P x

where ∼ is a weak negation: ∼ A := A ⇒ ‚ akin to ⊥ from LL: W(‚) := 1 C(‚) := 1 (no proof of orthogonality) i.e. a type with paraproofs but no proofs!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 91 / 101

slide-151
SLIDE 151

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Exploiting weak negations

In particular, W(∼ A) ∼ = W(A) ⇒ M C(A) C(∼ A) ∼ = W(A) not for all ρ ∈ f u, u ⊥A ρ f ⊥∼A u so that W(∼ ∀x. ∼ P) ∼ = (N ⇒ W(P) ⇒ M C(P)) ⇒ M (N × W(P)) C(∼ ∀x. ∼ P) ∼ = N ⇒ W(P) ⇒ M C(P) and t ⊩ ∼ ∀x. ∼ P := ∀π. ¬(∀(x, u) ∈ t π. ¬(∀ρ ∈ π x u. u ⊥P ρ))

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 92 / 101

slide-152
SLIDE 152

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pfu!!

In the end, we’re able to recover a witness from the fact that P is decidable the multisets are finite t ⊩ ∼ ∀x. ∼ P ∼ = ∀π. ∃(x, u) ∈ t π. ∀ρ ∈ π x u. u ⊥P ρ This requires crawling through the various multisets to do so. Instantiate π by a function producing an empty multiset and you’re done!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 93 / 101

slide-153
SLIDE 153

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1

Overview

2

Gödel’s Dialectica Translation

3

Realizing more by Working more

4

Curry-Howard at the rescue

5

Enters Linear Logic

6

Intepretation of the λ-calculus

7

Towards CCω

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 94 / 101

slide-154
SLIDE 154

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Towards CCω

What about more expressive systems? We follow the computation intuition we presented ... and we apply Dialectica to dependent types

⇝ subsuming first-order logic; ⇝ a proof-relevant ∀; ⇝ towards CCω and further!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 95 / 101

slide-155
SLIDE 155

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Main lines

We keep the CBN λ-calculus

⇝ it can be lifted readily to dependent types ⇝ nothing special to do!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 96 / 101

slide-156
SLIDE 156

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Main lines

We keep the CBN λ-calculus

⇝ it can be lifted readily to dependent types ⇝ nothing special to do!

Design choice: types have no computational content (effect-free):

⇝ a bit disappointing; ⇝ but it works... ⇝ and the usual CC presentation does not help much!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 96 / 101

slide-157
SLIDE 157

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Type translation

Idea: if A is a type, A• ≡ (W(A), C(A)) : Type × Type Ax ≡ λπ. [] (effect-free)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 97 / 101

slide-158
SLIDE 158

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Type translation

Idea: if A is a type, A• ≡ (W(A), C(A)) : Type × Type Ax ≡ λπ. [] (effect-free) We get:

Type• ≡ (Type × Type, 1) Typex ≡ λπ. [ ] (Πy : A. B)• ≡   (Πy : W(A). W(B)) × (Πy : W(A). C(B) → M C(A)) , Σy : W(A). C(B)   (Πy : A. B)x ≡ λπ. [ ]

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 97 / 101

slide-159
SLIDE 159

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness

The translation is sound, but it’s not really pure CIC.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 98 / 101

slide-160
SLIDE 160

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Soundness

The translation is sound, but it’s not really pure CIC. We need finite multisets

HITs, HITs, HITs!

We need some commutative cut rules

First class (read: negative) records may do the trick

Or extensionality hammer

Maybe Oury-like tricks

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 98 / 101

slide-161
SLIDE 161

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Inductives, please

We can obtain dependent destruction quite easily Just tweak the linear decomposition and there you go!

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 99 / 101

slide-162
SLIDE 162

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conclusion

Actually, Dialectica is quite simple.

⇝ ... at least once we removed encoding artifacts

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 100 / 101

slide-163
SLIDE 163

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conclusion

Actually, Dialectica is quite simple.

⇝ ... at least once we removed encoding artifacts

It is an approximation of two side-effects:

⇝ A bit of delimited control (the (−)x part) ⇝ A form of exceptions (with ∅)

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 100 / 101

slide-164
SLIDE 164

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conclusion

Actually, Dialectica is quite simple.

⇝ ... at least once we removed encoding artifacts

It is an approximation of two side-effects:

⇝ A bit of delimited control (the (−)x part) ⇝ A form of exceptions (with ∅)

But is is partially wrong:

⇝ it is oblivious of sequentiality ⇝ how can we fix it?

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 100 / 101

slide-165
SLIDE 165

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conclusion

Actually, Dialectica is quite simple.

⇝ ... at least once we removed encoding artifacts

It is an approximation of two side-effects:

⇝ A bit of delimited control (the (−)x part) ⇝ A form of exceptions (with ∅)

But is is partially wrong:

⇝ it is oblivious of sequentiality ⇝ how can we fix it?

The delimited control part can be lifted seamlessly to CCω

⇝ as soon as we have a little bit more than CC ⇝ we need a more computation-relevant presentation of CC

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 100 / 101

slide-166
SLIDE 166

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Scribitur ad narrandum, non ad probandum

Thanks for your attention.

Pierre-Marie Pédrot (INRIA) Dialectica 22/07/2016 101 / 101