Curry-Howard isomorphism for sequent calculus at...

103
Introduction Sequent calculus Natural deduction Results Curry-Howard isomorphism for sequent calculus at last Jos´ e Carlos Esp´ ırito Santo Centro de Matem´ atica Universidade do Minho Portugal [email protected] Estonian-Finnish Logic Meeting Rakvere, Estonia 14 November 2015

Transcript of Curry-Howard isomorphism for sequent calculus at...

Page 1: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Curry-Howard isomorphism for sequent calculusat last

Jose Carlos Espırito Santo

Centro de MatematicaUniversidade do Minho

[email protected]

Estonian-Finnish Logic MeetingRakvere, Estonia

14 November 2015

Page 2: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Goal

In the same sense as the simply-typed λ-calculus (resp.combinators) corresponds to natural deduction (Hilbertsystems), what variant of the simply-typed lambda-calculusdoes correspond to the sequent calculus for intuitionisticimplicational logic?

Question in the purest form

Clear-cut answer required

More than a term assignment, a computational interpretation

An interpretation of proofs in terms of a functional language,so that, when cut-elimination is rephrased accordingly, ameaningful, perhaps familiar, computational behavior isrecognized

Page 3: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Goal

In the same sense as the simply-typed λ-calculus (resp.combinators) corresponds to natural deduction (Hilbertsystems),

what variant of the simply-typed lambda-calculusdoes correspond to the sequent calculus for intuitionisticimplicational logic?

Question in the purest form

Clear-cut answer required

More than a term assignment, a computational interpretation

An interpretation of proofs in terms of a functional language,so that, when cut-elimination is rephrased accordingly, ameaningful, perhaps familiar, computational behavior isrecognized

Page 4: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Goal

In the same sense as the simply-typed λ-calculus (resp.combinators) corresponds to natural deduction (Hilbertsystems), what variant of the simply-typed lambda-calculusdoes correspond to the sequent calculus for intuitionisticimplicational logic?

Question in the purest form

Clear-cut answer required

More than a term assignment, a computational interpretation

An interpretation of proofs in terms of a functional language,so that, when cut-elimination is rephrased accordingly, ameaningful, perhaps familiar, computational behavior isrecognized

Page 5: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Goal

In the same sense as the simply-typed λ-calculus (resp.combinators) corresponds to natural deduction (Hilbertsystems), what variant of the simply-typed lambda-calculusdoes correspond to the sequent calculus for intuitionisticimplicational logic?

Question in the purest form

Clear-cut answer required

More than a term assignment, a computational interpretation

An interpretation of proofs in terms of a functional language,so that, when cut-elimination is rephrased accordingly, ameaningful, perhaps familiar, computational behavior isrecognized

Page 6: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Goal

In the same sense as the simply-typed λ-calculus (resp.combinators) corresponds to natural deduction (Hilbertsystems), what variant of the simply-typed lambda-calculusdoes correspond to the sequent calculus for intuitionisticimplicational logic?

Question in the purest form

Clear-cut answer required

More than a term assignment, a computational interpretation

An interpretation of proofs in terms of a functional language,so that, when cut-elimination is rephrased accordingly, ameaningful, perhaps familiar, computational behavior isrecognized

Page 7: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Goal

In the same sense as the simply-typed λ-calculus (resp.combinators) corresponds to natural deduction (Hilbertsystems), what variant of the simply-typed lambda-calculusdoes correspond to the sequent calculus for intuitionisticimplicational logic?

Question in the purest form

Clear-cut answer required

More than a term assignment, a computational interpretation

An interpretation of proofs in terms of a functional language,so that, when cut-elimination is rephrased accordingly, ameaningful, perhaps familiar, computational behavior isrecognized

Page 8: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

An open question

Girard, 1989: “From an algorithmic viewpoint, the sequentcalculus has no Curry-Howard isomorphism, because of themultitude of ways of writing the same proof”

Sørensen-Urzykzyn, 2006: sequent calculus corresponds toexplicit substitutions, but “this is just the beginning of thestory”

Wikipedia: “The structure of sequent calculus relates to acalculus whose structure is close to the one of some abstractmachines”

Page 9: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

An open question

Girard, 1989: “From an algorithmic viewpoint, the sequentcalculus has no Curry-Howard isomorphism, because of themultitude of ways of writing the same proof”

Sørensen-Urzykzyn, 2006: sequent calculus corresponds toexplicit substitutions, but “this is just the beginning of thestory”

Wikipedia: “The structure of sequent calculus relates to acalculus whose structure is close to the one of some abstractmachines”

Page 10: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

An open question

Girard, 1989: “From an algorithmic viewpoint, the sequentcalculus has no Curry-Howard isomorphism, because of themultitude of ways of writing the same proof”

Sørensen-Urzykzyn, 2006: sequent calculus corresponds toexplicit substitutions, but “this is just the beginning of thestory”

Wikipedia: “The structure of sequent calculus relates to acalculus whose structure is close to the one of some abstractmachines”

Page 11: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

An open question

Girard, 1989: “From an algorithmic viewpoint, the sequentcalculus has no Curry-Howard isomorphism, because of themultitude of ways of writing the same proof”

Sørensen-Urzykzyn, 2006: sequent calculus corresponds toexplicit substitutions, but “this is just the beginning of thestory”

Wikipedia: “The structure of sequent calculus relates to acalculus whose structure is close to the one of some abstractmachines”

Page 12: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Basic unanswered questions

What does a variable stand for in a sequent calculus proofexpression?

What is the related substitution operation?

What is co-control?

Page 13: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Basic unanswered questions

What does a variable stand for in a sequent calculus proofexpression?

What is the related substitution operation?

What is co-control?

Page 14: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Basic unanswered questions

What does a variable stand for in a sequent calculus proofexpression?

What is the related substitution operation?

What is co-control?

Page 15: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Plan

Sequent calculus λµ

Internal interpretation

Natural deduction λlet

External interpretationExplains co-control, justifies design of λµ

Results

Page 16: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

SEQUENT CALCULUS

Page 17: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 18: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 19: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 20: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 21: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 22: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 23: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Overview of λµ

System λµ: formal vector notation with first-class co-control

Generalization of (the essence of) λ-calculus

Re-interpretation of a 15-years-old result

The λ-calculus has an isomorphic copy inside λThis copy is a formal vector notation

Dualization of first-class control as found in λµ-calculus

Concept of co-continuationµx .t (known from λµµ) becomes a co-control operator

Variables in proof expressions stand for co-continuations

λµ is developed hand-in-hand with isomorphic naturaldeduction system λlet

Page 24: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Herbelin’s λ-calculus

Permutation-free, focused fragment of sequent calculus

Two-sorted syntax

Proof terms t and lists lSequents Γ⇒ t : A and Γ|A⇒ l : B

Sketch of two computational interpretationsInternal interpretation

Lists are stacksCuts tl are states in a rudimentary abstract machine

External interpretation

Lists l = u1 :: · · · :: um :: [] are “evaluationcontexts”/continuations [·]N1 · · ·Nm

Cuts tl denote M filled in [·]N1 · · ·Nm

S.c. versus n.d.: inversion of associativity of non-abstractions

N.d. is left associative (· · · (MN1) · · ·Nm)S.c. is right associative t(u1 :: · · · (um :: []) · · · )

Page 25: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Herbelin’s λ-calculus

Permutation-free, focused fragment of sequent calculus

Two-sorted syntax

Proof terms t and lists lSequents Γ⇒ t : A and Γ|A⇒ l : B

Sketch of two computational interpretationsInternal interpretation

Lists are stacksCuts tl are states in a rudimentary abstract machine

External interpretation

Lists l = u1 :: · · · :: um :: [] are “evaluationcontexts”/continuations [·]N1 · · ·Nm

Cuts tl denote M filled in [·]N1 · · ·Nm

S.c. versus n.d.: inversion of associativity of non-abstractions

N.d. is left associative (· · · (MN1) · · ·Nm)S.c. is right associative t(u1 :: · · · (um :: []) · · · )

Page 26: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Herbelin’s λ-calculus

Permutation-free, focused fragment of sequent calculus

Two-sorted syntax

Proof terms t and lists lSequents Γ⇒ t : A and Γ|A⇒ l : B

Sketch of two computational interpretationsInternal interpretation

Lists are stacksCuts tl are states in a rudimentary abstract machine

External interpretation

Lists l = u1 :: · · · :: um :: [] are “evaluationcontexts”/continuations [·]N1 · · ·Nm

Cuts tl denote M filled in [·]N1 · · ·Nm

S.c. versus n.d.: inversion of associativity of non-abstractions

N.d. is left associative (· · · (MN1) · · ·Nm)S.c. is right associative t(u1 :: · · · (um :: []) · · · )

Page 27: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Herbelin’s λ-calculus

Permutation-free, focused fragment of sequent calculus

Two-sorted syntax

Proof terms t and lists lSequents Γ⇒ t : A and Γ|A⇒ l : B

Sketch of two computational interpretationsInternal interpretation

Lists are stacksCuts tl are states in a rudimentary abstract machine

External interpretation

Lists l = u1 :: · · · :: um :: [] are “evaluationcontexts”/continuations [·]N1 · · ·Nm

Cuts tl denote M filled in [·]N1 · · ·Nm

S.c. versus n.d.: inversion of associativity of non-abstractions

N.d. is left associative (· · · (MN1) · · ·Nm)S.c. is right associative t(u1 :: · · · (um :: []) · · · )

Page 28: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Herbelin’s λ-calculus

Permutation-free, focused fragment of sequent calculus

Two-sorted syntax

Proof terms t and lists lSequents Γ⇒ t : A and Γ|A⇒ l : B

Sketch of two computational interpretationsInternal interpretation

Lists are stacksCuts tl are states in a rudimentary abstract machine

External interpretation

Lists l = u1 :: · · · :: um :: [] are “evaluationcontexts”/continuations [·]N1 · · ·Nm

Cuts tl denote M filled in [·]N1 · · ·Nm

S.c. versus n.d.: inversion of associativity of non-abstractions

N.d. is left associative (· · · (MN1) · · ·Nm)S.c. is right associative t(u1 :: · · · (um :: []) · · · )

Page 29: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Vector notation

RecallM,N ::= λx .M (1st form)

| x ~N (2nd form)

| (λx .M)N ~N (3rd form)

Relaxed vector notation: 3rd form becomes M ~N

This introduces the need for vector bookkeeping

M[] = M

(x ~Q)N ~N = x( ~QN ~N)

(P ~Q)N ~N = P( ~QN ~N)

Page 30: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Vector notation

RecallM,N ::= λx .M (1st form)

| x ~N (2nd form)

| (λx .M)N ~N (3rd form)

Relaxed vector notation: 3rd form becomes M ~N

This introduces the need for vector bookkeeping

M[] = M

(x ~Q)N ~N = x( ~QN ~N)

(P ~Q)N ~N = P( ~QN ~N)

Page 31: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Vector notation

RecallM,N ::= λx .M (1st form)

| x ~N (2nd form)

| (λx .M)N ~N (3rd form)

Relaxed vector notation: 3rd form becomes M ~N

This introduces the need for vector bookkeeping

M[] = M

(x ~Q)N ~N = x( ~QN ~N)

(P ~Q)N ~N = P( ~QN ~N)

Page 32: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Vector notation

RecallM,N ::= λx .M (1st form)

| x ~N (2nd form)

| (λx .M)N ~N (3rd form)

Relaxed vector notation: 3rd form becomes M ~N

This introduces the need for vector bookkeeping

M[] = M

(x ~Q)N ~N = x( ~QN ~N)

(P ~Q)N ~N = P( ~QN ~N)

Page 33: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

A variant of Parigot’s λµ-calculus...

... called λµ-calculus

... whose management of sequents’ RHS we want to “dualize”

Control points M a, where a, b, · · · are co-variables

Control operator µa.M

Control operation: if C = ([·]N1 · · ·Nm) b

C[µa.M]→ [C/a]M

Context substitution (rather than “structural substitution”)

[C/a](M a) = C[M ′] where M ′ = [C/a]M

Page 34: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

A variant of Parigot’s λµ-calculus...

... called λµ-calculus

... whose management of sequents’ RHS we want to “dualize”

Control points M a, where a, b, · · · are co-variables

Control operator µa.M

Control operation: if C = ([·]N1 · · ·Nm) b

C[µa.M]→ [C/a]M

Context substitution (rather than “structural substitution”)

[C/a](M a) = C[M ′] where M ′ = [C/a]M

Page 35: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

A variant of Parigot’s λµ-calculus...

... called λµ-calculus

... whose management of sequents’ RHS we want to “dualize”

Control points M a, where a, b, · · · are co-variables

Control operator µa.M

Control operation: if C = ([·]N1 · · ·Nm) b

C[µa.M]→ [C/a]M

Context substitution (rather than “structural substitution”)

[C/a](M a) = C[M ′] where M ′ = [C/a]M

Page 36: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

A variant of Parigot’s λµ-calculus...

... called λµ-calculus

... whose management of sequents’ RHS we want to “dualize”

Control points M a, where a, b, · · · are co-variables

Control operator µa.M

Control operation: if C = ([·]N1 · · ·Nm) b

C[µa.M]→ [C/a]M

Context substitution (rather than “structural substitution”)

[C/a](M a) = C[M ′] where M ′ = [C/a]M

Page 37: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

A variant of Parigot’s λµ-calculus...

... called λµ-calculus

... whose management of sequents’ RHS we want to “dualize”

Control points M a, where a, b, · · · are co-variables

Control operator µa.M

Control operation: if C = ([·]N1 · · ·Nm) b

C[µa.M]→ [C/a]M

Context substitution (rather than “structural substitution”)

[C/a](M a) = C[M ′] where M ′ = [C/a]M

Page 38: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

A variant of Parigot’s λµ-calculus...

... called λµ-calculus

... whose management of sequents’ RHS we want to “dualize”

Control points M a, where a, b, · · · are co-variables

Control operator µa.M

Control operation: if C = ([·]N1 · · ·Nm) b

C[µa.M]→ [C/a]M

Context substitution (rather than “structural substitution”)

[C/a](M a) = C[M ′] where M ′ = [C/a]M

Page 39: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Syntax of proof expressions

(Terms) t, u, v ::= λx .t (1st form)| x k (2nd form, co-control point)| tk (3rd form)

(Generalized vectors) k ::= [] (empty vector)| µx .v (co-control operator)| u :: k (vector constructor)

Page 40: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Syntax of proof expressions

(Terms) t, u, v ::= λx .t (1st form)| x k (2nd form, co-control point)| tk (3rd form)

(Generalized vectors) k ::= [] (empty vector)| µx .v (co-control operator)| u :: k (vector constructor)

Page 41: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Typing

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Sequents Γ ` t : A and Γ|A ` k : A

Typing/inference rules

AxΓ|A ` [] : A

CutΓ ` t : A Γ|A ` k : B

Γ ` tk : B

PassΓ, x : A|A ` k : BΓ, x : A ` x k : B Act Γ, x : A ` v : B

Γ|A ` µx .v : B

⊃LΓ ` u : A Γ|B ` k : C

Γ|A ⊃ B ` u :: k : C⊃R

Γ, x : A ` t : BΓ ` λx .t : A ⊃ B

Page 42: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Typing

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Sequents Γ ` t : A and Γ|A ` k : A

Typing/inference rules

AxΓ|A ` [] : A

CutΓ ` t : A Γ|A ` k : B

Γ ` tk : B

PassΓ, x : A|A ` k : BΓ, x : A ` x k : B Act Γ, x : A ` v : B

Γ|A ` µx .v : B

⊃LΓ ` u : A Γ|B ` k : C

Γ|A ⊃ B ` u :: k : C⊃R

Γ, x : A ` t : BΓ ` λx .t : A ⊃ B

Page 43: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Typing

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Sequents Γ ` t : A and Γ|A ` k : A

Typing/inference rules

AxΓ|A ` [] : A

CutΓ ` t : A Γ|A ` k : B

Γ ` tk : B

PassΓ, x : A|A ` k : BΓ, x : A ` x k : B Act Γ, x : A ` v : B

Γ|A ` µx .v : B

⊃LΓ ` u : A Γ|B ` k : C

Γ|A ⊃ B ` u :: k : C⊃R

Γ, x : A ` t : BΓ ` λx .t : A ⊃ B

Page 44: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Derived syntax

Concatenation of two generalized vectors k@k ′

[]@k ′ = k ′

(u :: k)@k ′ = u :: (k@k ′)(µx .t)@k ′ = µx .tk ′

Page 45: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Derived syntax

Concatenation of two generalized vectors k@k ′

[]@k ′ = k ′

(u :: k)@k ′ = u :: (k@k ′)(µx .t)@k ′ = µx .tk ′

Page 46: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Derived syntax: co-continuations

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Co-continuations

H ::= x [·] | t([·]) |H[u :: [·]]

Hence co-continuations have the forms

x (u1 :: · · · :: um :: [·]) or t(u1 :: · · · :: um :: [·]) (m ≥ 0)that is, a non-abstraction with a hole at the right endhole expects a vector

Co-continuation substitution [H/x ]t and [H/x ]k

[H/x ](x k) = H[k ′] with k ′ = [H/x ]k

Page 47: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Derived syntax: co-continuations

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Co-continuations

H ::= x [·] | t([·]) |H[u :: [·]]

Hence co-continuations have the forms

x (u1 :: · · · :: um :: [·]) or t(u1 :: · · · :: um :: [·]) (m ≥ 0)that is, a non-abstraction with a hole at the right endhole expects a vector

Co-continuation substitution [H/x ]t and [H/x ]k

[H/x ](x k) = H[k ′] with k ′ = [H/x ]k

Page 48: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Derived syntax: co-continuations

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Co-continuations

H ::= x [·] | t([·]) |H[u :: [·]]

Hence co-continuations have the forms

x (u1 :: · · · :: um :: [·]) or t(u1 :: · · · :: um :: [·]) (m ≥ 0)that is, a non-abstraction with a hole at the right endhole expects a vector

Co-continuation substitution [H/x ]t and [H/x ]k

[H/x ](x k) = H[k ′] with k ′ = [H/x ]k

Page 49: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Derived syntax: co-continuations

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Co-continuations

H ::= x [·] | t([·]) |H[u :: [·]]

Hence co-continuations have the forms

x (u1 :: · · · :: um :: [·]) or t(u1 :: · · · :: um :: [·]) (m ≥ 0)that is, a non-abstraction with a hole at the right endhole expects a vector

Co-continuation substitution [H/x ]t and [H/x ]k

[H/x ](x k) = H[k ′] with k ′ = [H/x ]k

Page 50: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Reduction

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Reduction rules

(β) (λx .t)(u :: k) → (u(µx .t))k(µ) H[µx .t] → [H/x ]t(ε) t[] → t

(π1) (x k)k ′ → x (k@k ′)(π2) (tk)k ′ → t(k@k ′)

Interp: formal vector notation with first-class co-controlβ: function callµ: co-control operationε and πi : vector bookkeeping in relaxed vector notation

Page 51: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Reduction

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Reduction rules

(β) (λx .t)(u :: k) → (u(µx .t))k(µ) H[µx .t] → [H/x ]t(ε) t[] → t

(π1) (x k)k ′ → x (k@k ′)(π2) (tk)k ′ → t(k@k ′)

Interp: formal vector notation with first-class co-controlβ: function callµ: co-control operationε and πi : vector bookkeeping in relaxed vector notation

Page 52: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Reduction

Recall

(terms) t, u, v ::= λx .t | x k | tk(gen. vectors) k ::= [] | µx .t | u :: k

Reduction rules

(β) (λx .t)(u :: k) → (u(µx .t))k(µ) H[µx .t] → [H/x ]t(ε) t[] → t

(π1) (x k)k ′ → x (k@k ′)(π2) (tk)k ′ → t(k@k ′)

Interp: formal vector notation with first-class co-controlβ: function callµ: co-control operationε and πi : vector bookkeeping in relaxed vector notation

Page 53: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Reduction

Recall the µ-rule: H[µx .t]→ [H/x ]t

Partition of µ

(ρ) y (µx .t) → [y ([·])/x ]t(σ) t(µx .t) → [t([·])/x ]t(τ) H[u :: µx .t] → [H[u :: [·]]/x ]t

Logical procedurescut-elimination β, σ, ε, π

µ-elimination = co-control ρ, τ, σpermutation τ, σ, ε, πfocalization ρ, τ

Page 54: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Reduction

Recall the µ-rule: H[µx .t]→ [H/x ]t

Partition of µ

(ρ) y (µx .t) → [y ([·])/x ]t(σ) t(µx .t) → [t([·])/x ]t(τ) H[u :: µx .t] → [H[u :: [·]]/x ]t

Logical procedurescut-elimination β, σ, ε, π

µ-elimination = co-control ρ, τ, σpermutation τ, σ, ε, πfocalization ρ, τ

Page 55: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The λµ-calculus

Reduction

Recall the µ-rule: H[µx .t]→ [H/x ]t

Partition of µ

(ρ) y (µx .t) → [y ([·])/x ]t(σ) t(µx .t) → [t([·])/x ]t(τ) H[u :: µx .t] → [H[u :: [·]]/x ]t

Logical procedurescut-elimination β, σ, ε, π

µ-elimination = co-control ρ, τ, σpermutation τ, σ, ε, πfocalization ρ, τ

Page 56: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

NATURAL DEDUCTION

Page 57: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Developing natural deduction

Bidirectional syntax

Let-expressions (“Lets” vs cuts)

Lets vs explicit substitutions

Isomorphic to sequent calculus

Page 58: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Developing natural deduction

Bidirectional syntax

Let-expressions (“Lets” vs cuts)

Lets vs explicit substitutions

Isomorphic to sequent calculus

Page 59: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Developing natural deduction

Bidirectional syntax

Let-expressions (“Lets” vs cuts)

Lets vs explicit substitutions

Isomorphic to sequent calculus

Page 60: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Preliminaries

Developing natural deduction

Bidirectional syntax

Let-expressions (“Lets” vs cuts)

Lets vs explicit substitutions

Isomorphic to sequent calculus

Page 61: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Syntax of proof terms of λlet

(Terms) M,N,P ::= λx .M (abstraction)| app(H) (applicative term)| let x := H inP (let-expression)

(Heads) H ::= x (variable)| hd(M) (head term)| HN (application)

Page 62: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Syntax of proof terms of λlet

(Terms) M,N,P ::= λx .M (abstraction)| app(H) (applicative term)| let x := H inP (let-expression)

(Heads) H ::= x (variable)| hd(M) (head term)| HN (application)

Page 63: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Typing in λlet

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Sequents Γ ` M : A and Γ B H : A

Rules

Γ, x : AB x : AHyp

Γ B H : A Γ, x : A ` P : B

Γ ` let x := H inP : BLet

Γ B H : AΓ ` app(H) : A

WCoercionΓ ` M : A

Γ B hd(M) : ASCoercion

Γ, x : A ` M : B

Γ ` λx .M : A ⊃ BIntro

Γ B H : A ⊃ B Γ ` N : AΓ B HN : B

Elim

Page 64: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Typing in λlet

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Sequents Γ ` M : A and Γ B H : A

Rules

Γ, x : AB x : AHyp

Γ B H : A Γ, x : A ` P : B

Γ ` let x := H inP : BLet

Γ B H : AΓ ` app(H) : A

WCoercionΓ ` M : A

Γ B hd(M) : ASCoercion

Γ, x : A ` M : B

Γ ` λx .M : A ⊃ BIntro

Γ B H : A ⊃ B Γ ` N : AΓ B HN : B

Elim

Page 65: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Typing in λlet

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Sequents Γ ` M : A and Γ B H : A

Rules

Γ, x : AB x : AHyp

Γ B H : A Γ, x : A ` P : B

Γ ` let x := H inP : BLet

Γ B H : AΓ ` app(H) : A

WCoercionΓ ` M : A

Γ B hd(M) : ASCoercion

Γ, x : A ` M : B

Γ ` λx .M : A ⊃ BIntro

Γ B H : A ⊃ B Γ ` N : AΓ B HN : B

Elim

Page 66: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Derived syntax

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Continuations

K ::= app([·]) | let x := [·] inP | K[[·]N]

Hence co-continuations have the forms

app([·]N1 · · ·Nm) or let x := [·]N1 · · ·Nm inP (m ≥ 0)that is, a non-abstraction with a hole at the left endhole expects a head

Page 67: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Derived syntax

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Continuations

K ::= app([·]) | let x := [·] inP | K[[·]N]

Hence co-continuations have the forms

app([·]N1 · · ·Nm) or let x := [·]N1 · · ·Nm inP (m ≥ 0)that is, a non-abstraction with a hole at the left endhole expects a head

Page 68: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Reduction in λlet

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Rules

(beta) hd(λx .M)N → hd(let x := hd(N) inM)(let) let x := H inP → [H/x ]P

(triv) app(hd(M)) → M(head1) hd(app(H)) → H(head2) K[hd(let x := H inP)] → let x := H inK[hd(P)]

Comments: bidirectional, agnostic, computational λ-calculus

Page 69: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Reduction in λlet

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Rules

(beta) hd(λx .M)N → hd(let x := hd(N) inM)(let) let x := H inP → [H/x ]P

(triv) app(hd(M)) → M(head1) hd(app(H)) → H(head2) K[hd(let x := H inP)] → let x := H inK[hd(P)]

Comments: bidirectional, agnostic, computational λ-calculus

Page 70: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

The system

Reduction in λlet

Recall

(Terms) M,N,P ::= λx .M | app(H) | let x := H inP(Heads) H ::= x | hd(M) |HN

Rules

(beta) hd(λx .M)N → hd(let x := hd(N) inM)(let) let x := H inP → [H/x ]P

(triv) app(hd(M)) → M(head1) hd(app(H)) → H(head2) K[hd(let x := H inP)] → let x := H inK[hd(P)]

Comments: bidirectional, agnostic, computational λ-calculus

Page 71: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Mapping sequent calculus

Map Θ : λµ→ λlet

x (u1 :: · · · um :: []) 7→ app(xN1 · · ·Nm)x (u1 :: · · · um :: µy .v) 7→ let y := (xN1 · · ·Nm) inP

t(u1 :: · · · um :: []) 7→ app(hd(M)N1 · · ·Nm)t(u1 :: · · · um :: µy .v) 7→ let y := (hd(M)N1 · · ·Nm) inP

Replace each left-introduction by an elimination

Inversion of the associativity of non-abstractions

Page 72: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Mapping sequent calculus

Map Θ : λµ→ λlet

x (u1 :: · · · um :: []) 7→ app(xN1 · · ·Nm)x (u1 :: · · · um :: µy .v) 7→ let y := (xN1 · · ·Nm) inP

t(u1 :: · · · um :: []) 7→ app(hd(M)N1 · · ·Nm)t(u1 :: · · · um :: µy .v) 7→ let y := (hd(M)N1 · · ·Nm) inP

Replace each left-introduction by an elimination

Inversion of the associativity of non-abstractions

Page 73: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Mapping sequent calculus

Map Θ : λµ→ λlet

x (u1 :: · · · um :: []) 7→ app(xN1 · · ·Nm)x (u1 :: · · · um :: µy .v) 7→ let y := (xN1 · · ·Nm) inP

t(u1 :: · · · um :: []) 7→ app(hd(M)N1 · · ·Nm)t(u1 :: · · · um :: µy .v) 7→ let y := (hd(M)N1 · · ·Nm) inP

Replace each left-introduction by an elimination

Inversion of the associativity of non-abstractions

Page 74: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Mapping sequent calculus

Map Θ : λµ→ λlet

x (u1 :: · · · um :: []) 7→ app(xN1 · · ·Nm)x (u1 :: · · · um :: µy .v) 7→ let y := (xN1 · · ·Nm) inP

t(u1 :: · · · um :: []) 7→ app(hd(M)N1 · · ·Nm)t(u1 :: · · · um :: µy .v) 7→ let y := (hd(M)N1 · · ·Nm) inP

Proof expressions of λµ as instructions to build λlet proofs

tk 7→ K[hd(M)] where t 7→ M and k 7→ Kx k 7→ K[x ] where k 7→ K

u :: k 7→ K[[·]N] where u 7→ N and k 7→ Kµx .v 7→ let x := [·] inP where v 7→ P

[] 7→ app([·])

Page 75: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Mapping sequent calculus

Map Θ : λµ→ λlet

x (u1 :: · · · um :: []) 7→ app(xN1 · · ·Nm)x (u1 :: · · · um :: µy .v) 7→ let y := (xN1 · · ·Nm) inP

t(u1 :: · · · um :: []) 7→ app(hd(M)N1 · · ·Nm)t(u1 :: · · · um :: µy .v) 7→ let y := (hd(M)N1 · · ·Nm) inP

Proof expressions of λµ as instructions to build λlet proofs

tk 7→ K[hd(M)] where t 7→ M and k 7→ Kx k 7→ K[x ] where k 7→ K

u :: k 7→ K[[·]N] where u 7→ N and k 7→ Kµx .v 7→ let x := [·] inP where v 7→ P

[] 7→ app([·])

Page 76: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

RESULTS

Page 77: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Isomorphism

Isomorphism Θ : λµ ∼= λlet

Bijections of syntactic classes

terms t M termsgen. vectors k K continuations

co-continuations H H heads

Remark: exchange of primitive/derived concepts

Isomorphism of reduction relations

β betaµ letε trivπ head

Page 78: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Isomorphism

Isomorphism Θ : λµ ∼= λlet

Bijections of syntactic classes

terms t M termsgen. vectors k K continuations

co-continuations H H heads

Remark: exchange of primitive/derived concepts

Isomorphism of reduction relations

β betaµ letε trivπ head

Page 79: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Isomorphism

Isomorphism Θ : λµ ∼= λlet

Bijections of syntactic classes

terms t M termsgen. vectors k K continuations

co-continuations H H heads

Remark: exchange of primitive/derived concepts

Isomorphism of reduction relations

β betaµ letε trivπ head

Page 80: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Isomorphism

Isomorphism Θ : λµ ∼= λlet

Bijections of syntactic classes

terms t M termsgen. vectors k K continuations

co-continuations H H heads

Remark: exchange of primitive/derived concepts

Isomorphism of reduction relations

β betaµ letε trivπ head

Page 81: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Isomorphism

Isomorphism Θ : λµ ∼= λlet

Bijections of syntactic classes

terms t M termsgen. vectors k K continuations

co-continuations H H heads

Remark: exchange of primitive/derived concepts

Isomorphism of reduction relations

β betaµ letε trivπ head

Page 82: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Curry Howard at last

The two faces of the coin:

Internal interpretation: formal vector notation with first-classco-controlExternal interpretation: bidirectional, agnostic, computationalλ-calculus

Example: expression x k

Internal interpretation: co-control point, fill k in the hole ofthe co-continuation H that will substitute xExternal interpretation: fill head x in the hole of continuationK, where K = Θk - an instruction for the construction of aλlet derivation (fill x in k better notation for this reading)

Example: β-rule (λx .t)(u :: k)→ (u(µx .t))k

Internal interpretation: β-rule of a relaxed vector notationExternal interpretation: rule beta of λlet written in thenotation of instructions that λµ is

Page 83: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Curry Howard at last

The two faces of the coin:

Internal interpretation: formal vector notation with first-classco-controlExternal interpretation: bidirectional, agnostic, computationalλ-calculus

Example: expression x k

Internal interpretation: co-control point, fill k in the hole ofthe co-continuation H that will substitute xExternal interpretation: fill head x in the hole of continuationK, where K = Θk - an instruction for the construction of aλlet derivation (fill x in k better notation for this reading)

Example: β-rule (λx .t)(u :: k)→ (u(µx .t))k

Internal interpretation: β-rule of a relaxed vector notationExternal interpretation: rule beta of λlet written in thenotation of instructions that λµ is

Page 84: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Curry Howard at last

The two faces of the coin:

Internal interpretation: formal vector notation with first-classco-controlExternal interpretation: bidirectional, agnostic, computationalλ-calculus

Example: expression x k

Internal interpretation: co-control point, fill k in the hole ofthe co-continuation H that will substitute x

External interpretation: fill head x in the hole of continuationK, where K = Θk - an instruction for the construction of aλlet derivation (fill x in k better notation for this reading)

Example: β-rule (λx .t)(u :: k)→ (u(µx .t))k

Internal interpretation: β-rule of a relaxed vector notationExternal interpretation: rule beta of λlet written in thenotation of instructions that λµ is

Page 85: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Curry Howard at last

The two faces of the coin:

Internal interpretation: formal vector notation with first-classco-controlExternal interpretation: bidirectional, agnostic, computationalλ-calculus

Example: expression x k

Internal interpretation: co-control point, fill k in the hole ofthe co-continuation H that will substitute xExternal interpretation: fill head x in the hole of continuationK, where K = Θk - an instruction for the construction of aλlet derivation (fill x in k better notation for this reading)

Example: β-rule (λx .t)(u :: k)→ (u(µx .t))k

Internal interpretation: β-rule of a relaxed vector notationExternal interpretation: rule beta of λlet written in thenotation of instructions that λµ is

Page 86: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Curry Howard at last

The two faces of the coin:

Internal interpretation: formal vector notation with first-classco-controlExternal interpretation: bidirectional, agnostic, computationalλ-calculus

Example: expression x k

Internal interpretation: co-control point, fill k in the hole ofthe co-continuation H that will substitute xExternal interpretation: fill head x in the hole of continuationK, where K = Θk - an instruction for the construction of aλlet derivation (fill x in k better notation for this reading)

Example: β-rule (λx .t)(u :: k)→ (u(µx .t))k

Internal interpretation: β-rule of a relaxed vector notation

External interpretation: rule beta of λlet written in thenotation of instructions that λµ is

Page 87: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Curry Howard at last

The two faces of the coin:

Internal interpretation: formal vector notation with first-classco-controlExternal interpretation: bidirectional, agnostic, computationalλ-calculus

Example: expression x k

Internal interpretation: co-control point, fill k in the hole ofthe co-continuation H that will substitute xExternal interpretation: fill head x in the hole of continuationK, where K = Θk - an instruction for the construction of aλlet derivation (fill x in k better notation for this reading)

Example: β-rule (λx .t)(u :: k)→ (u(µx .t))k

Internal interpretation: β-rule of a relaxed vector notationExternal interpretation: rule beta of λlet written in thenotation of instructions that λµ is

Page 88: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 89: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµ

termination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 90: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµ

the latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 91: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 92: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 93: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...

obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 94: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...

and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 95: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 96: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...

one understands why co-control is almost invisible in n.d.

Page 97: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

More Results

Studying forgetful/desugaring maps λlet→ λ one gets

strong normalization of λlet, hence of λµtermination of the let rule, hence of µ rule of λµthe latter gives a focalization result: every t ∈ λµ has a uniqueµ-nf (which is a LJT proof, if t is typable)

Agnosticism theorem

take the s.c. characterization of CBN and CBV...obtain the isomorphic characterization in n.d...and see how CBN and CBV are superimposed in λlet

“Co-control theorem”

given that the let rule is isomorphic to the µ rule...one understands why co-control is almost invisible in n.d.

Page 98: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Duality

Are control and co-control related by classical duality?

Not within classical sequent calculus!

E.g. not in λµµ, because there

variables stand for terms (not co-continuations)µ is an ordinary term substitution former

Yes in a system that unifies λµ and λlet - see the paper

Page 99: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Duality

Are control and co-control related by classical duality?

Not within classical sequent calculus!

E.g. not in λµµ, because there

variables stand for terms (not co-continuations)µ is an ordinary term substitution former

Yes in a system that unifies λµ and λlet - see the paper

Page 100: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Duality

Are control and co-control related by classical duality?

Not within classical sequent calculus!

E.g. not in λµµ, because there

variables stand for terms (not co-continuations)µ is an ordinary term substitution former

Yes in a system that unifies λµ and λlet - see the paper

Page 101: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Duality

Are control and co-control related by classical duality?

Not within classical sequent calculus!

E.g. not in λµµ, because there

variables stand for terms (not co-continuations)µ is an ordinary term substitution former

Yes in a system that unifies λµ and λlet - see the paper

Page 102: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

Duality

Are control and co-control related by classical duality?

Not within classical sequent calculus!

E.g. not in λµµ, because there

variables stand for terms (not co-continuations)µ is an ordinary term substitution former

Yes in a system that unifies λµ and λlet - see the paper

Page 103: Curry-Howard isomorphism for sequent calculus at lastcs.ioc.ee/logic-rakvere/espiritosanto-slides.pdf · Introduction Sequent calculus Natural deduction Results Goal In the same sense

Introduction Sequent calculus Natural deduction Results

Results

THANKS