58
Sequent calculus, proofs and programs The * X calculus : explicit erasure and duplication Explicit vs implicit : * X vs X Strong normalisation Classical computing with explicit structural rules –the * X calculus– Dragiˇ sa ˇ Zuni´ c – together with: Silvia Ghilezan and Pierre Lescanne Mathematical Institute SANU, Belgrade Matematiˇ cki Institut Srpske Akademije Nauka i Umetnosti, Beograd November 19, 2012. Dragiˇ sa ˇ Zuni´ c Classical computing with explicit structural rules 1 / 50

Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Embed Size (px)

Citation preview

Page 1: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Classical computing with explicit structural rules–the ∗X calculus–

Dragisa Zunic– together with: Silvia Ghilezan and Pierre Lescanne

Mathematical Institute SANU, BelgradeMatematicki Institut Srpske Akademije Nauka i Umetnosti, Beograd

November 19, 2012.

Dragisa Zunic Classical computing with explicit structural rules 1 / 50

Page 2: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Outline

1 Sequent calculus, proofs and programs

2 The ∗X calculus : explicit erasure and duplication

3 Explicit vs implicit : ∗X vs X

4 Strong normalisation

Dragisa Zunic Classical computing with explicit structural rules 2 / 50

Page 3: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Implicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

Outline

1 Sequent calculus, proofs and programsImplicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

2 The ∗X calculus : explicit erasure and duplicationLogical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

3 Explicit vs implicit : ∗X vs X

4 Strong normalisation

Dragisa Zunic Classical computing with explicit structural rules 3 / 50

Page 4: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Implicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

The framework

Classical logic

Sequent calculus of G.Gentzen (two important formalisms :sequent calculus and natural deduction calculus)

The Curry-Howard correspondence (the relation between prooftheory and the programming language theory)

The goal is to study classical computation, by assigningcomputational interpretation(s) to classical logic represented in thesequent calculus.

Dragisa Zunic Classical computing with explicit structural rules 4 / 50

Page 5: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Implicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

The Curry-Howard correspondence

Reveals a strong connection between logic and computation

The intuitionistic logic and simply typed λ-calculus

Proofs ⇔ TermsPropositions ⇔ Types

Normalization ⇔ Reduction

Extending the “Curry-Howard paradigm”

Classical logic : T. Griffin (1990)

M. Parigot (1992) : λµ-calculus (natural deduction)H. Herbelin (1995-2005) : λµµ-calculus (sequent calculus)

Dragisa Zunic Classical computing with explicit structural rules 5 / 50

Page 6: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Implicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

Related workThe two predecessors

Classical logic : the X calculusC. Urban (2000)S. Lengrand (2003)S. van Bakel, S.Lengrand, P. Lescanne (2005)

Intuitionistic logic : the λlxr-calculusD. Kesner, S. Lengrand (2005)

X λlxr

∗X

Dragisa Zunic Classical computing with explicit structural rules 6 / 50

Page 7: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Implicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

G3 sequent system for classical logic X -calculus

(axiom)Γ,A ` A,∆

Γ ` A,∆ Γ,B ` ∆(→ left)

Γ,A→ B ` ∆

Γ,A ` B,∆(→ right)

Γ ` A→ B,∆

Γ ` A,∆ Γ,A ` ∆(cut)

Γ ` ∆

Contexts Γ,∆ are sets

Context-sharing style

No structural rules

Dragisa Zunic Classical computing with explicit structural rules 7 / 50

Page 8: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Implicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

G1 sequent system for classical logic ∗X calculus

(axiom)A ` A

Γ ` A,∆ Γ′,B ` ∆′

(→ left)Γ, Γ′,A→ B ` ∆,∆′

Γ,A ` B,∆(→ right)

Γ ` A→ B,∆

Γ ` A,∆ Γ′,A ` ∆′

(cut)Γ, Γ′ ` ∆,∆′

Γ ` ∆(left weakening)

Γ,A ` ∆

Γ ` ∆(right weakening)

Γ ` A,∆

Γ,A,A ` ∆(left contraction)

Γ,A ` ∆

Γ ` A,A,∆(right contraction)

Γ ` A,∆

Dragisa Zunic Classical computing with explicit structural rules 8 / 50

Page 9: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Outline

1 Sequent calculus, proofs and programsImplicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

2 The ∗X calculus : explicit erasure and duplicationLogical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

3 Explicit vs implicit : ∗X vs X

4 Strong normalisation

Dragisa Zunic Classical computing with explicit structural rules 9 / 50

Page 10: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Computational interpretation of classical proofs

Sequent calculus with explicit structural rules(weakening and contraction)

1) Terms in ∗X -calculus are in fact annotations for proofs,2) Computation in ∗X -calculus corresponds to cut-elimination

Weakening as an eraser / Contraction as a duplicator

Dragisa Zunic Classical computing with explicit structural rules 10 / 50

Page 11: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Names

The terms are built from names.

Two categories of names : x , y , z ... in-namesα, β, γ... out-names

Binders wear “hats” : x , y , z ... α, β, γ...

Examples :

〈x .α〉 x 〈x .β〉 β . α [P〉βγ >α

Dragisa Zunic Classical computing with explicit structural rules 11 / 50

Page 12: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Name 6= Variable

In λ-calculus : variables

(λy .xyz)Mβ−→ xMz

An arbitrary term M substitutes the variable y

In ∗X -calculus : names

A name can never be substituted for a termA name can only be renamed

Dragisa Zunic Classical computing with explicit structural rules 12 / 50

Page 13: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

G1 sequent system for classical logic

(axiom)A ` A

Γ ` A,∆ Γ′,B ` ∆′

(→ left)Γ, Γ′,A→ B ` ∆,∆′

Γ,A ` B,∆(→ right)

Γ ` A→ B,∆

Γ ` A,∆ Γ′,A ` ∆′

(cut)Γ, Γ′ ` ∆,∆′

Γ ` ∆(left weakening)

Γ,A ` ∆

Γ ` ∆(right weakening)

Γ ` A,∆

Γ,A,A ` ∆(left contraction)

Γ,A ` ∆

Γ ` A,A,∆(right contraction)

Γ ` A,∆

Dragisa Zunic Classical computing with explicit structural rules 13 / 50

Page 14: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The terms correspond to proofs :

(caps)〈x .α〉 :. x : A ` α : A

P :. Γ ` α : A,∆ Q :. Γ′, x : B ` ∆′

(imp)Pα [y ] xQ :. Γ, Γ′, y : A→ B ` ∆,∆′

P :. Γ, x : A ` α : B,∆(exp)

x P α . β :. Γ ` β : A→ B,∆

P :. Γ ` α : A,∆ Q :. Γ′, x : A ` ∆′

(cut)Pα † xQ :. Γ, Γ′ ` ∆,∆′

P :. Γ ` ∆(left eraser)

x � P :. Γ, x : A ` ∆

P :. Γ ` ∆(right eraser)

P � α :. Γ ` α : A,∆

P :. Γ, y : A, z : A ` ∆(left dupl.)

x< yz〈P] :. Γ, x : A ` ∆

P :. Γ ` β : A, γ : A,∆(right dupl.)

[P〉βγ >α :. Γ ` α : A,∆Dragisa Zunic Classical computing with explicit structural rules 14 / 50

Page 15: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The terms correspond to proofs :

(caps)〈x .α〉 :. x : A ` α : A

P :. Γ ` α : A,∆ Q :. Γ′, x : B ` ∆′

(imp)Pα [y ] xQ :. Γ, Γ′, y : A→ B ` ∆,∆′

P :. Γ, x : A ` α : B,∆(exp)

x P α . β :. Γ ` β : A→ B,∆

P :. Γ ` α : A,∆ Q :. Γ′, x : A ` ∆′

(cut)Pα † xQ :. Γ, Γ′ ` ∆,∆′

P :. Γ ` ∆(left eraser)

x � P :. Γ, x : A ` ∆

P :. Γ ` ∆(right eraser)

P � α :. Γ ` α : A,∆

P :. Γ, y : A, z : A ` ∆(left dupl.)

x< yz〈P] :. Γ, x : A ` ∆

P :. Γ ` β : A, γ : A,∆(right dupl.)

[P〉βγ >α :. Γ ` α : A,∆Dragisa Zunic Classical computing with explicit structural rules 14 / 50

Page 16: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The terms correspond to proofs :

(caps)〈x .α〉 :. x : A ` α : A

P :. Γ ` α : A,∆ Q :. Γ′, x : B ` ∆′

(imp)Pα [y ] xQ :. Γ, Γ′, y : A→ B ` ∆,∆′

P :. Γ, x : A ` α : B,∆(exp)

x P α . β :. Γ ` β : A→ B,∆

P :. Γ ` α : A,∆ Q :. Γ′, x : A ` ∆′

(cut)Pα † xQ :. Γ, Γ′ ` ∆,∆′

P :. Γ ` ∆(left eraser)

x � P :. Γ, x : A ` ∆

P :. Γ ` ∆(right eraser)

P � α :. Γ ` α : A,∆

P :. Γ, y : A, z : A ` ∆(left dupl.)

x< yz〈P] :. Γ, x : A ` ∆

P :. Γ ` β : A, γ : A,∆(right dupl.)

[P〉βγ >α :. Γ ` α : A,∆Dragisa Zunic Classical computing with explicit structural rules 14 / 50

Page 17: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The terms correspond to proofs :

(caps)〈x .α〉 :. x : A ` α : A

P :. Γ ` α : A,∆ Q :. Γ′, x : B ` ∆′

(imp)Pα [y ] xQ :. Γ, Γ′, y : A→ B ` ∆,∆′

P :. Γ, x : A ` α : B,∆(exp)

x P α . β :. Γ ` β : A→ B,∆

P :. Γ ` α : A,∆ Q :. Γ′, x : A ` ∆′

(cut)Pα † xQ :. Γ, Γ′ ` ∆,∆′

P :. Γ ` ∆(left eraser)

x � P :. Γ, x : A ` ∆

P :. Γ ` ∆(right eraser)

P � α :. Γ ` α : A,∆

P :. Γ, y : A, z : A ` ∆(left dupl.)

x< yz〈P] :. Γ, x : A ` ∆

P :. Γ ` β : A, γ : A,∆(right dupl.)

[P〉βγ >α :. Γ ` α : A,∆Dragisa Zunic Classical computing with explicit structural rules 14 / 50

Page 18: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The terms correspond to proofs :

(caps)〈x .α〉 :. x : A ` α : A

P :. Γ ` α : A,∆ Q :. Γ′, x : B ` ∆′

(imp)Pα [y ] xQ :. Γ, Γ′, y : A→ B ` ∆,∆′

P :. Γ, x : A ` α : B,∆(exp)

x P α . β :. Γ ` β : A→ B,∆

P :. Γ ` α : A,∆ Q :. Γ′, x : A ` ∆′

(cut)Pα † xQ :. Γ, Γ′ ` ∆,∆′

P :. Γ ` ∆(left eraser)

x � P :. Γ, x : A ` ∆

P :. Γ ` ∆(right eraser)

P � α :. Γ ` α : A,∆

P :. Γ, y : A, z : A ` ∆(left dupl.)

x< yz〈P] :. Γ, x : A ` ∆

P :. Γ ` β : A, γ : A,∆(right dupl.)

[P〉βγ >α :. Γ ` α : A,∆Dragisa Zunic Classical computing with explicit structural rules 14 / 50

Page 19: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusThe syntax

P, Q ::= 〈x .α〉 capsule

| x P β . α exporter

| Pα [y ] xQ importer

| Pα † xQ cut

| x � P left-eraser

| P � α right-eraser

| x<yz〈P] left-duplicator

| [P〉βγ >α right-duplicator

Dragisa Zunic Classical computing with explicit structural rules 15 / 50

Page 20: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Linearity

In ∗X -calculus only linear terms are considered :

� every free name occurs only once� every binder does bind an occurrence of a free name

(and therefore only one)

Examples of non-linear terms :

x 〈y .β〉 β . α and 〈x .α〉 � α

Every non-linear term has a linear representation :

x (x�〈y .β〉) β . α and [〈x .α1〉 � α2〉α1α2>α

Dragisa Zunic Classical computing with explicit structural rules 16 / 50

Page 21: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Linearity

In ∗X -calculus only linear terms are considered :

� every free name occurs only once� every binder does bind an occurrence of a free name

(and therefore only one)

Examples of non-linear terms :

x 〈y .β〉 β . α and 〈x .α〉 � α

Every non-linear term has a linear representation :

x (x�〈y .β〉) β . α and [〈x .α1〉 � α2〉α1α2>α

Dragisa Zunic Classical computing with explicit structural rules 16 / 50

Page 22: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Linearity

In ∗X -calculus only linear terms are considered :

� every free name occurs only once� every binder does bind an occurrence of a free name

(and therefore only one)

Examples of non-linear terms :

x 〈y .β〉 β . α and 〈x .α〉 � α

Every non-linear term has a linear representation :

x (x�〈y .β〉) β . α and [〈x .α1〉 � α2〉α1α2>α

Dragisa Zunic Classical computing with explicit structural rules 16 / 50

Page 23: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Linearity

In ∗X -calculus only linear terms are considered :

� every free name occurs only once� every binder does bind an occurrence of a free name

(and therefore only one)

Examples of non-linear terms :

x 〈y .β〉 β . α and 〈x .α〉 � α

Every non-linear term has a linear representation :

x (x�〈y .β〉) β . α and [〈x .α1〉 � α2〉α1α2>α

Dragisa Zunic Classical computing with explicit structural rules 16 / 50

Page 24: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Linearity

In ∗X -calculus only linear terms are considered :

� every free name occurs only once� every binder does bind an occurrence of a free name

(and therefore only one)

Examples of non-linear terms :

x 〈y .β〉 β . α and 〈x .α〉 � α

Every non-linear term has a linear representation :

x (x�〈y .β〉) β . α and [〈x .α1〉 � α2〉α1α2>α

Dragisa Zunic Classical computing with explicit structural rules 16 / 50

Page 25: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusGrouping the rules :

Logical rules (L-principal names involved)

Structural rules (S-principal names involved)

(Activation rules)

(Deactivation rules)

Propagation rules

Dragisa Zunic Classical computing with explicit structural rules 17 / 50

Page 26: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusThe syntax

P, Q ::= 〈x .α〉 capsule

| x P β . α exporter

| Pα [y ] xQ importer

| Pα † xQ cut

| x � P left-eraser

| P � α right-eraser

| x<yz〈P] left-duplicator

| [P〉βγ >α right-duplicator

The notion of principal name of a term.1 L-principal name2 S–principal name

Dragisa Zunic Classical computing with explicit structural rules 18 / 50

Page 27: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusThe syntax

P, Q ::= 〈x .α〉 capsule

| x P β . α exporter

| Pα [y ] xQ importer

| Pα † xQ cut

| x � P left-eraser

| P � α right-eraser

| x<yz〈P] left-duplicator

| [P〉βγ >α right-duplicator

The notion of principal name of a term.1 L–principal name2 S-principal name

Dragisa Zunic Classical computing with explicit structural rules 19 / 50

Page 28: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

∗X : logical rules

Renaming and inserting

Renaming :

(ren-L) : 〈y .α〉α † xQ → Q{y/x}

(ren-R) : Pα † x〈x .β〉 → P{β/α}

Diagrammatically :

(ren-L) :y

Qy α x Q

(ren-R) : Pxα β

Dragisa Zunic Classical computing with explicit structural rules 20 / 50

Page 29: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

∗X : logical rules

Inserting (ei-insert) :

(y P β . α)α † x(Qγ [x ] zR) → either

{(Qγ † yP)β † zR

Qγ † y(Pβ † zR)

Diagrammatically :

z

IQ R

γ

Ry β

PQ γ z

y

E

α x

βP

Notice : logical rules define reducing when a cut bindsL-principal names

Dragisa Zunic Classical computing with explicit structural rules 21 / 50

Page 30: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

∗X : structural rules

Left erasure :

( † -eras) : (P � α)α † xQ → IQ � P �OQ ,

where IQ = I (Q) \x , OQ = O(Q)

Diagrammatically :

IQ

O} Q

IQ{

P{O} Q

P x Qα

Dragisa Zunic Classical computing with explicit structural rules 22 / 50

Page 31: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

∗X : structural rules

Left duplication ( † -dupl) :

([P〉α1

α2>α)α † xQ → IQ<

IQ1

IQ2

⟨(Pα1

† x1Q1)α2† x2Q2

⟩ OQ1

OQ2

>OQ ,

Diagrammatically :

P

IQ{

O} QQα x

β

γ

PQ

1

Q2

IQ{

O} Q

β

γ x

x

Dragisa Zunic Classical computing with explicit structural rules 23 / 50

Page 32: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Symmetry...The † -erasure

Q

QPα

O

I

I

O

P

P

P

P

{ }

}

{ x

An illustration of the symmetry...

Dragisa Zunic Classical computing with explicit structural rules 24 / 50

Page 33: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Symmetry...The † -duplication

PI {

OP}

P Qα

y

z

x

PI {

OP}

QP

P1

2

α

α

y

z

An illustration of the symmetry...

Dragisa Zunic Classical computing with explicit structural rules 25 / 50

Page 34: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Duplication, informally

Classical Logic Intuitionistic Logic

Component duplicated, interface preserved.

Similarly for erasure

Dragisa Zunic Classical computing with explicit structural rules 26 / 50

Page 35: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

∗X : propagation rules (left subgroup)

(exp † − prop) : (x P γ . α)β † yR → x (Pβ † yR) γ . α

(imp † − prop1) : (Pα [x] zQ)β † yR → (Pβ † yR)α [x] zQ, β ∈ O(P)

(imp † − prop2) : (Pα [x] zQ)β † yR → Pα [x] z(Qβ † yR), β ∈ O(Q)

(cut(c)† − prop) : (Pα † x〈x.β〉)β † yR → Pα † yR

(cut † − prop1) : (Pα † xQ)β † yR → (Pβ † yR)α † xQ, β ∈ O(P), Q 6= 〈x.β〉

(cut † − prop2) : (Pα † xQ)β † yR → Pα † x(Qβ † yR), β ∈ O(Q), Q 6= 〈x.β〉

(L–eras † − prop) : (x � M)β † yR → x � (Mβ † yR)

(R–eras † − prop) : (M � α)β † yR → (Mβ † yR)� α, α 6= β

(L–dupl † − prop) : (x< x1x2〈M])β † yR → x< x1

x2〈Mβ † yR]

(R–dupl † − prop) : ([M〉α1α2>α)β † yR → [Mβ † yR〉α1

α2>α, α 6= β

Propagation rules do not have a diagrammatic representation

Dragisa Zunic Classical computing with explicit structural rules 27 / 50

Page 36: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusPropagation rules

^α x^ Qα

Dragisa Zunic Classical computing with explicit structural rules 28 / 50

Page 37: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusPropagation rules

^α x^ Qα

Dragisa Zunic Classical computing with explicit structural rules 29 / 50

Page 38: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusPropagation rules

^α x^ Qα

Dragisa Zunic Classical computing with explicit structural rules 30 / 50

Page 39: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusPropagation rules

^α x^ Qα

Dragisa Zunic Classical computing with explicit structural rules 31 / 50

Page 40: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusPropagation rules

^α x^ Qα

Dragisa Zunic Classical computing with explicit structural rules 32 / 50

Page 41: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The ∗X calculusPropagation rules

^α x^ Qα

We may think of α † xQ as an explicit substitution

Dragisa Zunic Classical computing with explicit structural rules 33 / 50

Page 42: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

∗X : the basic properties

1 Linearity preservation

If P is linear and P → Q then Q is linear

2 Free names (“interface”) preservation

If P → Q then N(P) = N(Q)

3 Type preservation – computation ——–can be (has to be) seen asproof-transformation

If P :. Γ ` ∆ and P → P ′, then P ′ :. Γ ` ∆

4 Strong normalisation (termination of reduction)

Dragisa Zunic Classical computing with explicit structural rules 34 / 50

Page 43: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

Peirce’s law in ∗X(capsule)

〈x.α1〉 :. x : A ` α1 : A

(R − eraser)

〈x.α1〉 � β :. x : A ` α1 : A, β : B

(exporter)

x (〈x.α1〉 � β) β . γ :. ` α1 : A, γ : A→ B

(capsule)

〈y.α2〉 :. y : A ` α2 : A

(importer)

(x (〈x.α1〉 � β) β . γ) γ [z] y 〈y.α2〉 :. z : (A→ B)→ A ` α1 : A, α2 : A

(R − duplicator)

[(x (〈x.α1〉 � β) β . γ) γ [z] y 〈y.α2〉〉α1α2>α :. z : (A→ B)→ A ` α : A

(exporter)

z ([(x (〈x.α1〉 � β) β . γ) γ [z] y 〈y.α2〉〉α1α2>α) α . δ :. ` δ : ((A→ B)→ A)→ A

(axiom)

A ` A

(R − weakening)

A ` A, B

(→ R)

` A, A→ B

(axiom)

A ` A

(→ L)

(A→ B)→ A ` A, A

(R − contraction)

(A→ B)→ A ` A

(→ R)

` ((A→ B)→ A)→ A

Dragisa Zunic Classical computing with explicit structural rules 35 / 50

Page 44: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

*X :(axiom)

A ` A

(R − weakening)

A ` A, B

(→ R)

` A, A→ B

(axiom)

A ` A

(→ L)

(A→ B)→ A ` A, A

(R − contraction)

(A→ B)→ A ` A

(→ R)

` ((A→ B)→ A)→ A

X :

(axiom)

A ` A, B

(→ R)

` A, A→ B

(axiom)

A ` A

(→ L)

(A→ B)→ A ` A

(→ R)

` ((A→ B)→ A)→ A

Dragisa Zunic Classical computing with explicit structural rules 36 / 50

Page 45: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The terms of ∗X are convenient for two-dimensional representation,due to

the presence of erasers and duplicators

but also the linearity constraints

Dragisa Zunic Classical computing with explicit structural rules 37 / 50

Page 46: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The diagrammatic calculusThe syntax

P Q αx

P

E

x β

α

PI

Qα y

x

α

β

γP

z

x

y P

P Qα x

αP x

P

::=,

Dragisa Zunic Classical computing with explicit structural rules 38 / 50

Page 47: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

The main source of non-confluence

P QI O

P

Q Q

and

P Q QI O

P P

non-confluence is a feature of sequent calculus

an intrinsic property of classical computation

the “choice” represented by activation rules

in literature this is known as “Lafont’s example”

Dragisa Zunic Classical computing with explicit structural rules 39 / 50

Page 48: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

An exampleThe Peirce’s law

E

E

I

Dragisa Zunic Classical computing with explicit structural rules 40 / 50

Page 49: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Logical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

An exampleThe Peirce’s law - with types assigned

E

E

((A B) A)

(A

Aα1 :

I

B) A

Aδ:

z:

α: A

γ: A B

y: A

Ax:

Bβ: Aα :2

Dragisa Zunic Classical computing with explicit structural rules 41 / 50

Page 50: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Outline

1 Sequent calculus, proofs and programsImplicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

2 The ∗X calculus : explicit erasure and duplicationLogical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

3 Explicit vs implicit : ∗X vs X

4 Strong normalisation

Dragisa Zunic Classical computing with explicit structural rules 42 / 50

Page 51: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Encoding ∗X in X calculus

Definition (Encoding)

Dragisa Zunic Classical computing with explicit structural rules 43 / 50

Page 52: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Encoding preserves types

Lemma (Type preservation)

For an arbitrary ∗X -term

Dragisa Zunic Classical computing with explicit structural rules 44 / 50

Page 53: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Simulating ∗X reduction

Theorem (Reduction simulation)

Dragisa Zunic Classical computing with explicit structural rules 45 / 50

Page 54: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Outline

1 Sequent calculus, proofs and programsImplicit structural rules – the X calculusExplicit structural rules – the ∗X calculus

2 The ∗X calculus : explicit erasure and duplicationLogical settingFrom sequent proofs to termsThe syntax and reduction rulesDiagrammatic view

3 Explicit vs implicit : ∗X vs X

4 Strong normalisation

Dragisa Zunic Classical computing with explicit structural rules 46 / 50

Page 55: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Strong normalisation of ∗X -calculus

Theorem (SN)

Dragisa Zunic Classical computing with explicit structural rules 47 / 50

Page 56: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Future work

define equivalent terms, the c©X calculus

formalize the diagrammatic calculus (capturing the essence ofcomputation)

a 3d computational model ?

possible applications of non-confluent systems ?

Dragisa Zunic Classical computing with explicit structural rules 48 / 50

Page 57: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Some references

� S. Ghilezan, P. Lescanne, D. Zunic

Comp. interpretation of classical logic with expl. struct. rules, 2012.

� S. Ghilezan, J. Ivetic, P. Lescanne, D. Zunic

Intuitionistic sequent-style calculus with explicit struct. rules, 2010.

� D. Kesner and S. Lengrand

Explicit operators for λ-calculus, 2006.

� C. Urban and G. M. Bierman

Strong normalisation of cut-elimination in classical logic, 1999.

� S. van Bakel, S. Lengrand, P. Lescanne

The language X . Circuits, computations and classical logic, 2005.

� E. Robinson

Proof nets for classical logic, 2005.

Dragisa Zunic Classical computing with explicit structural rules 49 / 50

Page 58: Dragisa Zunic - Classical computing with explicit structural rules - the *X calculus

Sequent calculus, proofs and programsThe ∗X calculus : explicit erasure and duplication

Explicit vs implicit : ∗X vs XStrong normalisation

Thank you. Hvala na paznji !

Dragisa Zunic Classical computing with explicit structural rules 50 / 50