# Multi-focusing on extensional rewriting with sums ......

date post

20-Mar-2018Category

## Documents

view

213download

0

Embed Size (px)

### Transcript of Multi-focusing on extensional rewriting with sums ......

Multi-focusing on extensional rewriting with sums(introduction)

Gabriel Scherer

Gallium INRIA

March 11, 2014

1

... but why?Current research topic: does a given type have a unique inhabitant(modulo program equivalence)?

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(t : A + B) = (t, x1.1 x1, x2.2 x2)

(t, u)?= (t, x1.(1 x1, u), x2.(2 x2, u)) K = (, u)

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

... but why?Current research topic: does a given type have a unique inhabitant(modulo program equivalence)?

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(t : A + B) = (t, x1.1 x1, x2.2 x2)

(t, u)?= (t, x1.(1 x1, u), x2.(2 x2, u)) K = (, u)

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

... but why?Current research topic: does a given type have a unique inhabitant(modulo program equivalence)?

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(t : A + B) = (t, x1.1 x1, x2.2 x2)

(t, u)?= (t, x1.(1 x1, u), x2.(2 x2, u)) K = (, u)

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(t : A + B) = (t, x1.1 x1, x2.2 x2)

(t, u)?= (t, x1.(1 x1, u), x2.(2 x2, u))

K = (, u)

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(t : A + B) = (t, x1.1 x1, x2.2 x2)

(t, u)?= (t, x1.(1 x1, u), x2.(2 x2, u)) K = (, u)

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(K [A1 + A2] : B), K [t] = (t, x1.K [1 x1], x2.K [2 x2])

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

((x) t) u t[u/x ] (t : A B) = (x) t x

i (t1, t2) ti (t : A B) = (1 t, 2 t)

(i t, x1.u1, x2.u2) ui [t/xi ]

(K [A1 + A2] : B), K [t] = (t, x1.K [1 x1], x2.K [2 x2])

Sum equivalence looks hard. Can we implement it?

Are there representations of programs (proofs) that quotient overthose equivalences?

2

My paper in one slide

The equivalence algorithm of

Sam Lindley.Extensional rewriting with sums.In TLCA, pages 255271, 2007.

and the normalization of proof representations in

Kaustuv Chaudhuri, Dale Miller, and Alexis Saurin.Canonical sequent proofs via multi-focusing.In IFIP TCS , pages 383396, 2008.

are doing (almost) the same thing and we had not noticed.

3

In this talk

Sam Lindleys rewriting-based algorithm is the first simple solution (firstsolution: Neil Ghani, 1995) to deciding sum equivalences.

Its easy to understand and follow. But to me it felt a bit arbitrary.

On the other hand, (multi-)focusing is beautiful, but requires somebackground knowledge.

Providing it is the purpose of this talk.

4

Sequent calculus(Can be done in natural deduction, but less regular)

` A ,B ` C,A B ` C

,A ` B

` A B

,Ai ` C,A1 A2 ` C

` A1 ` A2

` A1 A2

,A1 ` C ,A2 ` C,A1 + A2 ` C

` Ai ` A1 + A2

+

Inversible vs. non-inversible rules.Negatives (interesting on the left): products, arrow, atoms.Positives (interesting on the right): sum, atoms.

5

Inversible phase

?

X + Y ` XX + Y ` X + Y

If applied too early, non-inversible rules can ruin your proof.

Focusing restriction 1: inversible phases

Inversible rules must be applied as soon and as long as possible and their order does not matter.

Imposing this restriction gives a single proof of (X Y ) (X Y )instead of two ((f ) f and (f )(x) f x).

6

Inversible phase

?

X + Y ` XX + Y ` X + Y

If applied too early, non-inversible rules can ruin your proof.

Focusing restriction 1: inversible phases

Inversible rules must be applied as soon and as long as possible and their order does not matter.

Imposing this restriction gives a single proof of (X Y ) (X Y )instead of two ((f ) f and (f )(x) f x).

6

Inversible phase

?

X + Y ` XX + Y ` X + Y

If applied too early, non-inversible rules can ruin your proof.

Focusing restriction 1: inversible phases

Inversible rules must be applied as soon and as long as possible and their order does not matter.

Imposing this restriction gives a single proof of (X Y ) (X Y )instead of two ((f ) f and (f )(x) f x).

6

Non-inversible phases

After all inversible rules, n ` ApOnly step forward: select a formula, apply some non-inversible rules on it.

Focusing restriction 2: non-inversible phase

When a principal formula is selected for non-inversible rule, they should beapplied as long as possible until its polarity changes.

Completeness: this restriction preserves provability. Non-trivial !Example of removed redundancy:

X2, Y1 ` AX2 X3, Y1 ` A

X2 X3, Y1 Y2 ` AX1 X2 X3,Y1 Y2 ` A

7

Non-inversible phases

After all inversible rules, n ` ApOnly step forward: select a formula, apply some non-inversible rules on it.

Focusing restriction 2: non-inversible phase

When a principal formula is selected for non-inversible rule, they should beapplied as long as possible until its polarity changes.

Completeness: this restriction preserves provability. Non-trivial !Example of removed redundancy:

X2, Y1 ` AX2 X3, Y1 ` A

X2 X3, Y1 Y2 ` AX1 X2 X3,Y1 Y2 ` A

7

Non-inversible phases

After all inversible rules, n ` ApOnly step forward: select a formula, apply some non-inversible rules on it.

Focusing restriction 2: non-inversible phase

When a principal formula is selected for non-inversible rule, they should beapplied as long as possible until its polarity changes.

Completeness: this restriction preserves provability. Non-trivial !Example of removed redundancy:

X2, Y1 ` AX2 X3, Y1 ` A

X2 X3, Y1 Y2 ` AX1 X2 X3,Y1 Y2 ` A

7

This was focusing

Focused proofs are structured in alternating phases,inversible (boring) and non-inversible (focus).

Phases are forced to be as long as possible to eliminate duplicate proofs.

The idea is independent from the proof system.Applies to sequent calculus or natural deduction;intuitionistic, classical, linear, you-name-it logic.

On proof terms, these restrictions correspond to -normal forms (at leastfor products and arrows). But the fun is in the search.

8

Demo Time

(1 X (Y + Z )) X (Y W ) (Z + W )

9

Restrictive syntaxSo far weve defined focused proofs as a subset of proofs in our system.Some people prefer to give them a syntax that enforces their structure.

; ,A ` B; ` A B

; ` A ; ` B; ` A B

;A, ` C ;B, ` C;A + B, ` C

,An; ` C;An, ` C

n,Bn| Bn ` Cpn,Bn; ` Cp

n ` Cpn; ` Cp

| Ai ` C

| A1 A2 ` C ` A | B ` C

| A B ` C

` Ai ` A1 + A2

;B ` C| Bp ` C

; ` C ` Cn

10

Restrictive syntaxSo far weve defined focused proofs as a subset of proofs in our system.Some people prefer to give them a syntax that enforces their structure.

; ,A ` B; ` A B

; ` A ; ` B; ` A B

;A, ` C ;B, ` C;A + B, ` C

,An; ` C;An, ` C

n,Bn| Bn ` Cpn,Bn; ` Cp

n ` Cpn; ` Cp

| Ai ` C

| A1 A2 ` C ` A | B ` C

| A B ` C

` Ai ` A1 + A2

;B ` C| Bp ` C

; ` C ` Cn

10

Restrictive syntaxSo far weve defined focused proofs as a subset of proofs in our system.Some people prefer to give them a syntax that enforces their structure.

; ,A ` B; ` A B

; ` A ; ` B; ` A B

;A, ` C ;B, ` C;A + B, ` C

,An; ` C;An, ` C

n,Bn| Bn ` Cpn,Bn; ` Cp

n ` Cpn; ` Cp

| Ai ` C

| A1 A2 ` C ` A | B ` C

| A B ` C

` Ai ` A1 + A2

;B ` C| Bp ` C

; ` C ` Cn

10

; ,A ` B; ` A B

; ` A ; ` B; ` A B

;A, ` C ;B, ` C;A + B, ` C

,An; ` C;An, ` C

n,Bn| Bn ` Cpn,Bn; ` Cp

n ` Cpn; ` Cp

| Ai ` C

*View more*