Classical realizability and side-effects Etienne Miquey 1,2 1 - - PowerPoint PPT Presentation

classical realizability and side effects
SMART_READER_LITE
LIVE PREVIEW

Classical realizability and side-effects Etienne Miquey 1,2 1 - - PowerPoint PPT Presentation

Introduction A constructive proof of DC Algebraic models of classical realizability Classical realizability and side-effects Etienne Miquey 1,2 1 Equipe r 2 (INRIA), IRIF, Universit e Paris-Diderot 2 IMERL, Fac. de Ingenier a,


slide-1
SLIDE 1

Introduction A constructive proof of DC Algebraic models of classical realizability

Classical realizability and side-effects

´ Etienne Miquey1,2

1 ´

Equipe πr2 (INRIA), IRIF, Universit´ e Paris-Diderot

2 IMERL, Fac. de Ingenier´

ıa, Universidad de la Rep´ ublica

17 Novembre 2017

´ Etienne Miquey Classical realizability and side-effects 1/ 47

slide-2
SLIDE 2

Introduction A constructive proof of DC Algebraic models of classical realizability

Part I

  • What is this thesis about?

´ Etienne Miquey Classical realizability and side-effects 2/ 47

slide-3
SLIDE 3

Introduction A constructive proof of DC Algebraic models of classical realizability

A tricky question

Every Ph.D. student has been asked a thousand times: “What is the title of your thesis?” In my case, the next questions: classical? realizability? side-effects? What does it have to do with logic/mathematics/computer science?

´ Etienne Miquey Classical realizability and side-effects 3/ 47

slide-4
SLIDE 4

Introduction A constructive proof of DC Algebraic models of classical realizability

Proofs

A (very) old one:

´ Etienne Miquey Classical realizability and side-effects 4/ 47

slide-5
SLIDE 5

Introduction A constructive proof of DC Algebraic models of classical realizability

Proofs

A (very) old one: An easy one: Plato is a cat. All cats like fish. Therefore, Plato likes fish .

´ Etienne Miquey Classical realizability and side-effects 4/ 47

slide-6
SLIDE 6

Introduction A constructive proof of DC Algebraic models of classical realizability

Proofs

A (very) old one: An easy one: Plato is a cat. All cats like fish. Therefore, Plato likes fish . Intuitively: from a set of hypotheses apply deduction rules to obtain a theorem

´ Etienne Miquey Classical realizability and side-effects 4/ 47

slide-7
SLIDE 7

Introduction A constructive proof of DC Algebraic models of classical realizability

Programs

´ Etienne Miquey Classical realizability and side-effects 5/ 47

slide-8
SLIDE 8

Introduction A constructive proof of DC Algebraic models of classical realizability

Programs

´ Etienne Miquey Classical realizability and side-effects 5/ 47

slide-9
SLIDE 9

Introduction A constructive proof of DC Algebraic models of classical realizability

Programs

´ Etienne Miquey Classical realizability and side-effects 5/ 47

slide-10
SLIDE 10

Introduction A constructive proof of DC Algebraic models of classical realizability

Programs

Think of it as a recipe (algorithm) to draw a computation forward. Intuitively: from a set of inputs apply instructions to obtain the output

´ Etienne Miquey Classical realizability and side-effects 5/ 47

slide-11
SLIDE 11

Introduction A constructive proof of DC Algebraic models of classical realizability

So ?

Proof: from a set of hypotheses apply deduction rules to obtain a theorem Program: from a set of inputs apply instructions to obtain the output Curry-Howard

(On well-chosen subsets of mathematics and programs)

That’s the same thing!

´ Etienne Miquey Classical realizability and side-effects 6/ 47

slide-12
SLIDE 12

Introduction A constructive proof of DC Algebraic models of classical realizability

Proof trees

Sequent: Γ ⊢ A Deduction rules: A ∈ Γ Γ ⊢ A

(Ax)

Γ,A ⊢ B Γ ⊢ A ⇒ B

(⇒I)

Γ ⊢ A ⇒ B Γ ⊢ A Γ ⊢ B

(⇒E)

Example:

´ Etienne Miquey Classical realizability and side-effects 7/ 47

slide-13
SLIDE 13

Introduction A constructive proof of DC Algebraic models of classical realizability

Proof trees

Sequent: Γ ⊢ A Deduction rules: A ∈ Γ Γ ⊢ A

(Ax)

Γ,A ⊢ B Γ ⊢ A ⇒ B

(⇒I)

Γ ⊢ A ⇒ B Γ ⊢ A Γ ⊢ B

(⇒E)

Example: Plato is a cat. If Plato is cat, Plato likes fish. Therefore, Plato likes fish

  • Conclusion

. (A ⇒ B) ∈ Γ Γ ⊢ A ⇒ B

(Ax)

B ∈ Γ Γ ⊢ B

(Ax)

Γ ⊢ B

(⇒E)

´ Etienne Miquey Classical realizability and side-effects 7/ 47

slide-14
SLIDE 14

Introduction A constructive proof of DC Algebraic models of classical realizability

Proof trees

Sequent: Γ ⊢ A Deduction rules: A ∈ Γ Γ ⊢ A

(Ax)

Γ,A ⊢ B Γ ⊢ A ⇒ B

(⇒I)

Γ ⊢ A ⇒ B Γ ⊢ A Γ ⊢ B

(⇒E)

Example: Plato is a cat. If Plato is cat, Plato likes fish. Therefore, Plato likes fish

  • Conclusion

. (A ⇒ B) ∈ Γ Γ ⊢ A ⇒ B

(Ax)

B ∈ Γ Γ ⊢ B

(Ax)

Γ ⊢ B

(⇒E)

´ Etienne Miquey Classical realizability and side-effects 7/ 47

Hyp.

slide-15
SLIDE 15

Introduction A constructive proof of DC Algebraic models of classical realizability

Proofs-as-programs

The Curry-Howard correspondence Mathematics Computer Science Proofs Programs Propositions Types Deduction rules Typing rules Γ ⊢ A ⇒ B Γ ⊢ A Γ ⊢ B

(⇒E)

Γ ⊢ t : A → B Γ ⊢ u : A Γ ⊢ t u : B

(→E)

Benefits: Program your proofs! Prove your programs!

´ Etienne Miquey Classical realizability and side-effects 8/ 47

slide-16
SLIDE 16

Introduction A constructive proof of DC Algebraic models of classical realizability

Proofs-as-programs

Limitations p Mathematics Computer Science A ∨ ¬A ¬¬A ⇒ A

All sets can

be well-ordered Sets that have the same elements are equal

  • try. . . catch . . .

x := 42 random() stop goto We want more !

´ Etienne Miquey Classical realizability and side-effects 8/ 47

slide-17
SLIDE 17

Introduction A constructive proof of DC Algebraic models of classical realizability

Extending Curry-Howard

Classical logic = Intuitionistic logic + A ∨ ¬A 1990: Griffin discovered that call/cc can be typed by Peirce’s law

(well-known fact: Peirce’s law ⇒ A ∨ ¬A)

Classical Curry-Howard: λ-calculus + call/cc

Other examples: quote instruction ∼ dependent choice monotonic memory ∼ Cohen’s forcing … The moto

With side-effects come new reasoning principles.

´ Etienne Miquey Classical realizability and side-effects 9/ 47

slide-18
SLIDE 18

Introduction A constructive proof of DC Algebraic models of classical realizability

Extending Curry-Howard

Classical logic = Intuitionistic logic + A ∨ ¬A 1990: Griffin discovered that call/cc can be typed by Peirce’s law

(well-known fact: Peirce’s law ⇒ A ∨ ¬A)

Classical Curry-Howard: λ-calculus + call/cc

Other examples: quote instruction ∼ dependent choice monotonic memory ∼ Cohen’s forcing … The moto

With side-effects come new reasoning principles.

´ Etienne Miquey Classical realizability and side-effects 9/ 47

slide-19
SLIDE 19

Introduction A constructive proof of DC Algebraic models of classical realizability

Extending Curry-Howard

Classical logic = Intuitionistic logic + A ∨ ¬A 1990: Griffin discovered that call/cc can be typed by Peirce’s law

(well-known fact: Peirce’s law ⇒ A ∨ ¬A)

Classical Curry-Howard: λ-calculus + call/cc

Other examples: quote instruction ∼ dependent choice monotonic memory ∼ Cohen’s forcing … The moto

With side-effects come new reasoning principles.

´ Etienne Miquey Classical realizability and side-effects 9/ 47

slide-20
SLIDE 20

Introduction A constructive proof of DC Algebraic models of classical realizability

Teaser #1

The moto

With side-effects come new reasoning principles.

In Part II, we will use several computational features:

dependent types streams lazy evaluation shared memory

to get a proof for the axioms of dependent and countable choice that is compatible with classical logic.

´ Etienne Miquey Classical realizability and side-effects 10/ 47

slide-21
SLIDE 21

Introduction A constructive proof of DC Algebraic models of classical realizability

Theory vs Model

What is the status of axioms (e.g. A ∨ ¬A)? neither true nor false in the ambient theory

(here, true means provable)

There is another point of view: Theory: provability in an axiomatic representation (syntax) Model: validity in a particular structure (semantic) Example: A ∧ B B A ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ A ∨ B B A ✓ ✗ ✓ ✓ ✓ ✗ ✓ ✗ A ¬A A ∨ ¬A ✓ ✗ ✓ ✗ ✓ ✓

´ Etienne Miquey Classical realizability and side-effects 11/ 47

slide-22
SLIDE 22

Introduction A constructive proof of DC Algebraic models of classical realizability

Theory vs Model

What is the status of axioms (e.g. A ∨ ¬A)? neither true nor false in the ambient theory

(here, true means provable)

There is another point of view: Theory: provability in an axiomatic representation (syntax) Model: validity in a particular structure (semantic) Example: A ∧ B B A ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ A ∨ B B A ✓ ✗ ✓ ✓ ✓ ✗ ✓ ✗ A ¬A A ∨ ¬A ✓ ✗ ✓ ✗ ✓ ✓

´ Etienne Miquey Classical realizability and side-effects 11/ 47

slide-23
SLIDE 23

Introduction A constructive proof of DC Algebraic models of classical realizability

Theory vs Model

What is the status of axioms (e.g. A ∨ ¬A)? neither true nor false in the ambient theory

(here, true means provable)

There is another point of view: Theory: provability in an axiomatic representation (syntax) Model: validity in a particular structure (semantic) Example: A ∧ B B A ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ A ∨ B B A ✓ ✗ ✓ ✓ ✓ ✗ ✓ ✗ A ¬A A ∨ ¬A ✓ ✗ ✓ ✗ ✓ ✓

´ Etienne Miquey Classical realizability and side-effects 11/ 47

slide-24
SLIDE 24

Introduction A constructive proof of DC Algebraic models of classical realizability

Theory vs Model

What is the status of axioms (e.g. A ∨ ¬A)? neither true nor false in the ambient theory

(here, true means provable)

There is another point of view: Theory: provability in an axiomatic representation (syntax) Model: validity in a particular structure (semantic) Example: A ∧ B B A ✓ ✗ ✓ ✓ ✗ ✗ ✗ ✗ A ∨ B B A ✓ ✗ ✓ ✓ ✓ ✗ ✓ ✗ A ¬A A ∨ ¬A ✓ ✗ ✓ ✗ ✓ ✓

´ Etienne Miquey Classical realizability and side-effects 11/ 47

Valid formula

slide-25
SLIDE 25

Introduction A constructive proof of DC Algebraic models of classical realizability

Teaser #2

Classical realizability: A → {t : t A}

(intuition: programs that share a common computational behavior given by A)

Great news Classical realizability semantics gives surprisingly new models! In Part III, we will study the algebraic structure of these models.

´ Etienne Miquey Classical realizability and side-effects 12/ 47

slide-26
SLIDE 26

Introduction A constructive proof of DC Algebraic models of classical realizability

Part II

  • A constructive proof of dependent choice

compatible with classical logic

´ Etienne Miquey Classical realizability and side-effects 13/ 47

slide-27
SLIDE 27

Introduction A constructive proof of DC Algebraic models of classical realizability

The axiom of choice

Axiom of Choice: AC : ∀xA.∃yB.P(x,y) → ∃f A→B.∀xA.P(x,f (x))

´ Etienne Miquey Classical realizability and side-effects 14/ 47

Chapter 5

slide-28
SLIDE 28

Introduction A constructive proof of DC Algebraic models of classical realizability

The axiom of choice

Axiom of Choice: AC : ∀xA.∃yB.P(x,y) → ∃f A→B.∀xA.P(x,f (x)) := λH.(λx.wit (H x), λx.prf (H x)) Computational content through dependent types: Γ,x : T ⊢ t : A Γ ⊢ λx.t : ∀xT.A

(∀I)

Γ ⊢ p : A[t/x] Γ ⊢ t : T Γ ⊢ (t,p) : ∃xT.A

(∃I)

Γ ⊢ p : ∃xT.A(x) Γ ⊢ wit p : T

(wit)

Γ ⊢ p : ∃xT.A(x) Γ ⊢ prf p : A(wit p)

(prf)

´ Etienne Miquey Classical realizability and side-effects 14/ 47

Chapter 5

slide-29
SLIDE 29

Introduction A constructive proof of DC Algebraic models of classical realizability

Incompatibility with classical logic

Bad news dependent sum + classical logic = ❆ One can define: H0 := call/ccα (1,throwα (0,p)) : ∃x.P(x) and reach a contradiction: (wit H0,prf H0) → (1,

P(0)

  • p

)

  • ✘✘✘

∃x.P(x)

We need to: share restrict dependent types

´ Etienne Miquey Classical realizability and side-effects 15/ 47

slide-30
SLIDE 30

Introduction A constructive proof of DC Algebraic models of classical realizability

Incompatibility with classical logic

Bad news dependent sum + classical logic = ❆ One can define: H0 := call/ccα (1,throwα (0,p)) : ∃x.P(x) and reach a contradiction: (wit H0,prf H0) → (1,

P(0)

  • p

)

  • ✘✘✘

∃x.P(x)

We need to: share restrict dependent types

´ Etienne Miquey Classical realizability and side-effects 15/ 47

slide-31
SLIDE 31

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a solution ?

Restriction to countable choice: AC : ∀x.∃yB.P(x,y) → ∃f →B.∀x.P(x,f (x)) Proof: AC := λH.(λn.if n = 0 then wit(H 0) else λn.if n = 1 then wit(H 1) else ... , λn.if n = 0 then prf(H 0) else λn.if n = 1 then prf(H 1) else ... )

´ Etienne Miquey Classical realizability and side-effects 16/ 47

slide-32
SLIDE 32

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a solution ?

Restriction to countable choice: AC : ∀x.∃yB.P(x,y) → ∃f →B.∀x.P(x,f (x)) Proof: AC := λH.let H0 = H 0 in let H1 = H 1 in ... (λn.if n = 0 then wit H0 else λn.if n = 1 then wit H1 else ... , λn.if n = 0 then prf H0 else λn.if n = 1 then prf H1 else ... )

´ Etienne Miquey Classical realizability and side-effects 16/ 47

slide-33
SLIDE 33

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a solution ?

Restriction to countable choice: AC : ∀x.∃yB.P(x,y) → ∃f →B.∀x.P(x,f (x)) Proof: AC := λH.let H∞ = (H 0,H 1,. . . ,H n,. . .) in (λn. wit (nth n H∞),λn. prf (nth n H∞))

´ Etienne Miquey Classical realizability and side-effects 16/ 47

slide-34
SLIDE 34

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a solution ?

Restriction to countable choice: AC : ∀x.∃yB.P(x,y) → ∃f →B.∀x.P(x,f (x)) Proof: AC := λH. let H∞ = cofix0

bn(H n,b(S(n))) in

(λn. wit (nth n H∞),λn. prf (nth n H∞))

´ Etienne Miquey Classical realizability and side-effects 16/ 47

slide-35
SLIDE 35

Introduction A constructive proof of DC Algebraic models of classical realizability

dPAω (Herbelin’s recipe)

A proof system: classical:

p,q ::= ... | catchα p | throwα p

with stratified dependent types :

terms: t,u ::= ... | wit p formulas: A,B ::= ... | ∀xT.A | ∃xT.A | Πa : A.B | t = u proofs: p,q ::= ... | λx.p | (t,p) | λa.p

a syntactical restriction of dependencies to nef proofs call-by-value and sharing:

p,q ::= ... | let a = q in p

with inductive and coinductive constructions:

p,q ::= ... | indt

bn[p | p] | cofixt bn p

lazy evaluation for the cofix

´ Etienne Miquey Classical realizability and side-effects 17/ 47

slide-36
SLIDE 36

Introduction A constructive proof of DC Algebraic models of classical realizability

dPAω (Herbelin’s recipe)

A proof system: classical:

p,q ::= ... | catchα p | throwα p

with stratified dependent types :

terms: t,u ::= ... | wit p formulas: A,B ::= ... | ∀xT.A | ∃xT.A | Πa : A.B | t = u proofs: p,q ::= ... | λx.p | (t,p) | λa.p

a syntactical restriction of dependencies to nef proofs call-by-value and sharing:

p,q ::= ... | let a = q in p

with inductive and coinductive constructions:

p,q ::= ... | indt

bn[p | p] | cofixt bn p

lazy evaluation for the cofix

´ Etienne Miquey Classical realizability and side-effects 17/ 47

slide-37
SLIDE 37

Introduction A constructive proof of DC Algebraic models of classical realizability

State of the art

Subject reduction If Γ ⊢ p : A and p → q, then Γ ⊢ q : A. Normalization If Γ ⊢ p : A then p is normalizable.

requires

Consistency dPAω ⊥

´ Etienne Miquey Classical realizability and side-effects 18/ 47

slide-38
SLIDE 38

Introduction A constructive proof of DC Algebraic models of classical realizability

Roadmap

dPAω [Herbelin’12]:

+ control operators + dependent types + co-fixpoints + sharing & laziness

dLPAω?

+ sequent calculus + dependent types + co-fixpoints + sharing & laziness

?-calculus Subject reduction Subject reduction Normalization typing/reduction preservation CPS-translation?

´ Etienne Miquey Classical realizability and side-effects 19/ 47

slide-39
SLIDE 39

Introduction A constructive proof of DC Algebraic models of classical realizability

Roadmap

dPAω [Herbelin’12]:

+ control operators + dependent types + co-fixpoints + sharing & laziness

dLPAω?

+ sequent calculus + dependent types + co-fixpoints + sharing & laziness

?-calculus Subject reduction Subject reduction Normalization typing/reduction preservation CPS-translation?

´ Etienne Miquey Classical realizability and side-effects 19/ 47

λ[lvτ⋆]

slide-40
SLIDE 40

Introduction A constructive proof of DC Algebraic models of classical realizability

Roadmap

dPAω [Herbelin’12]:

+ control operators + dependent types + co-fixpoints + sharing & laziness

dLPAω?

+ sequent calculus + dependent types + co-fixpoints + sharing & laziness

?-calculus Subject reduction Subject reduction Normalization typing/reduction preservation CPS-translation?

´ Etienne Miquey Classical realizability and side-effects 19/ 47

dL

slide-41
SLIDE 41

Introduction A constructive proof of DC Algebraic models of classical realizability

Classical call-by-need

The λ[lvτ⋆]-calculus (Ariola et al.): a sequent calculus with explicit stores Danvy’s method of semantics artifact:

1

derive a small-step reduction system

2

derive context-free small-step reduction rules

3

derive an (untyped) CPS

Qestions: Does it normalize? Can the CPS be typed? Can we define a realizability interpretation?

´ Etienne Miquey Classical realizability and side-effects 20/ 47

Chapter 6

slide-42
SLIDE 42

Introduction A constructive proof of DC Algebraic models of classical realizability

Danvy’s semantics artifacts

Syntax:

(Proofs)

p ::= V | µα.c

(Weak values)

V ::= v | a

(Strong values)

v ::= λa.p

(Contexts)

e ::= E | ˜ µa.c

(Catchable contexts)

E ::= α | F | ˜ µ[a].a || Fτ

(Forcing contexts)

F ::= p · E

(Commands)

c ::= p || e

(Closures)

l ::= cτ

(Store)

τ ::= ϵ | τ[a := p]

Reduction rules:

(Lazy storage) (Lookup) (Forced eval.)

p || ˜ µa.cτ → cτ[a := p] µα.c || Eτ → (c[E/α])τ a || Fτ[a := p]τ ′ → p || ˜ µ[a].a || Fτ ′τ V || ˜ µ[a].a || Fτ ′τ → V || Fτ[a := V]τ ′ λa.p || q · Eτ → q || ˜ µa.p || Eτ

´ Etienne Miquey Classical realizability and side-effects 21/ 47

slide-43
SLIDE 43

Introduction A constructive proof of DC Algebraic models of classical realizability

Danvy’s semantics artifacts

Small steps: p || ˜ µa.ceτ → ceτ[a := p] p || Eeτ → p || Epτ µα.c || Epτ → (c[E/α])τ V || Epτ → V || EEτ V || ˜ µ[a].a || Fτ ′Eτ → V || FVτ[a := V]τ ′ V || FEτ → V || FVτ a || FVτ[a := p]τ ′ → p || ˜ µ[a].a || Fτ ′pτ λa.p || FVτ → λa.p || FFτ λa.p || q · EFτ → q || ˜ µa.p || Eeτ

´ Etienne Miquey Classical realizability and side-effects 21/ 47

e p E V F

slide-44
SLIDE 44

Introduction A constructive proof of DC Algebraic models of classical realizability

Danvy’s semantics artifacts

CPS : p || eτ := [ [e] ]e [ [τ] ]τ [ [p] ]p [ [˜ µa.c] ]e := λτp.cτ[a := p] [ [E] ]e := λτp.pτ [ [E] ]E [ [µα.c] ]p := λτE.([ [c] ]c τ )[E/α] [ [V] ]p := λτE.E τ [ [V] ]v [ [˜ µ[a].a || Fτ ′] ]E := λτV.V τ[a := V]τ ′ [ [F] ]F [ [F] ]E := λτV.V τ [ [F] ]F [ [a] ]v := λτF.τ (a) τ (λτV.V τ[a := V]τ ′ [ [F] ]F ) [ [λa.p] ]v := λτF.F τ (λqτE.[ [p] ]p τ[a := q] E) [ [q · E] ]F := λτv.v [ [q] ]p τ [ [E] ]E

´ Etienne Miquey Classical realizability and side-effects 21/ 47

e p E V F

slide-45
SLIDE 45

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Store extension: τ ⊳ τ ′ Term-in-store (t|τ ): closed store τ s.t. FV (t) ⊆ dom(τ ).

( generalizes closed terms)

Pole : set of closures ⊥ ⊥ which is:

saturated: c′τ ′ ∈ ⊥ ⊥ and cτ → c′τ ′ implies cτ ∈ ⊥ ⊥ closed by store extension: cτ ∈ ⊥ ⊥ and τ ⊳ τ ′ implies cτ ′ ∈ ⊥ ⊥

Compatible stores: τ ⋄τ ′ Orthogonality (t|τ )⊥ ⊥(e|τ ′): τ ⋄τ ′ and t || eττ ′ ∈ ⊥ ⊥. Realizers: definitions derived from the small-step rules!

´ Etienne Miquey Classical realizability and side-effects 22/ 47

slide-46
SLIDE 46

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Store extension: τ ⊳ τ ′ Term-in-store (t|τ ): closed store τ s.t. FV (t) ⊆ dom(τ ).

( generalizes closed terms)

Pole : set of closures ⊥ ⊥ which is:

saturated: c′τ ′ ∈ ⊥ ⊥ and cτ → c′τ ′ implies cτ ∈ ⊥ ⊥ closed by store extension: cτ ∈ ⊥ ⊥ and τ ⊳ τ ′ implies cτ ′ ∈ ⊥ ⊥

Compatible stores: τ ⋄τ ′ Orthogonality (t|τ )⊥ ⊥(e|τ ′): τ ⋄τ ′ and t || eττ ′ ∈ ⊥ ⊥. Realizers: definitions derived from the small-step rules!

´ Etienne Miquey Classical realizability and side-effects 22/ 47

slide-47
SLIDE 47

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Adequacy For all ⊥ ⊥, if τ Γ and Γ ⊢c c, then cτ ∈ ⊥ ⊥. Normalization If ⊢l cτ then cτ normalizes.

Proof: The set ⊥ ⊥⇓ = {cτ ∈ C0 : cτ normalizes } is a pole. (+ Bonus: typed CPS translation unveiling Kripke’s forcing.)

´ Etienne Miquey Classical realizability and side-effects 22/ 47

slide-48
SLIDE 48

Introduction A constructive proof of DC Algebraic models of classical realizability

A classical sequent calculus with dependent types

Can this work? Πp . . . . Γ,a : A ⊢ p : B[a] | ∆ Γ ⊢ λa.p : Πa : A.B | ∆

(→r)

Πq . . . . Γ ⊢ q : A | ∆ Πe . . . . Γ | e : B[q] ⊢ ∆ q ∈ V Γ | q · e : Πa : A.B ⊢ ∆

(→l)

λa.p || q · e : (Γ ⊢ ∆)

(Cut)

−→

´ Etienne Miquey Classical realizability and side-effects 23/ 47

Chapter 7

slide-49
SLIDE 49

Introduction A constructive proof of DC Algebraic models of classical realizability

A classical sequent calculus with dependent types

Can this work? Πp . . . . Γ,a : A ⊢ p : B[a] | ∆ Γ ⊢ λa.p : Πa : A.B | ∆

(→r)

Πq . . . . Γ ⊢ q : A | ∆ Πe . . . . Γ | e : B[q] ⊢ ∆ q ∈ V Γ | q · e : Πa : A.B ⊢ ∆

(→l)

λa.p || q · e : (Γ ⊢ ∆)

(Cut)

−→ Πq . . . . Γ ⊢ q : A | ∆ Γ,a : A ⊢ p : ✚✚

B[a] | ∆ Γ,a : A | e : ✟✟

B[q] ⊢ ∆ p || e : (Γ,a : A ⊢ ∆) Mismatch Γ | ˜ µa.p || e : A ⊢ ∆

(˜ µ)

q || ˜ µa.p || e : (Γ ⊢ ∆)

(Cut)

´ Etienne Miquey Classical realizability and side-effects 23/ 47

Chapter 7

slide-50
SLIDE 50

Introduction A constructive proof of DC Algebraic models of classical realizability

A classical sequent calculus with dependent types

Can this work? Πp . . . . Γ,a : A ⊢ p : B[a] | ∆ Γ ⊢ λa.p : Πa : A.B | ∆

(→r)

Πq . . . . Γ ⊢ q : A | ∆ Πe . . . . Γ | e : B[q] ⊢ ∆ q ∈ V Γ | q · e : Πa : A.B ⊢ ∆

(→l)

λa.p || q · e : (Γ ⊢ ∆)

(Cut)

−→ Πq . . . . Γ ⊢ q : A | ∆ Γ,a : A ⊢ p : B[a] | ∆ Γ,a : A | e : B[q] ⊢ ∆; {·|p}{a|q} p || e : Γ,a : A ⊢ ∆; {a|q}

(Cut)

Γ | ˜ µa.p || e : A ⊢ ∆; {.|q}

(˜ µ)

q || ˜ µa.p || e : (Γ ⊢ ∆); {·|·}

(Cut)

´ Etienne Miquey Classical realizability and side-effects 23/ 47

Chapter 7

slide-51
SLIDE 51

Introduction A constructive proof of DC Algebraic models of classical realizability

dL

A type system with: a list of dependencies: Γ ⊢ p : A | ∆;σ Γ | e : A′ ⊢ ∆;σ{·|p} A′ ∈ Aσ p || e : (Γ ⊢ ∆;σ)

(Cut)

a value restriction Is it enough? subject reduction normalization consistency as a logic suitable for CPS translation

´ Etienne Miquey Classical realizability and side-effects 24/ 47

slide-52
SLIDE 52

Introduction A constructive proof of DC Algebraic models of classical realizability

dL

A type system with: a list of dependencies: Γ ⊢ p : A | ∆;σ Γ | e : A′ ⊢ ∆;σ{·|p} A′ ∈ Aσ p || e : (Γ ⊢ ∆;σ)

(Cut)

a value restriction Is it enough? subject reduction normalization consistency as a logic suitable for CPS translation ✗

´ Etienne Miquey Classical realizability and side-effects 24/ 47

slide-53
SLIDE 53

Introduction A constructive proof of DC Algebraic models of classical realizability

dL

A type system with: a list of dependencies: Γ ⊢ p : A | ∆;σ Γ | e : A′ ⊢ ∆;σ{·|p} A′ ∈ Aσ p || e : (Γ ⊢ ∆;σ)

(Cut)

a value restriction Is it enough? subject reduction normalization consistency as a logic suitable for CPS translation ✗

q ˜ µa.p || e = q

  • ¬¬A

(λa. p

  • ¬¬B(a)

e

  • ¬B(q)

)

´ Etienne Miquey Classical realizability and side-effects 24/ 47

slide-54
SLIDE 54

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (1/2)

This is quite normal: we observed a desynchronization we compensated only within the type system we need to do this already in the calculus! Who’s guilty ? q || ˜ µa.p || e = q (λa.pe) Moto: p shouldn’t be applied to e before q has reduced (q (λa.p))e So, we’re looking for:

´ Etienne Miquey Classical realizability and side-effects 25/ 47

slide-55
SLIDE 55

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (1/2)

This is quite normal: we observed a desynchronization we compensated only within the type system we need to do this already in the calculus! Who’s guilty ? q || ˜ µa.p || e = q (λa.pe) Moto: p shouldn’t be applied to e before q has reduced (q (λa.p))e So, we’re looking for:

´ Etienne Miquey Classical realizability and side-effects 25/ 47

slide-56
SLIDE 56

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (1/2)

This is quite normal: we observed a desynchronization we compensated only within the type system we need to do this already in the calculus! Who’s guilty ? q || ˜ µa.p || e = q (λa.pe) Moto: p shouldn’t be applied to e before q has reduced (q (λa.p))e So, we’re looking for:

´ Etienne Miquey Classical realizability and side-effects 25/ 47

slide-57
SLIDE 57

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (1/2)

This is quite normal: we observed a desynchronization we compensated only within the type system we need to do this already in the calculus! Who’s guilty ? q || ˜ µa.p || e = q (λa.pe) Moto: p shouldn’t be applied to e before q has reduced (q (λa.p))e So, we’re looking for: λa.p || q · e → µ ˆ tp.q || ˜ µa.p || ˆ tp || e

´ Etienne Miquey Classical realizability and side-effects 25/ 47

slide-58
SLIDE 58

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (2/2)

λa.p || q · e

?

−→ (q (λa.p))e Qestions:

1

Is any q compatible with such a reduction ?

2

Is this typable ?

´ Etienne Miquey Classical realizability and side-effects 26/ 47

slide-59
SLIDE 59

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (2/2)

λa.p || q · e

?

−→ (q (λa.p))e Qestions:

1

Is any q compatible with such a reduction ?

If q eventually gives a value V: p[V/a]e ✓ If q → λ .t and drops its continuation: te ✗

´ Etienne Miquey Classical realizability and side-effects 26/ 47

slide-60
SLIDE 60

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (2/2)

λa.p || q · e

?

−→ (q (λa.p))e Qestions:

1

Is any q compatible with such a reduction ? q ∈ nef

If q eventually gives a value V: p[V/a]e ✓ If q → λ .t and drops its continuation: te ✗ Negative-elimination free (Herbelin’12) Values +

  • ne continuation variable

+ no application

´ Etienne Miquey Classical realizability and side-effects 26/ 47

slide-61
SLIDE 61

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (2/2)

λa.p || q · e

?

−→ (q (λa.p))e Qestions:

1

Is any q compatible with such a reduction ? q ∈ nef

2

Is this typable ? Naive atempt:

( q

  • (A→⊥)→⊥

( λa.p

  • Π(a:A)¬¬B(a)

)) e

  • ¬B[q]

´ Etienne Miquey Classical realizability and side-effects 26/ 47

slide-62
SLIDE 62

Introduction A constructive proof of DC Algebraic models of classical realizability

Toward a CPS translation (2/2)

λa.p || q · e

?

−→ (q (λa.p))e Qestions:

1

Is any q compatible with such a reduction ? q ∈ nef

2

Is this typable ? Beter:

( q

  • ∀R.(Π(a:A)R(a))→R(q)

( λa.p

  • Π(a:A)¬¬B(a)

))

  • ¬¬B(q)

e

  • ¬B[q]

(Remark: not possible without q ∈ nef)

´ Etienne Miquey Classical realizability and side-effects 26/ 47

slide-63
SLIDE 63

Introduction A constructive proof of DC Algebraic models of classical realizability

dL ˆ

tp An extension of dL with: delimited continuations dependent types restricted to the nef fragment delimited scope of dependencies: c : (Γ ⊢d ∆, ˆ tp : A; {·|·}) Γ ⊢ µ ˆ tp.c : A | ∆ ˆ tpI B ∈ Aσ Γ | ˆ tp : A ⊢d ∆, ˆ tp : B;σ{·|p} ˆ tpE Mission accomplished? subject reduction normalization consistency as a logic CPS translation (Bonus) embedding into Lepigre’s calculus

realizability interpretation

´ Etienne Miquey Classical realizability and side-effects 27/ 47

Regular mode Dependent mode Γ ⊢ p : A | ∆ Γ | e : A ⊢ ∆ p || e : Γ ⊢ ∆ Γ ⊢ p : A | ∆ Γ | e : A ⊢d ∆, ˆ tp : B;σ{·|p} p || e : Γ ⊢d ∆, ˆ tp : B;σ

slide-64
SLIDE 64

Introduction A constructive proof of DC Algebraic models of classical realizability

dL ˆ

tp An extension of dL with: delimited continuations dependent types restricted to the nef fragment delimited scope of dependencies: c : (Γ ⊢d ∆, ˆ tp : A; {·|·}) Γ ⊢ µ ˆ tp.c : A | ∆ ˆ tpI B ∈ Aσ Γ | ˆ tp : A ⊢d ∆, ˆ tp : B;σ{·|p} ˆ tpE Mission accomplished subject reduction normalization consistency as a logic CPS translation (Bonus) embedding into Lepigre’s calculus

realizability interpretation

´ Etienne Miquey Classical realizability and side-effects 27/ 47

Regular mode Dependent mode Γ ⊢ p : A | ∆ Γ | e : A ⊢ ∆ p || e : Γ ⊢ ∆ Γ ⊢ p : A | ∆ Γ | e : A ⊢d ∆, ˆ tp : B;σ{·|p} p || e : Γ ⊢d ∆, ˆ tp : B;σ

slide-65
SLIDE 65

Introduction A constructive proof of DC Algebraic models of classical realizability

dLPAω

A classical sequent calculus with: stratified dependent types :

terms: t,u ::= ... | wit p formulas: A,B ::= ... | ∀xT.A | ∃xT.A | Πa : A.B | t = u proofs: p,q ::= ... | λx.p | (t,p) | λa.p

a restriction to the nef fragment arithmetical terms:

t,u ::= ... | 0 | S(t) | rect

xy[t0 | tS] | λx.t | t u

stores:

τ ::= ε | τ[a := pτ ] | τ[α := e]

inductive and coinductive constructions:

p,q ::= ... | indt

bn[p | p] | cofixt bn p

a call-by-value reduction and lazy evaluation of cofix

´ Etienne Miquey Classical realizability and side-effects 28/ 47

Chapter 8

slide-66
SLIDE 66

Introduction A constructive proof of DC Algebraic models of classical realizability

End of the road

dPAω

+ control operators + dependent types + co-fixpoints + sharing & laziness

dLPAω?

+ sequent calculus + dependent types + co-fixpoints + sharing & laziness

?-calculus Subject reduction Subject reduction Normalization ? ?

´ Etienne Miquey Classical realizability and side-effects 29/ 47

slide-67
SLIDE 67

Introduction A constructive proof of DC Algebraic models of classical realizability

End of the road

dPAω

+ control operators + dependent types + co-fixpoints + sharing & laziness

dLPAω

+ sequent calculus + dependent types + co-fixpoints + sharing & laziness

Subject reduction Subject reduction Normalization macros realizability

´ Etienne Miquey Classical realizability and side-effects 29/ 47

slide-68
SLIDE 68

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Same methodology:

1

small-step reductions

2

derive the realizability interpretation Resembles λ[lvτ ⋆]-interpretation, plus: dependent types from Lepigre’s calculus co-inductive formulas

´ Etienne Miquey Classical realizability and side-effects 30/ 47

slide-69
SLIDE 69

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Same methodology:

1

small-step reductions

2

derive the realizability interpretation Resembles λ[lvτ ⋆]-interpretation, plus: dependent types from Lepigre’s calculus: Πa : A.B

  • ∀a.(a ∈ A → B)

co-inductive formulas

´ Etienne Miquey Classical realizability and side-effects 30/ 47

slide-70
SLIDE 70

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Same methodology:

1

small-step reductions

2

derive the realizability interpretation Resembles λ[lvτ ⋆]-interpretation, plus: dependent types from Lepigre’s calculus co-inductive formulas: by finite approximations νt

XxAf n∈ F n A,tf

´ Etienne Miquey Classical realizability and side-effects 30/ 47

slide-71
SLIDE 71

Introduction A constructive proof of DC Algebraic models of classical realizability

Realizability interpretation

Same methodology:

1

small-step reductions

2

derive the realizability interpretation Resembles λ[lvτ ⋆]-interpretation, plus: dependent types from Lepigre’s calculus co-inductive formulas: by finite approximations Consequences of adequacy: Normalization If Γ ⊢σ c, then c is normalizable. Consistency dLPAω p : ⊥

´ Etienne Miquey Classical realizability and side-effects 30/ 47

slide-72
SLIDE 72

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion and further work

Contributions of this part: classical call-by-need:

realizability interpretation typed continuation-and-store-passing style translation

dependent classical sequent calculus:

list of dependencies use of delimited continuations for soundness dependently-typed continuation-passing style translation

dLPAω:

soundness and normalization, realizability interpretation of co-fixpoints

´ Etienne Miquey Classical realizability and side-effects 31/ 47

slide-73
SLIDE 73

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion and further work

Contributions of this part: classical call-by-need dependent classical sequent calculus dLPAω Further work:

1

Can dLtp be related to:

P´ edrot-Tabareau’s Baclofen Type Theory ? V´ ak´ ar’s categorical presentation ? Bowman et. al. CPS for CC ?

2

Relation to Krivine’s realizability semantics of DC:

Compatible with quote? Approximation of the limits required for bar recursion?

3

Algebraic counterpart of side-effects in realizability structures?

´ Etienne Miquey Classical realizability and side-effects 31/ 47

slide-74
SLIDE 74

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion and further work

Contributions of this part: classical call-by-need dependent classical sequent calculus dLPAω Further work:

1

Can dLtp be related to:

P´ edrot-Tabareau’s Baclofen Type Theory ? V´ ak´ ar’s categorical presentation ? Bowman et. al. CPS for CC ?

2

Relation to Krivine’s realizability semantics of DC:

Compatible with quote? Approximation of the limits required for bar recursion?

3

Algebraic counterpart of side-effects in realizability structures?

´ Etienne Miquey Classical realizability and side-effects 31/ 47

slide-75
SLIDE 75

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion and further work

Contributions of this part: classical call-by-need dependent classical sequent calculus dLPAω Further work:

1

Can dLtp be related to:

P´ edrot-Tabareau’s Baclofen Type Theory ? V´ ak´ ar’s categorical presentation ? Bowman et. al. CPS for CC ?

2

Relation to Krivine’s realizability semantics of DC:

Compatible with quote? Approximation of the limits required for bar recursion?

3

Algebraic counterpart of side-effects in realizability structures?

´ Etienne Miquey Classical realizability and side-effects 31/ 47

slide-76
SLIDE 76

Introduction A constructive proof of DC Algebraic models of classical realizability

Part III

  • Algebraic models of classical realizability

´ Etienne Miquey Classical realizability and side-effects 32/ 47

slide-77
SLIDE 77

Introduction A constructive proof of DC Algebraic models of classical realizability

Algebraization of classical realizability

Realizers: t A defined as t ∈ A⊥

Key elements: the pole ⊥ ⊥ the latice (P(Π),⊇) Observations: this induces a semantic subtyping:

A ≤⊥

⊥ B

B ⊆ A

connectives/quantifiers: ∀ =

  • ∧ = ×

Realizability

This is to be compared with: ∀ =

  • = ∧

Forcing

´ Etienne Miquey Classical realizability and side-effects 33/ 47

Chapter 9

slide-78
SLIDE 78

Introduction A constructive proof of DC Algebraic models of classical realizability

Algebraization of classical realizability

Realizers: t A defined as t ∈ A⊥

Key elements: the pole ⊥ ⊥ the latice (P(Π),⊇) Observations: this induces a semantic subtyping:

A ≤⊥

⊥ B

B ⊆ A

connectives/quantifiers: ∀ =

  • ∧ = ×

Realizability

This is to be compared with: ∀ =

  • = ∧

Forcing

´ Etienne Miquey Classical realizability and side-effects 33/ 47

Chapter 9

slide-79
SLIDE 79

Introduction A constructive proof of DC Algebraic models of classical realizability

Algebraization of classical realizability

Realizers: t A defined as t ∈ A⊥

Key elements: the pole ⊥ ⊥ the latice (P(Π),⊇) Observations: this induces a semantic subtyping:

A ≤⊥

⊥ B

B ⊆ A

connectives/quantifiers: ∀ =

  • ∧ = ×

Realizability

This is to be compared with: ∀ =

  • = ∧

Forcing

´ Etienne Miquey Classical realizability and side-effects 33/ 47

Chapter 9

slide-80
SLIDE 80

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative structures

Formulas Types Proofs λ-terms In particular, a b reads: a is a subtype of b a is a realizer of b the realizer a is more defined than b

´ Etienne Miquey Classical realizability and side-effects 34/ 47

Chapter 10

slide-81
SLIDE 81

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative structures

Formulas Types Proofs λ-terms ⊆ In particular, a b reads: a is a subtype of b a is a realizer of b the realizer a is more defined than b

´ Etienne Miquey Classical realizability and side-effects 34/ 47

Chapter 10

slide-82
SLIDE 82

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative structures

Formulas Types Proofs λ-terms In particular, a b reads: a is a subtype of b a is a realizer of b the realizer a is more defined than b

´ Etienne Miquey Classical realizability and side-effects 34/ 47

Chapter 10

slide-83
SLIDE 83

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative structures

Definition: Complete meet-semilatice (A,,→) s.t.: if a0 a and b b0 then (a → b) (a0 → b0)

  • b∈B(a → b) = a →

b∈B b

Examples: complete Heyting/Boolean algebras classical realizability:

A P(Π); a b a ⊇ b a → b a⊥

⊥ · b = {t · π : t ∈ a⊥ ⊥,π ∈ b}

´ Etienne Miquey Classical realizability and side-effects 34/ 47

Chapter 10

slide-84
SLIDE 84

Introduction A constructive proof of DC Algebraic models of classical realizability

Interpretating of λ-terms

λ-terms:

a@b {c ∈ A : a (b → c)} λf

a∈A(a → f (a))

call/cc: cc

a,b∈A(((a → b) → a) → a)

Adjunction: a b → c ⇔ a@b c Adequacy: If ⊢ t : A then t A AA In particular:

kA =

a,b∈A(a → b → a)

sA =

a,b,c∈A((a → b → c) → (a → b) → a → c)

´ Etienne Miquey Classical realizability and side-effects 35/ 47

slide-85
SLIDE 85

Introduction A constructive proof of DC Algebraic models of classical realizability

Interpretating of λ-terms

λ-terms:

a@b {c ∈ A : a (b → c)} λf

a∈A(a → f (a))

call/cc: cc

a,b∈A(((a → b) → a) → a)

Adjunction: a b → c ⇔ a@b c Adequacy: If ⊢ t : A then t A AA In particular:

kA =

a,b∈A(a → b → a)

sA =

a,b,c∈A((a → b → c) → (a → b) → a → c)

´ Etienne Miquey Classical realizability and side-effects 35/ 47

slide-86
SLIDE 86

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative algebras

Separator S:

1

kA ∈ S, and sA ∈ S

(Combinators)

2

If a ∈ S and a b, then b ∈ S.

(Upwards closure)

3

If (a → b) ∈ S and a ∈ S, then b ∈ S.

(Modus ponens)

Implicative algebras: (A,,→) + separator S Entailment: a ⊢S b a → b ∈ S. Adjunction a ⊢S b → c if and only if a × b ⊢S c

´ Etienne Miquey Classical realizability and side-effects 36/ 47

slide-87
SLIDE 87

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative algebras

Separator S:

1

kA ∈ S, and sA ∈ S

(Combinators)

2

If a ∈ S and a b, then b ∈ S.

(Upwards closure)

3

If (a → b) ∈ S and a ∈ S, then b ∈ S.

(Modus ponens)

Implicative algebras: (A,,→) + separator S Entailment: a ⊢S b a → b ∈ S. Adjunction a ⊢S b → c if and only if a × b ⊢S c

´ Etienne Miquey Classical realizability and side-effects 36/ 47

slide-88
SLIDE 88

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative tripos

Adjunction a ⊢S b → c if and only if a × b ⊢S c ( (A/S,⊢S,×,+,→) is a Heyting algebra)

Tripos: T : Setop → HA I → AI/S[I] Collapse criteria The following are equivalent:

1

T is isomorphic to a forcing tripos

2

S ⊆ A is a principal filter of A.

3

S ⊆ A is finitely generated and ⋔ ∈ S.

´ Etienne Miquey Classical realizability and side-effects 37/ 47

slide-89
SLIDE 89

Introduction A constructive proof of DC Algebraic models of classical realizability

Implicative tripos

Adjunction a ⊢S b → c if and only if a × b ⊢S c ( (A/S,⊢S,×,+,→) is a Heyting algebra)

Tripos: T : Setop → HA I → AI/S[I] Collapse criteria The following are equivalent:

1

T is isomorphic to a forcing tripos

2

S ⊆ A is a principal filter of A.

3

S ⊆ A is finitely generated and ⋔ ∈ S.

´ Etienne Miquey Classical realizability and side-effects 37/ 47

slide-90
SLIDE 90

Introduction A constructive proof of DC Algebraic models of classical realizability

Decomposing the arrow

Logic: A → B

  • ¬A ∨ B

Different axiomatic:

S1 : (A ∨ A) → A S2 : A → (A ∨ B) S3 : (A ∨ B) → (B ∨ A) S4 : (A → B) → ((C ∨ A) → (C ∨ B))

λ-calculus: λx.t ˜ µ([x],β).t || β : ¬A ` B L` fragment of Munch-Maccagnoni’s system L embedding of the call-by-name λ-calculus

´ Etienne Miquey Classical realizability and side-effects 38/ 47

Chapter 11

slide-91
SLIDE 91

Introduction A constructive proof of DC Algebraic models of classical realizability

Disjunctive structures

Complete meet-semilatice (A,,`,¬):

1

¬ is anti-monotonic

2

` is monotonic

3

  • b∈B(a ` b) = a ` (

b∈B b)

and

  • b∈B(b ` a) = (

b∈B b) ` a

4

¬

a∈A a = a∈A ¬a

Examples: complete Boolean algebras classical realizability in L`:

A P(Π) a b a ⊇ b a ` b (a,b) ¬a [a⊥

⊥]

Induced implication (A,,

`

→) with a

`

→ b ¬a ` b is an implicative structure

´ Etienne Miquey Classical realizability and side-effects 39/ 47

slide-92
SLIDE 92

Introduction A constructive proof of DC Algebraic models of classical realizability

Disjunctive structures

Complete meet-semilatice (A,,`,¬):

1

¬ is anti-monotonic

2

` is monotonic

3

  • b∈B(a ` b) = a ` (

b∈B b)

and

  • b∈B(b ` a) = (

b∈B b) ` a

4

¬

a∈A a = a∈A ¬a

Examples: complete Boolean algebras classical realizability in L`:

A P(Π) a b a ⊇ b a ` b (a,b) ¬a [a⊥

⊥]

Induced implication (A,,

`

→) with a

`

→ b ¬a ` b is an implicative structure

´ Etienne Miquey Classical realizability and side-effects 39/ 47

slide-93
SLIDE 93

Introduction A constructive proof of DC Algebraic models of classical realizability

Disjunctive structures

Complete meet-semilatice (A,,`,¬):

1

¬ is anti-monotonic

2

` is monotonic

3

  • b∈B(a ` b) = a ` (

b∈B b)

and

  • b∈B(b ` a) = (

b∈B b) ` a

4

¬

a∈A a = a∈A ¬a

Examples: complete Boolean algebras classical realizability in L`:

A P(Π) a b a ⊇ b a ` b (a,b) ¬a [a⊥

⊥]

Induced implication (A,,

`

→) with a

`

→ b ¬a ` b is an implicative structure

´ Etienne Miquey Classical realizability and side-effects 39/ 47

slide-94
SLIDE 94

Introduction A constructive proof of DC Algebraic models of classical realizability

Interpreting L`

Contexts:

(a,b) a ` b [a] ¬a µ+.c

a∈A{a : c(a) ∈ ⊥

⊥}

Terms:

µ−.c

a∈A{a : c(a) ∈ ⊥

⊥} µ().c

a,b∈A{a ` b : c(a,b) ∈ ⊥

⊥} µ[].c

a∈A{¬a : c(a) ∈ ⊥

⊥}

Adequacy

1

for any term t, if Γ ⊢ t : A | ∆, then (t[σ])A A[σ]A;

2

for any context e, if Γ | e : A ⊢ ∆, then (e[σ])A A[σ]A; Besides:

λ-calculus L` (A→,,→) (A`,,`,¬)

[ ]A→ [ ]A` ι ´ Etienne Miquey Classical realizability and side-effects 40/ 47

slide-95
SLIDE 95

Introduction A constructive proof of DC Algebraic models of classical realizability

Interpreting L`

Contexts:

(a,b) a ` b [a] ¬a µ+.c

a∈A{a : c(a) ∈ ⊥

⊥}

Terms:

µ−.c

a∈A{a : c(a) ∈ ⊥

⊥} µ().c

a,b∈A{a ` b : c(a,b) ∈ ⊥

⊥} µ[].c

a∈A{¬a : c(a) ∈ ⊥

⊥}

Adequacy

1

for any term t, if Γ ⊢ t : A | ∆, then (t[σ])A A[σ]A;

2

for any context e, if Γ | e : A ⊢ ∆, then (e[σ])A A[σ]A; Besides:

λ-calculus L` (A→,,→) (A`,,`,¬)

[ ]A→ [ ]A` ι ´ Etienne Miquey Classical realizability and side-effects 40/ 47

slide-96
SLIDE 96

Introduction A constructive proof of DC Algebraic models of classical realizability

Disjunctive algebras

Bourbaki’s axioms: s`

1

  • a∈A [(a ` a) → a]

s`

2

  • a,b∈A [a → (a ` b)]

s`

3

  • a,b∈A [(a ` b) → (b ` a)]

s`

4

  • a,b,c∈A [(a → b) → (c ` a) → (c ` b)]

s`

5

  • a,b,c∈A [(a ` (b ` c)) → ((a ` b) ` c)]

Separator S: (1) If a ∈ S and a b then b ∈ S (upward closure) (2) s1,s2,s3,s4 and s5 are in S (combinators) (3) If a

`

→ b ∈ S and a ∈ S then b ∈ S (closure under modus ponens)

´ Etienne Miquey Classical realizability and side-effects 41/ 47

slide-97
SLIDE 97

Introduction A constructive proof of DC Algebraic models of classical realizability

Internal logic

Recall: a ⊢S b a

`

→ b ∈ S Sum type:

  • 1. a ` b ⊢S a + b
  • 2. a + b ⊢S a ` b

Negation:

  • 1. ¬a ⊢S a

`

→ ⊥

  • 2. a

`

→ ⊥ ⊢S ¬a Double-negation elimination:

  • 1. a ⊢S ¬¬a
  • 2. ¬¬a ⊢S a

Theorem S is an implicative separator

´ Etienne Miquey Classical realizability and side-effects 42/ 47

slide-98
SLIDE 98

Introduction A constructive proof of DC Algebraic models of classical realizability

Internal logic

Recall: a ⊢S b a

`

→ b ∈ S Sum type:

  • 1. a ` b ⊢S a + b
  • 2. a + b ⊢S a ` b

Negation:

  • 1. ¬a ⊢S a

`

→ ⊥

  • 2. a

`

→ ⊥ ⊢S ¬a Double-negation elimination:

  • 1. a ⊢S ¬¬a
  • 2. ¬¬a ⊢S a

Theorem S is an implicative separator

´ Etienne Miquey Classical realizability and side-effects 42/ 47

slide-99
SLIDE 99

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion

Disjunctive structures: induced by classical realizability allow to adequately embed L` are implicative structures Disjunctive algebras: are intrinsically classical are implicative algebras do not necessarily collapse to a forcing situation Conclusion Implicative algebras are more general.

´ Etienne Miquey Classical realizability and side-effects 43/ 47

slide-100
SLIDE 100

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion

Disjunctive structures: induced by classical realizability allow to adequately embed L` are implicative structures Disjunctive algebras: are intrinsically classical are implicative algebras do not necessarily collapse to a forcing situation Conclusion Implicative algebras are more general.

´ Etienne Miquey Classical realizability and side-effects 43/ 47

slide-101
SLIDE 101

Introduction A constructive proof of DC Algebraic models of classical realizability

Conclusion

Disjunctive structures: induced by classical realizability allow to adequately embed L` are implicative structures Disjunctive algebras: are intrinsically classical are implicative algebras do not necessarily collapse to a forcing situation Conclusion Implicative algebras are more general.

´ Etienne Miquey Classical realizability and side-effects 43/ 47

slide-102
SLIDE 102

Introduction A constructive proof of DC Algebraic models of classical realizability

Conjunctive algebras

Same process:

1

Conjunctive structures (A,,⊗,¬)

2

Adequate embedding of L⊗

3

Conjunctive algebras What we got: Duality between conjunctive and disjunctive structures Construction of conjunctive algebras from disjunctive algebras. What we don’t: Internal logic Triposes Construction of disjunctive algebras from conjunctive algebras.

´ Etienne Miquey Classical realizability and side-effects 44/ 47

Chapter 12

slide-103
SLIDE 103

Introduction A constructive proof of DC Algebraic models of classical realizability

Conjunctive algebras

Same process:

1

Conjunctive structures (A,,⊗,¬)

2

Adequate embedding of L⊗

3

Conjunctive algebras What we got: Duality between conjunctive and disjunctive structures Construction of conjunctive algebras from disjunctive algebras. What we don’t: Internal logic Triposes Construction of disjunctive algebras from conjunctive algebras.

´ Etienne Miquey Classical realizability and side-effects 44/ 47

Chapter 12

slide-104
SLIDE 104

Introduction A constructive proof of DC Algebraic models of classical realizability

Conjunctive algebras

Same process:

1

Conjunctive structures (A,,⊗,¬)

2

Adequate embedding of L⊗

3

Conjunctive algebras What we got: Duality between conjunctive and disjunctive structures Construction of conjunctive algebras from disjunctive algebras. What we don’t: Internal logic Triposes Construction of disjunctive algebras from conjunctive algebras.

´ Etienne Miquey Classical realizability and side-effects 44/ 47

Chapter 12

slide-105
SLIDE 105

Introduction A constructive proof of DC Algebraic models of classical realizability

Final picture

´ Etienne Miquey Classical realizability and side-effects 45/ 47

Implicative algebras

⇒ ∧ ∀ M → ×

  • ∈ S

Disjunctive algebras

¬ ∨ ∀ M ¬ `

  • ∈ S`

Conjunctive algebras

¬ ∧ ∃ M ¬ ⊗

  • ∈ S ⊗

Boolean algebras

¬ ∧ ∀ M ¬

  • ∈ F

a → b = ¬a ` b a → b = ¬a b ` = a ⊳ b = b a, S⊗ = ¬−1(S`) ⊗ =

(Bonus: proven in Coq )

slide-106
SLIDE 106

Introduction A constructive proof of DC Algebraic models of classical realizability

Final picture

´ Etienne Miquey Classical realizability and side-effects 45/ 47

Implicative algebras

⇒ ∧ ∀ M → ×

  • ∈ S

Disjunctive algebras

¬ ∨ ∀ M ¬ `

  • ∈ S`

Conjunctive algebras

¬ ∧ ∃ M ¬ ⊗

  • ∈ S ⊗

Boolean algebras

¬ ∧ ∀ M ¬

  • ∈ F

a → b = ¬a ` b a → b = ¬a b ` = a ⊳ b = b a, S⊗ = ¬−1(S`) ⊗ =

(Bonus: proven in Coq )

slide-107
SLIDE 107

Introduction A constructive proof of DC Algebraic models of classical realizability

Further works

Several directions to explore:

1

Complete the duality:

Conjunctive triposes? From conjunctive algebras to disjunctive algebras?

2

Combination of disjunctive and conjunctive algebras:

Would it collapse to a forcing situation? Any chance to get call-by-push-value algebras?

3

Algebraic counterpart of strategy/side-effects:

Lazy algebras? Algebraic counterpart of memory? ...

´ Etienne Miquey Classical realizability and side-effects 46/ 47

slide-108
SLIDE 108

Introduction A constructive proof of DC Algebraic models of classical realizability

Further works

Several directions to explore:

1

Complete the duality:

Conjunctive triposes? From conjunctive algebras to disjunctive algebras?

2

Combination of disjunctive and conjunctive algebras:

Would it collapse to a forcing situation? Any chance to get call-by-push-value algebras?

3

Algebraic counterpart of strategy/side-effects:

Lazy algebras? Algebraic counterpart of memory? ...

´ Etienne Miquey Classical realizability and side-effects 46/ 47

slide-109
SLIDE 109

Introduction A constructive proof of DC Algebraic models of classical realizability

Further works

Several directions to explore:

1

Complete the duality:

Conjunctive triposes? From conjunctive algebras to disjunctive algebras?

2

Combination of disjunctive and conjunctive algebras:

Would it collapse to a forcing situation? Any chance to get call-by-push-value algebras?

3

Algebraic counterpart of strategy/side-effects:

Lazy algebras? Algebraic counterpart of memory? ...

´ Etienne Miquey Classical realizability and side-effects 46/ 47

slide-110
SLIDE 110

Introduction A constructive proof of DC Algebraic models of classical realizability

Further works

Several directions to explore:

1

Complete the duality:

Conjunctive triposes? From conjunctive algebras to disjunctive algebras?

2

Combination of disjunctive and conjunctive algebras:

Would it collapse to a forcing situation? Any chance to get call-by-push-value algebras?

3

Algebraic counterpart of strategy/side-effects:

Lazy algebras? Algebraic counterpart of memory? ...

´ Etienne Miquey Classical realizability and side-effects 46/ 47

slide-111
SLIDE 111

Introduction A constructive proof of DC Algebraic models of classical realizability

Thank you for you atention.

´ Etienne Miquey Classical realizability and side-effects 47/ 47

slide-112
SLIDE 112

CbN CPS dLPAω Implicative Alg. ⊗-algebra

Implicative tripos

Tripos: T : Setop → HA I → AI/S[I] For the product AI, two possible separators: SI

  • i∈I S

S[I]

  • {a ∈ AI : ∃s ∈ S.∀i ∈ I.s ai}

(product) (uniform) The diagram:

AI AI/S[I] AI/SI (A/S)I = T (I) = T (1)I

[·]/S[I] [·]/SI ρI ιI ϱI ∼

´ Etienne Miquey Classical realizability and side-effects 1/ 5

slide-113
SLIDE 113

CbN CPS dLPAω Implicative Alg. ⊗-algebra

Application in L⊗: t u

  • µα.t || µ[β].(u,[α]) || β

Application in conjunctive structures: t@u =

  • {a : t
  • {¬b : u ⊗ ¬a b}

´ Etienne Miquey Classical realizability and side-effects 2/ 5