Quick viewing(Text Mode)

The Benefits of Sequent Calculus

Introduction calculus Benefits

The benefits of

Etienne´ Miquey

Equipe´ Galline‚e, INRIA LS2N, Universite´ de Nantes

Logic Mentoring Workshop 22/06/2019

1/ 22 Introduction Sequent calculus Benefits Forewords

This talk is about: sequent calculus / Curry-Howard / operational

But also : proofs, programs, type systems, safe computation/compilation, …

A fairy tale Sequent calculus provides wonderful tools!

Gives principled answers to problems such as: how to soundly compile ×××? how to prove normalization of ×××? how should control operators and ××× interact? deciding the equivalence of normal forms

2/ 22 Introduction Sequent calculus Benefits Forewords

This talk is about: sequent calculus / Curry-Howard / operational semantics

But also : proofs, programs, type systems, safe computation/compilation, …

A fairy tale Sequent calculus provides wonderful tools!

Gives principled answers to problems such as: how to soundly compile ×××? how to prove normalization of ×××? how should control operators and ××× interact? deciding the equivalence of normal forms

2/ 22 Introduction Sequent calculus Benefits Forewords

This talk is about: sequent calculus / Curry-Howard / operational semantics

But also : proofs, programs, type systems, safe computation/compilation, …

A fairy tale Sequent calculus provides wonderful tools!

Gives principled answers to problems such as: how to soundly compile ×××? how to prove normalization of ×××? how should control operators and ××× interact? deciding the equivalence of normal forms

2/ 22 Introduction Sequent calculus Benefits

Proofs A bit of history, fast-tracked

3/ 22 Introduction Sequent calculus Benefits Once upon a time…

-300

Euclide

Euclide’s Elements

4/ 22 Introduction Sequent calculus Benefits Once upon a time…

-300 2019

Euclide

4/ 22 Introduction Sequent calculus Benefits Once upon a time…

-300 1666 2019

Euclide Leibniz

A crazy dream:

“when there are disputes among persons, we can simply say: Let us calculate, without further ado, to see who is right.” Leibniz’s calculus ratiocinator

4/ 22 Introduction Sequent calculus Benefits Once upon a time…

-300 1666 1879 2019

Euclide Leibniz Frege

Frege’s Begri€sschri: a ! F C(a) f formal notations F(a) quantifications / b F(b) ∀ ∃ c d distinction: c = d x vs 0x 0 F(d) signified signifier F(c) A(c, d)

4/ 22 Introduction Sequent calculus Benefits Once upon a time…

-300 1666 1879 1928 2019 a ! F C(a) f F(a) b F(b) c d c = d F(d) F(c) Euclide Leibniz FregeA(c, d) Hilbert

Entscheidungsproblem (with Acker- mann):

To decide if a formula of first-order is a .

# “to decide” is meant by means of a procedure Hilbert

4/ 22 Introduction Sequent calculus Benefits Once upon a time…

-300 1666 1879 1928 1936 2019 a ! F C(a) f F(a) b F(b) c d c = d F(d) F(c) Euclide Leibniz FregeA(c, d) Hilbert Church

λ-calculus - first (negative) answer to the !

Church

4/ 22 Introduction Sequent calculus Benefits A somewhat obvious observation

Deduction rules Typing rules

A ∈ Γ (x : A) ∈ Γ (Ax) (Ax) Γ ` A Γ ` x : A Γ, A ` B Γ, x : A ` t : B (→ ) (→ ) Γ ` A ⇒ B I Γ ` λx.t : A → B I ` ⇒ ` ` → ` Γ A B Γ A (→ ) Γ t : A B Γ u : A (→ ) Γ ` B E Γ ` t u : B E

5/ 22 Introduction Sequent calculus Benefits Sequent, you said?

Sequent:

Hypotheses A1,..., An ` B Conclusion

Remark:

[A] . Γ, A ` B . (⇒I ) is almost . Γ ` A ⇒ B B (⇒ ) A ⇒ B I

“a` la Gentzen”“a` la Prawitz”

… a.k.a.

6/ 22 Introduction Sequent calculus Benefits Sequent, you said?

Sequent:

Hypotheses A1,..., An ` B Conclusion

Remark:

[A] . Γ, A ` B . (⇒I ) is almost . Γ ` A ⇒ B B (⇒ ) A ⇒ B I

“a` la Gentzen”“a` la Prawitz”

… a.k.a. natural deduction

6/ 22 Introduction Sequent calculus Benefits Gentzen’s sequent calculus (1934)

Sequent:

Hypotheses A1,..., An ` B1,..., Bp Conclusions

Identity rules connect hypotheses/conclusions

Γ ` A, ∆ Γ, A ` ∆ (Cut) (Ax) Γ ` ∆ A ` A

Structural rules weaken, contract, permute

Γ ` ∆ Γ ` A, A, ∆ Γ ` σ(∆) (w ) (c ) (σ ) … Γ ` A, ∆ r Γ ` A, ∆ r Γ ` ∆ r

Logical rules le/right introduction of connectives Γ, A ` B, ∆ Γ ` A, ∆ Γ, B ` ∆ Γ ` A, ∆ Γ ` B, ∆ (⇒ ) (⇒ ) (∧ ) Γ ` A ⇒ B, ∆ r Γ, A ⇒ B ` ∆ l Γ ` A ∧ B, ∆ r 7/ 22 Introduction Sequent calculus Benefits Gentzen’s sequent calculus (1934)

Sequent:

Hypotheses A1,..., An ` B1,..., Bp Conclusions

Identity rules connect hypotheses/conclusions

Γ ` A, ∆ Γ, A ` ∆ (Cut) (Ax) Γ ` ∆ A ` A

Structural rules weaken, contract, permute

Γ ` ∆ Γ ` A, A, ∆ Γ ` σ(∆) (w ) (c ) (σ ) … Γ ` A, ∆ r Γ ` A, ∆ r Γ ` ∆ r

Logical rules le/right introduction of connectives Γ, A ` B, ∆ Γ ` A, ∆ Γ, B ` ∆ Γ ` A, ∆ Γ ` B, ∆ (⇒ ) (⇒ ) (∧ ) Γ ` A ⇒ B, ∆ r Γ, A ⇒ B ` ∆ l Γ ` A ∧ B, ∆ r 7/ 22 Introduction Sequent calculus Benefits Gentzen’s sequent calculus (1934)

Sequent:

Hypotheses A1,..., An ` B1,..., Bp Conclusions

Proof-theoretic properties: cut elimination last rule subformula built-in …

7/ 22 Introduction Sequent calculus Benefits Gentzen’s sequent calculus (1934)

Sequent:

Hypotheses A1,..., An ` B1,..., Bp Conclusions

Identity rules connect hypotheses/conclusions

Γ ` A, ∆ Γ, A ` ∆ (Cut) (Ax) Γ ` ∆ A ` A

Structural rules Symmetry weaken, contract, permute

Γ ` ∆ Γ ` A, A, ∆ Γ ` σ(∆) (w ) (c ) (σ ) … Γ ` A, ∆ r Γ ` A, ∆ r Γ ` ∆ r

Logical rules le/right introduction of connectives Γ, A ` B, ∆ Γ ` A, ∆ Γ, B ` ∆ Γ ` A, ∆ Γ ` B, ∆ (⇒ ) (⇒ ) (∧ ) Γ ` A ⇒ B, ∆ r Γ, A ⇒ B ` ∆ l Γ ` A ∧ B, ∆ r 7/ 22 Introduction Sequent calculus Benefits

What about the computational content?

8/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s duality of computation

Gri€in (1990): classical logic  control operator Starting observation:

Computational duality:

·⊥

Terms Contexts

·⊥

Sequent calculus  abstract machine-like calculus

9/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s duality of computation

Gri€in (1990): classical logic  control operator Starting observation:

Computational duality:

·⊥

Terms Contexts

·⊥

Sequent calculus  abstract machine-like calculus

9/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s duality of computation

Gri€in (1990): classical logic  control operator Starting observation:

Computational duality:

·⊥

Terms Contexts

·⊥

Sequent calculus  abstract machine-like calculus

9/ 22 Introduction Sequent calculus Benefits Abstract machine

Reduction

h || i h || · i t u e Babs t u e h || · i h [ / ] || i λx. t u e Babs t u x e

Syntax

c ::= ht || ei commands

terms t,u ::= e, f ::= contexts variable | x,y, z | ? empty application | t u | t · e application stack λ-abstraction | λx. t

10/ 22 Introduction Sequent calculus Benefits Introducing µ

h || i h || · i t u e Babs t u e This reduction defines (t u):

It is the that, when put against | ei, reduces to ht ||u · ei.

Idea: introduce a more primitive

hµα. c || ei Bµ c [e/α]

t u , µα. ht || u · αi

(actually the intuitionistic version µ?.c is enough)

11/ 22 Introduction Sequent calculus Benefits Introducing µ

h || i h || · i t u e Babs t u e This reduction defines (t u):

It is the term that, when put against | ei, reduces to ht ||u · ei.

Idea: introduce a more primitive syntax

hµα. c || ei Bµ c [e/α]

t u , µα. ht || u · αi

(actually the intuitionistic version µ?.c is enough)

11/ 22 Introduction Sequent calculus Benefits Introducing µ˜

A regular syntax?

c ::= ht || ei t,u ::= e, f ::= | x,y | α, β | λx.t | t · e | µα. c | ? h( Reminder:) || i λx.t u e Babs

Same idea, in the dual situation: 12/ 22 h || i h || i00 let x = t in u e Babs t “let x =  in u e

/ ht || µ˜x.ci Bµ˜ c [t x] Introduction Sequent calculus Benefits Introducing µ˜

A regular syntax?

c ::= ht || ei t,u ::= e, f ::= | x,y | α, β | λx.t | t · e | µα. c | ?

Same idea, in the dual situation: h( ) || i h || i h || i00 λx.t u e Babs let x = t in u e Babs t “let x =  in u e

/ ht || µ˜x.ci Bµ˜ c [t x]

12/ 22 Introduction Sequent calculus Benefits Introducing µ˜

A regular syntax

c ::= ht || ei t,u ::= e, f ::= | x,y | α, β | λx.t | t · e | µα. c | µ˜x. c

Same idea, in the dual situation: h( ) || i h || i h || i00 λx.t u e Babslet x = t in u e Babs t “let x =  in u e | {z } µ˜x.hu || ei

/ ht || µ˜x.ci Bµ˜ c [t x]

12/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= | x,y | α, β | λx.t | t · e | µα. c | µ˜x. c

Reduction:

hλx.t || u · ei → u µ˜x.ht || ei ht || µ˜x.ci → c[t/x] hµα.c || ei → c[e/α]

13/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= | x,y | α, β | λx.t | t · e | µα. c | µ˜x. c

Reduction:

hλx.t || u · ei → u µ˜x.ht || ei ht || µ˜x.ci → c[t/x] hµα.c || ei → c[e/α]

Critical pair: hµα.c || µ˜x.c 0i .& c[µ˜x.c 0/α] c 0[µα.c/x]

13/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= n | x,y | α, β o Values Co-values | λx.t | t · e | µα. c | µ˜x. c

Reduction:

hλx.t || u · ei → u µ˜x.ht || ei ht || µ˜x.ci → c[t/x] t ∈ V hµα.c || ei → c[e/α] e ∈ E

Critical pair: h || 0i CbV µα.c µ˜x.c CbN .& c[µ˜x.c 0/α] c 0[µα.c/x]

13/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= n | x,y | α, β o Values Co-values | λx.t | t · e | µα. c | µ˜x. c

Reduction:

hλx.t || u · ei → u µ˜x.ht || ei ht || µ˜x.ci → c[t/x] t ∈ V hµα.c || ei → c[e/α] e ∈ E

Critical pair: h || 0i CbV µα.c µ˜x.c CbN .& c[µ˜x.c 0/α] Duality c 0[µα.c/x] (again and again) 13/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= n | x,y | α, β o Values Co-values | λx.t | t · e | µα. c | µ˜x. c

Typing rules: Γ ` t : A | ∆ Γ | e : A ` ∆ ht || ei : (Γ ` ∆) (x : A)∈ Γ Γ, x : A ` t : B | ∆ c : ( Γ ` ∆, α : A) Γ ` x : A | ∆ Γ ` λx.t : A → B | ∆ Γ ` µα.c : A | ∆ (α : A)∈ ∆ Γ ` u : A | ∆ Γ | e : B ` ∆ c : ( Γ, x : A ` ∆) Γ | α : A ` ∆ Γ | u · e : A → B ` ∆ Γ | µ˜x.c : A ` ∆

13/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= n | x,y | α, β o Values Co-values | λx.t | t · e | µα. c | µ˜x. c

Typing rules: Γ ` t : A | ∆ Γ | e : A ` ∆ ht || ei : (Γ ` ∆) (x : A)∈ Γ Γ, x : A ` t : B | ∆ c : ( Γ ` ∆, α : A) Γ ` x : A | ∆ Γ ` λx.t : A → B | ∆ Γ ` µα.c : A | ∆ (α : A)∈ ∆ Γ ` u : A | ∆ Γ | e : B ` ∆ c : ( Γ, x : A ` ∆) Γ | α : A ` ∆ Γ | u · e : A → B ` ∆ Γ | µ˜x.c : A ` ∆

13/ 22 Introduction Sequent calculus Benefits Curien-Herbelin’s λµµ˜-calculus

Syntax:

t,u ::= c ::= ht || ei e, f ::= n | x,y | α, β o Values Co-values | λx.t | t · e | µα. c | µ˜x. c

Typing rules: Γ ` t : A | ∆ Γ | e : A ` ∆ ht || ei : (Γ ` ∆) (x : A)∈ Γ Γ, x : A ` t : B | ∆ c : ( Γ ` ∆, α : A) Γ ` x : A | ∆ Γ ` λx.t : A → B | ∆ Γ ` µα.c : A | ∆ (α : A)∈ ∆ Γ ` u : A | ∆ Γ | e : B ` ∆ c : ( Γ, x : A ` ∆) Γ | α : A ` ∆ Γ | u · e : A → B ` ∆ Γ | µ˜x.c : A ` ∆

13/ 22 Introduction Sequent calculus Benefits

“Why should I care?”

14/ 22 Introduction Sequent calculus Benefits

“Why should I care?” Because sequent calculus is well-behaved!

14/ 22 Introduction Sequent calculus Benefits Sequent calculus as IR

You just defined a wonderful calculus, and you are wondering: Problem How to define a continuation-passing style translation?

CPS translation: · : source → λsomething Benefits: J K something preserving reduction If λ is sound and normalizing: preserving typing 1 If t normalizes, then t normalizes J K the type ⊥ is not inhabited 2 If t is typed, then t normalizes J K V , λk.k V 3 There is no term ` t : ⊥ Typically: J K t , λk.? J K

15/ 22 Introduction Sequent calculus Benefits Sequent calculus as IR

You just defined a wonderful calculus, and you are wondering: Problem How to define a continuation-passing style translation?

Solution Use sequent calculus!

Slogan: A sequent calculus is a defunctionalization of CPS representations.

# as such it defines a good intermediate representation for compilation

Method: Danvy’s semantics artifacts

15/ 22 Introduction Sequent calculus Benefits Sequent calculus as IR

You just defined a wonderful calculus, and you are wondering: Problem How to define a continuation-passing style translation?

Solution Use sequent calculus!

Slogan: A sequent calculus is a defunctionalization of CPS representations.

# as such it defines a good intermediate representation for compilation

Method: Danvy’s semantics artifacts

15/ 22 Introduction Sequent calculus Benefits Semantics artifacts in action

Call-by-name λµµ˜-calculus:

Terms t ::= V | µα.c Contexts e ::= E | µ˜x.c Values V ::= x | λx.t Co-values E ::= α | t · e Commands c ::= ht || ei

Reduction rules: ht || µ˜x.ci → c[t/x] hµα.c || Ei → c[E/α]

hλx.t || u · ei → u µ˜x.ht || ei

16/ 22 Introduction Sequent calculus Benefits Semantics artifacts in action

Terms t ::= V | µα.c Contexts e ::= E | µ˜x.c Values V ::= x | λx.t Co-values E ::= α | t · e Commands c ::= ht || ei

Small steps CPS

ht || µ˜x.cie ce [t/x] µ˜x.c e t , (λx. c c ) t e J K J K ht || Eie ht || Eit E e t , t E E J K J K hµα.c || Eit ce [E/α] µα.c t E , (λα. c c ) E t J K J K hV || Eit hV || EiE V t E , E [[V ]]V J K E hV || u · eiE hV || u · eiV u · e E V , V u t e e J K J K J K h || · i h || i V λx.t u e V u µ˜x. t e e λx.t V u e , (λx.e t t )u J K J K

16/ 22 Introduction Sequent calculus Benefits Semantics artifacts in action

Terms t ::= V | µα.c Contexts e ::= E | µ˜x.c Values V ::= x | λx.t Co-values E ::= α | t · e Commands c ::= ht || ei

Small steps CPS

ht || µ˜x.cie ce [t/x] µ˜x.c e t , (λx. c c ) t e J K J K ht || Eie ht || Eit E e t , t E E J K J K hµα.c || Eit ce [E/α] µα.c t E , (λα. c c ) E t J K J K hV || Eit hV || EiE V t E , E [[V ]]V J K E hV || u · eiE hV || u · eiV u · e E V , V u t e e J K J K J K h || · i h || i V λx.t u e V u µ˜x. t e e λx.t V u e , (λx.e t t )u J K J K Preservation 1 0 + 0 c c ⇒ [[c]]c →β [[c ]]c 16/ 22 Introduction Sequent calculus Benefits Semantics artifacts in action

Terms t ::= V | µα.c Contexts e ::= E | µ˜x.c Values V ::= x | λx.t Co-values E ::= α | t · e Commands c ::= ht || ei

CPS Types translation

µ˜x.c e t , (λx. c c ) t [[A]]e , [[A]]t → ⊥ e J K J K E e t , t E E J K J K µα.c t E , (λα. c c ) E [[A]]t , [[A]]E → ⊥ t J K J K V t E , E [[V ]]V J K E u · e E V , V u t e e [[A]]E , [[A]]V → ⊥ J K J K J K V λx.t V u e , (λx.e t t )u [[A → B]]V , [[A]]t → [[B]]e → ⊥ J K J K Preservation

Γ ` t : A | ∆ ⇒ [[Γ]]t , [[∆]]E ` [[t]]t : [[A]]t 16/ 22 Introduction Sequent calculus Benefits Semantics artifacts in action

Normalization Typed commands of the call-by-name λµµ˜-calculus normalize.

Inhabitation

There is no simply-typed λ-term t such that ` t : [[⊥]]t .

Soundness There is no t such that ` t : ⊥ | .

16/ 22 Introduction Sequent calculus Benefits Normalization proofs

You just defined a wonderful calculus, but the CPS method is too complex: Problem How can I prove normalization?

Solution Use sequent calculus + Krivine realizability!

Slogan:

A sequent calculus specifies the interactions of terms and contexts.

# as you will see, this helps a lot the definition of a realizability

Method: Danvy’s semantics artifacts, again

17/ 22 Introduction Sequent calculus Benefits Normalization proofs

You just defined a wonderful calculus, but the CPS method is too complex: Problem How can I prove normalization?

Solution Use sequent calculus + Krivine realizability!

Slogan:

A sequent calculus specifies the interactions of terms and contexts.

# as you will see, this helps a lot the definition of a realizability interpretation

Method: Danvy’s semantics artifacts, again

17/ 22 Introduction Sequent calculus Benefits Normalization proofs

You just defined a wonderful calculus, but the CPS method is too complex: Problem How can I prove normalization?

Solution Use sequent calculus + Krivine realizability!

Slogan:

A sequent calculus specifies the interactions of terms and contexts.

# as you will see, this helps a lot the definition of a realizability interpretation

Method: Danvy’s semantics artifacts, again

17/ 22 Introduction Sequent calculus Benefits Realizability a` la Krivine

(think of some kind of unary logical relation) falsity value kAk: contexts, opponent to A |A| : terms, player of A pole ⊥⊥: commands, referee

ht || ei c0 · · · cn ∈ ⊥⊥?

⊥⊥⊂ Λ ? Π closed by anti-reduction

Truth value defined by orthogonality :

|A| = kAk⊥⊥ = {t ∈ Λ : e ∈ kAk, ht || ei ∈ ⊥⊥} ∀

18/ 22 Introduction Sequent calculus Benefits Realizability a` la Krivine

(think of some kind of unary logical relation) Intuition falsity value kAk: contexts, opponent to A truth value |A| : terms, player of A pole ⊥⊥: commands, referee

ht || ei c0 · · · cn ∈ ⊥⊥?

⊥⊥⊂ Λ ? Π closed by anti-reduction

Truth value defined by orthogonality :

|A| = kAk⊥⊥ = {t ∈ Λ : e ∈ kAk, ht || ei ∈ ⊥⊥} ∀

18/ 22 Introduction Sequent calculus Benefits Realizability a` la Krivine

(think of some kind of unary logical relation) Intuition falsity value kAk: contexts, opponent to A truth value |A| : terms, player of A pole ⊥⊥: commands, referee

ht || ei c0 · · · cn ∈ ⊥⊥?

⊥⊥⊂ Λ ? Π closed by anti-reduction

Truth value defined by orthogonality :

|A| = kAk⊥⊥ = {t ∈ Λ : e ∈ kAk, ht || ei ∈ ⊥⊥} ∀

18/ 22 Introduction Sequent calculus Benefits Semantic artifacts, bis Contexts e ::= E | µ˜x.c Terms t ::= V | µα.c Values V ::= x | λx.t Co-values E ::= α | t · e Commands c ::= ht || ei

Small steps Realizability ⊥⊥ e ht || µ˜x.cie ce [t/x] kAke , |A|t ht || Eie ht || Eit ⊥⊥ t hµα.c || Eit ce [E/α] |A|t , kAkE hV || Eit hV || EiE

E hV || u · eiE hV || u · eiV kA → BkE , {u · e : u ∈ |A|t ∧ e ∈ kBke } V hλx.t || u · eiV u µ˜x.ht || ei e

19/ 22 Introduction Sequent calculus Benefits Semantic artifacts, bis Contexts e ::= E | µ˜x.c Terms t ::= V | µα.c Values V ::= x | λx.t Co-values E ::= α | t · e Commands c ::= ht || ei

Small steps Realizability ⊥⊥ e ht || µ˜x.cie ce [t/x] kAke , |A|t ht || Eie ht || Eit ⊥⊥ t hµα.c || Eit ce [E/α] |A|t , kAkE hV || Eit hV || EiE

E hV || u · eiE hV || u · eiV kA → BkE , {u · e : u ∈ |A|t ∧ e ∈ kBke } V hλx.t || u · eiV u µ˜x.ht || ei e Adequacy 3 1 · ` t : A | · ⇒ t ∈ |A|t c : (· ` ·) ⇒ c ∈ ⊥⊥

2 · | e : A ` · ⇒ e ∈ kAke 19/ 22 Introduction Sequent calculus Benefits Consequences

Normalizing commands

⊥⊥⇓ , {c : c normalizes} defines a valid pole.

Proof. If c → c0 and c0 normalizes, so does c. 

Normalization For any command c, if c : Γ ` ∆, then c normalizes.

Proof. By adequacy, any typed command c belongs to the pole ⊥⊥⇓. 

Soundness There is no proof t such that ` t : ⊥ | .

⊥⊥ Proof. Otherwise, t ∈ |⊥|t = Π for any pole, absurd (⊥⊥ , ∅). 

20/ 22 Introduction Sequent calculus Benefits Polarized sequent calculus

You added sums to your favorite λ-calculus, it broke all your proofs: Problem What can I do?

Solution Use sequent calculus + polarities!

Negative polarity Every expression is a value (CBN) Positive polarity Every context is a covalue (CBV)

Slogan: Polarized λµµ˜ is a good, regular syntax for programs. # a.k.a. , a great syntax for call-by-push-value Method: see Munch-Maccagnoni & Scherer’s paper (LICS’15)

21/ 22 Introduction Sequent calculus Benefits Polarized sequent calculus

You added sums to your favorite λ-calculus, it broke all your proofs: Problem What can I do?

Solution Use sequent calculus + polarities!

Negative polarity Every expression is a value (CBN) Positive polarity Every context is a covalue (CBV)

Slogan: Polarized λµµ˜ is a good, regular syntax for programs. # a.k.a. system L, a great syntax for call-by-push-value Method: see Munch-Maccagnoni & Scherer’s paper (LICS’15)

21/ 22 Introduction Sequent calculus Benefits Polarized sequent calculus

You added sums to your favorite λ-calculus, it broke all your proofs: Problem What can I do?

Solution Use sequent calculus + polarities!

Negative polarity Every expression is a value (CBN) Positive polarity Every context is a covalue (CBV)

Slogan: Polarized λµµ˜ is a good, regular syntax for programs. # a.k.a. system L, a great syntax for call-by-push-value Method: see Munch-Maccagnoni & Scherer’s paper (LICS’15)

21/ 22 Introduction Sequent calculus Benefits Take away

Sequent calculus: is more regular than natural deduction corresponds to abstract-machine-like calculi (e.g. λµµ˜-calculus) provides great insights on operational semantics

A flexible tool: can be decomposed with connectives of can be polarized (Munch-Maccagnoni’s system L) supports e€ectful constructors …

If you don’t use it already, What are you waiting for?

22/ 22 Introduction Sequent calculus Benefits Take away

Sequent calculus: is more regular than natural deduction corresponds to abstract-machine-like calculi (e.g. λµµ˜-calculus) provides great insights on operational semantics

A flexible tool: can be decomposed with connectives of linear logic can be polarized (Munch-Maccagnoni’s system L) supports e€ectful constructors …

If you don’t use it already, What are you waiting for?

22/ 22 Introduction Sequent calculus Benefits Take away

Sequent calculus: is more regular than natural deduction corresponds to abstract-machine-like calculi (e.g. λµµ˜-calculus) provides great insights on operational semantics

A flexible tool: can be decomposed with connectives of linear logic can be polarized (Munch-Maccagnoni’s system L) supports e€ectful constructors …

If you don’t use it already, What are you waiting for?

22/ 22 SELECTED REFERENCES On sequent calculus/proofs-as-programs: The Duality of Computation. Curien & Herbelin (2000) A Tutorial on Computational Classical Logic and the Sequent Calculus Downen & Ariola (2018) LKQ and LKT: Sequent calculi for second order logic … Danos, Joinet & Schellinx (1995) On polarized sequent calculi: Polarised Intermediate Representation of with Sums Munch-Maccagnoni & Scherer (2015) Syntax and Models of a Non-Associative Composition of Programs and Proofs Munch-Maccagnoni (2013) A Preview of a Tutorial on Polarised L Calculi Maillard, M., Montillet, Munch-Maccagnoni, Scherer (2018) Use cases of Danvy’s semantics artifacts: A Constructive Proof of Dependent Choice in Classical Arithmetic via Memoization. M. (2019)