Five Basic Concepts of Axiomatic Rewriting Theory Paul-Andr Mellis - - PowerPoint PPT Presentation

five basic concepts of axiomatic rewriting theory
SMART_READER_LITE
LIVE PREVIEW

Five Basic Concepts of Axiomatic Rewriting Theory Paul-Andr Mellis - - PowerPoint PPT Presentation

Five Basic Concepts of Axiomatic Rewriting Theory Paul-Andr Mellis Institut de Recherche en Informatique Fondamentale (IRIF) CNRS & Universit Paris Denis Diderot 5th International Workshop on Confluence Obergurgl September


slide-1
SLIDE 1

Five Basic Concepts of Axiomatic Rewriting Theory

Paul-André Melliès

Institut de Recherche en Informatique Fondamentale (IRIF) CNRS & Université Paris Denis Diderot

5th International Workshop on Confluence Obergurgl – September 2016

slide-2
SLIDE 2

Rewriting paths modulo homotopy

An algebraic and topological notion of confluence

2

slide-3
SLIDE 3

The λ-calculus with explicit substitutions

Terms M ::= 1 | MN | λM | M[s] Substitutions s ::= id |

| M · s | s ◦ t Key idea: replace the β-rule of the λ-calculus (λx.M) N −→ M [x := N] by the Beta-rule of the λσ-calculus (λ M) N −→ M [N · id] where the substitution is explicit – and thus similar to a closure.

3

slide-4
SLIDE 4

The eleven rewriting rules of the λσ-calculus

Beta (λM)N → M[N · id] App (MN)[s] → M[s]N[s] Abs (λM)[s] → λ(M[1 · (s ◦ ↑)]) Clos M[s][t] → M[s ◦ t] VarCons 1[M · s] → M VarId 1[id] → 1 Map (M · s) ◦ t → M[t] · (s ◦ t) IdL id ◦ s → s Ass (s1 ◦ s2) ◦ s3 → s1 ◦ (s2 ◦ s3) Shi ftCons

↑ ◦ (M · s)

→ s Shi ftId

↑ ◦ id

4

slide-5
SLIDE 5

The eleven critical pairs of the λσ-calculus

App + Beta (λM)[s](N[s])

App

← ((λM)N)[s]

Beta

→ M[N · id][s] Clos + App (MN)[s ◦ t]

Clos

← (MN)[s][t]

App

→ (M[s](N[s]))[t] Clos + Abs (λM)[s ◦ t]

Clos

← (λM)[s][t]

Abs

→ (λ(M[1 · s ◦ ↑]))[t] Clos + VarId 1[id ◦ s]

Clos

← 1[id][s]

VarId

→ 1[s] Clos + VarCons 1[(M · s) ◦ t]

Clos

← 1[M · s][t]

VarCons

→ M[t] Clos + Clos M[s][t ◦ t′]

Clos

← M[s][t][t′]

Clos

→ M[s ◦ t][t′] Ass + Map (M · s) ◦ (t ◦ t′)

Ass

← ((M · s) ◦ t) ◦ t′

Map

→ (M[t] · s ◦ t) ◦ t′ Ass + IdL id ◦ (s ◦ t)

Ass

← (id ◦ s) ◦ t

IdL

→ s ◦ t Ass + Shi ftId ↑ ◦ (id ◦ s)

Ass

← (↑ ◦ id) ◦ s

ShiftId

→ ↑ ◦ s Ass + Shi ftCons ↑ ◦ ((M · s) ◦ t)

Ass

← (↑ ◦ (M · s)) ◦ t

ShiftCons

→ s ◦ t Ass + Ass (s ◦ s′) ◦ (t ◦ t′)

Ass

← ((s ◦ s′) ◦ t) ◦ t′

Ass

→ (s ◦ (s′ ◦ t)) ◦ t′

5

slide-6
SLIDE 6

A very dangerous critical pair

((λP)Q)[s]

Beta

  • App

(λP)[s]Q[s]

Lam

(λ(P[1 · s ◦ ↑]))Q[s]

Beta

  • P[Q · id][s]

Clos+Map

  • P[1 · s ◦ ↑][Q[s] · id]

Clos+Map

  • P[Q[s] · id ◦ s]

IdL

  • P[Q[s] · (s ◦ ↑) ◦ (Q[s] · id)]

Ass+Shift

  • P[Q[s] · s]

P[Q[s] · (s ◦ id)]

when s=M1·M2·····Mn·id and the M′

is are in σ−normal form

  • This critical pair leads to a counter-example to strong normalization

in the simply-typed λσ-calculus (TLCA 1995).

6

slide-7
SLIDE 7

A fundamental problem

Hence, one main challenge of Rewriting Theory: Classify the rewriting paths from a term P to its normal form Q P Q

f g

Very complicated in the case of the λσ-calculus...

7

slide-8
SLIDE 8
  • I. Permutation tiles

A geometric account of redex permutations

8

slide-9
SLIDE 9

A key observation

Theorem [Lévy 1978] In the λ-calculus, every two paths to the normal form P Q

f g

are equal modulo a series of β-redex permutations: P ∼ Q

f g

9

slide-10
SLIDE 10

A geometric intuition

It is nice and clarifying to think of the redex permutation equivalence between f and g in a geometric way as a homotopy relation between rewriting paths This intuition can be made rigorous mathematically using Albert Burroni’s notion of polygraph.

10

slide-11
SLIDE 11

Permutation tiles [1]

MQ PQ PN MN u′ u v′ v the redex u : M → P and the redex v : N → Q are independent

11

slide-12
SLIDE 12

Permutation tiles [2] y (λx.y)P (λx.y)M u′ v u

the outer redex u : (λx.y) M → y erases the inner redex v : M → P

12

slide-13
SLIDE 13

Permutation tiles [3]

MP (λx.xx)P PP MM (λx.xx)M u′ v2 v1 u v

the outer redex u : (λx.xx) M → MM duplicates the inner redex v : M → P

13

slide-14
SLIDE 14

Illustration of the theorem

There is a 2-dimensional hole in the λ-calculus

(λy.y)z (λx.x)z (λx.x)(λy.y)z v u

because the outer redex u : (λx.x) (λy.y) z −→ (λy.y) z is not equivalent modulo homotopy to the inner redex v : (λx.x) (λy.y) z −→ (λx.x) z

14

slide-15
SLIDE 15

Illustration of the theorem

When one extends the two redexes u and v with w

z (λx.x)z (λx.x)(λy.y)z v w u

the resulting rewriting paths u · w and v · w are normalizing and thus equivalent modulo homotopy!

15

slide-16
SLIDE 16

In the λσ-calculus...

Critical pairs like

((λP)Q)[s]

Beta

  • App

(λP)[s]Q[s]

Lam

(λ(P[1 · s ◦ ↑]))Q[s]

Beta

  • P[Q · id][s]

Clos+Map

  • P[1 · s ◦ ↑][Q[s] · id]

Clos+Map

  • P[Q[s] · id ◦ s]

IdL

  • P[Q[s] · (s ◦ ↑) ◦ (Q[s] · id)]

Ass+Shift

  • P[Q[s] · s]

P[Q[s] · (s ◦ id)]

when s=M1·M2·····Mn·id and the M′

is are in σ−normal form

  • generate 2-dimensional holes in the rewriting geometry

and thus obstructions to homotopy equivalence...

16

slide-17
SLIDE 17

A bridge between λσ and λ

Key theorem [Abadi-Cardelli-Curien-Lévy 1990] Every rewriting path between λσ-terms f : P Q induces a rewriting path (modulo homotopy) σ(f) : σ(P) σ(Q) between the underlying λ-terms. Moreover, the translation preserves homotopy equivalence: f ∼λσ g ⇒ σ(f) ∼λ σ(g)

17

slide-18
SLIDE 18

A remarkable consequence

Fact. Two rewriting paths in the λσ-calculus P Q

f g

are transported to the same homotopy class of rewriting paths σ(P) ∼λ σ(Q)

σ( f) σ(g)

when the λσ-term Q is in normal form.

18

slide-19
SLIDE 19

What about head-normal forms?

Can we classify the head-rewriting paths of the λσ-calculus? This requires to resolve two very serious difficulties: ⊲ define a general notion of head-rewriting path ⊲ for a term rewriting system admitting critical pairs ⊲ establish that every head-rewriting path in the λσ-calculus f : P V ⊲ is transported to a head-rewriting path σ(f) : σ(P) σ(V) ⊲

  • f the λ-calculus.

19

slide-20
SLIDE 20

Axiomatic Rewriting Theory

Main claim. This problem is arguably too difficult to resolve by working directly on the syntax of the λσ-calculus. One should move to a purely diagrammatic approach based on the 2-dimensional notion of permutation tile. The purpose of Axiomatic Rewriting Theory is to establish a number of important structural properties: ⊲ ⊲ standardisation theorem ⊲ ⊲ factorisation theorem ⊲ ⊲ stability theorem from the generic properties of permutation tiles in rewriting.

20

slide-21
SLIDE 21

Axiomatic rewriting system

  • Definition. A graph

G = (V, E, ∂0, ∂1) defined by its source and target functions ∂0 , ∂1 : E −→ V together with a set of 2-dimensional tiles of the form

Q N P M u′ f u v

where the rewriting path f is of arbitrary length.

21

slide-22
SLIDE 22

Reversible permutations

Definition: a permutation tile

Q N P M u′ f u v

is called reversible when it has an inverse. Note that f is of length 1 in that specific case.

22

slide-23
SLIDE 23

Reversible permutation tiles

MQ PQ PN MN u′ u v′ v

23

slide-24
SLIDE 24

Irreversible permutation tiles

y (λx.y)P (λx.y)M u′ v u

24

slide-25
SLIDE 25

Irreversible permutation tiles

MP (λx.xx)P PP MM (λx.xx)M u′ v2 v1 u v

25

slide-26
SLIDE 26
  • II. Standardisation cells

Rewriting surfaces between rewriting paths

26

slide-27
SLIDE 27

Key idea: let us track ancestors!

MN PQ PN MQ

v u

´

u v

´

27

slide-28
SLIDE 28

Key idea: let us track ancestors!

y

u v

P λy.x ⌣ ⌣ M λy.x ⌣ ⌣

u

´

28

slide-29
SLIDE 29

Key idea: let us track ancestors! u v

M λx.x ⌣ ⌣ x P λx.x ⌣ ⌣ x

u

´

MM MP P P

v

1 2

v

29

slide-30
SLIDE 30

Standardisation cells

M (λy.M)N (λy.M)Q (λx.(λy.x))MQ (λx.(λy.x))MN c b v u a

30

slide-31
SLIDE 31

Illustration

u v a c λx. x ⌣ λy. ⌣ ⌣ ⌣ MN ⌣ λy. ⌣ M N M ⌣ λy. ⌣ M Q b λx. x ⌣ λy. ⌣ ⌣ ⌣ MQ

31

slide-32
SLIDE 32

Standardisation cells

Definition. A standardisation cell θ : f g : M N is a triple ( f, g, ϕ) consisting of two coinitial and cofinal paths f = M · · · N

u1 u2 up

g = M · · · N

v1 v2 vq

and of a function ϕ : {1, . . . , q} {1, . . . , p} called the ancestor function of the standardisation cell.

32

slide-33
SLIDE 33

A 2-category of rewriting and standardisation

Theorem. Every axiomatic rewriting system G induces a 2-category ⊲ its objects are the terms, ⊲ its morphisms are the rewriting paths, ⊲ its cells are the standardisation cells.

33

slide-34
SLIDE 34
  • III. Standard rewriting paths

The normal forms of the 2-dimensional rewriting

34

slide-35
SLIDE 35

Standard rewriting paths

Definition. A rewriting path f : M N is called standard when every standardisation cell f ⇒ g is reversible.

35

slide-36
SLIDE 36

A diagrammatic standardisation theorem

Theorem. For every rewriting path f, there exists a 2-dimensional cell f ⇒ g transforming f into a standard path g. Moreover, the standard path g associated to the path f is unique, modulo reversible permutations. The 2-dimensional cell f ⇒ g itself is unique, up to canonical 3-dimensional deformations.

36

slide-37
SLIDE 37

Standardisation

M (λy.M)N (λy.M)Q (λx.(λy.x))MQ (λx.(λy.x))MN c b v u a A two-dimensional process revealing the causal dependencies

37

slide-38
SLIDE 38
  • IV. External rewriting paths

The external-internal factorisation theorem

38

slide-39
SLIDE 39

External rewriting paths

Definition. A rewriting path M P

e

is called external when it satisfies the following property: P Q

f

standard =⇒ M P Q

e f

standard.

39

slide-40
SLIDE 40

External rewriting paths

The β-redex (λx.(λy.x))MN (λx.(λy.x))MP

a

is standard but not external in the diagram below:

M (λy.M)N (λy.M)Q (λx.(λy.x))MQ (λx.(λy.x))MN c b v u a

40

slide-41
SLIDE 41

Internal rewriting paths

Definition. A rewriting path M N

m

is called internal when every factorization up to homotopy M N ∼ P

e m f

satisfies the following property: e is external =⇒ e is equal to the identity.

41

slide-42
SLIDE 42

Factorization theorem [Existence]

Suppose given an axiomatic rewriting system. Theorem. Every rewriting path M N

f

factors as M P N

e m

where ⊲ the rewriting path e is external ⊲ the rewriting path m is internal

42

slide-43
SLIDE 43

Factorization theorem [uniqueness]

For every commutative diagram M1 P1 N1 ∼ M2 P2 N2

u e1 m1 v e2 m2

e1 and e2 external m1 and m2 internal there exists a unique path h : P1 ։ P2 such that M1 P1 N1 ∼ ∼ M2 P2 N2

u e1 m1 h v e2 m2

commutes.

43

slide-44
SLIDE 44

Factorization theorem [uniqueness]

For every commutative diagram (up to homotopy) M1 P1 N1 ∼ M2 P2 N2

u e1 m1 v e2 m2

e1 and e2 external m1 and m2 internal there exists a unique path h : P1 ։ P2 (up to homotopy) such that M1 P1 N1 ∼ ∼ M2 P2 N2

u e1 m1 h v e2 m2

commutes (up to homotopy.)

44

slide-45
SLIDE 45
  • V. Head rewriting paths

A universal cone of head-rewriting paths

45

slide-46
SLIDE 46

Axiomatic set of values

Definition. An axiomatic set H of values is a set of terms satisfying three properties: [1] the set H is closed under reduction: V ∈ H and V −→ W =⇒ W ∈ H

46

slide-47
SLIDE 47

Axiomatic set of values

[2] In every reversible tile

V2 W V1 M u′ u v′ v

V1 ∈ H and V2 ∈ H =⇒ M ∈ H

47

slide-48
SLIDE 48

Axiomatic set of values

[3] In every irreversible tile

V W N M u′ f u v

V ∈ H =⇒ M ∈ H

48

slide-49
SLIDE 49

Stability theorem

Suppose given an axiomatic set H of values.

  • Theorem. For every term M, there exists a cone of paths
  • M

Vi

ei

  • i∈I

satisfying the following property: for every rewriting path f : M W where W ∈ H there exists a unique index i ∈ I and a unique path h : Vi W up to homotopy such that M W

f

∼ M Vi W

ei h

49

slide-50
SLIDE 50

A cone of head-rewriting paths

This means that there is a unique head-rewriting path ei : M Vi in the cone such that f factors as M ∼ Vi W

f ei h

up to homotopy.

50

slide-51
SLIDE 51

Application to the λσ-calculus

Suppose that M is a λ-term seen as a λσ-term. Theorem. Every head rewriting path ei : M Vi Vi ∈ Hλσ to the set Hλσ of λσ-head-normal forms is transported to e : M σ(Vi) the unique head-rewriting path from M to the set Hλ

  • f head-normal forms in the λ-calculus.

51

slide-52
SLIDE 52

Short bibliography

On the λσ-calculus:

Typed lambda-calculi with explicit substitutions may not terminate. Proceedings of TLCA 1995, LNCS 902, pp. 328-334, 1995. The lambda-sigma calculus enjoys finite normalisation cones. Journal of Logic and Computation, vol 10 No. 3, pp. 461-487, 2000.

On axiomatic rewriting theory:

A diagrammatic standardisation theorem. Processes, Terms and Cycles: Steps on the Road to Infinity. Jan Willem Klop Festschrift, LNCS 3838, 2002. A factorisation theorem in Rewriting Theory. Proceedings of CTCS 1997, LNCS 1290, 1997. A stability theorem in Rewriting Theory. Proceedings of LICS 1998, pp. 287-298, 1998.

52