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
Rewriting paths modulo homotopy An algebraic and topological notion of confluence 2
The λ -calculus with explicit substitutions Terms | | λ M | M :: = MN M [ s ] 1 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
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 ◦ ↑ )]) → M [ s ◦ t ] Clos M [ s ][ t ] 1 [ M · s ] → VarCons M → VarId 1 [ id ] 1 ( M · s ) ◦ t → M [ t ] · ( s ◦ t ) Map IdL id ◦ s → s Ass ( s 1 ◦ s 2 ) ◦ s 3 → s 1 ◦ ( s 2 ◦ s 3 ) Shi ftCons ↑ ◦ ( M · s ) → s Shi ftId ↑ ◦ id → ↑ 4
The eleven critical pairs of the λσ -calculus App Beta App + Beta ( λ M )[ s ]( N [ s ]) ← (( λ M ) N )[ s ] → M [ N · id ][ s ] App Clos ( MN )[ s ◦ t ] ← → Clos + App ( MN )[ s ][ t ] ( M [ s ]( N [ s ]))[ t ] Clos Abs ( λ M )[ s ◦ t ] ← ( λ M )[ s ][ t ] → ( λ ( M [ 1 · s ◦ ↑ ]))[ t ] Clos + Abs Clos VarId 1 [ id ◦ s ] ← → Clos + VarId 1 [ id ][ s ] 1 [ s ] Clos VarCons 1 [( M · s ) ◦ t ] ← 1 [ M · s ][ t ] → Clos + VarCons M [ t ] Clos Clos M [ s ][ t ◦ t ′ ] M [ s ][ t ][ t ′ ] M [ s ◦ t ][ t ′ ] ← → Clos + Clos Map Ass ( M · s ) ◦ ( t ◦ t ′ ) (( M · s ) ◦ t ) ◦ t ′ ( M [ t ] · s ◦ t ) ◦ t ′ Ass + Map ← → Ass IdL Ass + IdL id ◦ ( s ◦ t ) ← ( id ◦ s ) ◦ t → s ◦ t ShiftId Ass ↑ ◦ ( id ◦ s ) ← ( ↑ ◦ id ) ◦ s → ↑ ◦ s Ass + Shi ftId ShiftCons Ass ↑ ◦ (( M · s ) ◦ t ) ← ( ↑ ◦ ( M · s )) ◦ t → s ◦ t Ass + Shi ftCons Ass Ass ( s ◦ ( s ′ ◦ t )) ◦ t ′ ( s ◦ s ′ ) ◦ ( t ◦ t ′ ) (( s ◦ s ′ ) ◦ t ) ◦ t ′ Ass + Ass ← → 5
� � � � � � � A very dangerous critical pair App � ( λ P )[ s ] Q [ s ] Lam � ( λ ( P [ 1 · s ◦ ↑ ])) Q [ s ] (( λ P ) Q )[ s ] Beta Beta P [ Q · id ][ s ] P [ 1 · s ◦ ↑ ][ Q [ s ] · id ] Clos + Map Clos + Map P [ Q [ s ] · id ◦ s ] P [ Q [ s ] · ( s ◦ ↑ ) ◦ ( Q [ s ] · id )] Ass + Shift IdL when s = M 1 · M 2 ····· M n · id P [ Q [ s ] · s ] P [ Q [ s ] · ( s ◦ id )] and the M ′ i s are in σ − normal form This critical pair leads to a counter-example to strong normalization in the simply-typed λσ -calculus (TLCA 1995). 6
A fundamental problem Hence, one main challenge of Rewriting Theory: Classify the rewriting paths from a term P to its normal form Q f P Q g Very complicated in the case of the λσ -calculus... 7
I. Permutation tiles A geometric account of redex permutations 8
A key observation Theorem [Lévy 1978] In the λ -calculus, every two paths to the normal form f P Q g are equal modulo a series of β -redex permutations: f P ∼ Q g 9
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
Permutation tiles [1] MQ v u ′ the redex u : M → P PQ MN and the redex v : N → Q are independent u v ′ PN 11
Permutation tiles [2] ( λx.y ) P u ′ v the outer redex u : ( λ x . y ) M → y y ( λx.y ) M erases the inner redex v : M → P u 12
Permutation tiles [3] ( λx.xx ) P v u ′ the outer redex u : ( λ x . xx ) M → MM PP duplicates ( λx.xx ) M the inner redex v 2 v : M → P u MP v 1 MM 13
Illustration of the theorem There is a 2-dimensional hole in the λ -calculus v ( λx.x ) z ( λx.x )( λy.y ) z ( λy.y ) z u because the outer redex u : ( λ x . x ) ( λ y . y ) z −→ ( λ y . y ) z is not equivalent modulo homotopy to the inner redex ( λ x . x ) ( λ y . y ) z −→ ( λ x . x ) z v : 14
Illustration of the theorem When one extends the two redexes u and v with w v w ( λx.x )( λy.y ) z z ( λx.x ) z u the resulting rewriting paths u · w and v · w are normalizing and thus equivalent modulo homotopy! 15
� � � � � � � In the λσ -calculus... Critical pairs like App � ( λ P )[ s ] Q [ s ] Lam � ( λ ( P [ 1 · s ◦ ↑ ])) Q [ s ] (( λ P ) Q )[ s ] Beta Beta P [ Q · id ][ s ] P [ 1 · s ◦ ↑ ][ Q [ s ] · id ] Clos + Map Clos + Map P [ Q [ s ] · id ◦ s ] P [ Q [ s ] · ( s ◦ ↑ ) ◦ ( Q [ s ] · id )] Ass + Shift IdL when s = M 1 · M 2 ····· M n · id P [ Q [ s ] · s ] P [ Q [ s ] · ( s ◦ id )] and the M ′ i s are in σ − normal form generate 2-dimensional holes in the rewriting geometry and thus obstructions to homotopy equivalence... 16
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
A remarkable consequence Fact. Two rewriting paths in the λσ -calculus f P Q g are transported to the same homotopy class of rewriting paths σ ( f ) σ ( P ) ∼ λ σ ( Q ) σ ( g ) when the λσ -term Q is in normal form. 18
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 ) : of the λ -calculus. ⊲ 19
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
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 v u ′ N M u f P where the rewriting path f is of arbitrary length. 21
Reversible permutations Definition: a permutation tile Q v u ′ N M u f P is called reversible when it has an inverse. Note that f is of length 1 in that specific case. 22
Reversible permutation tiles MQ v u ′ PQ MN v ′ u PN 23
Irreversible permutation tiles ( λx.y ) P u ′ v y ( λx.y ) M u 24
Irreversible permutation tiles ( λx.xx ) P v u ′ PP ( λx.xx ) M v 2 u MP v 1 MM 25
II. Standardisation cells Rewriting surfaces between rewriting paths 26
Key idea: let us track ancestors! MQ u ´ v PQ MN v ´ u PN 27
Key idea: let us track ancestors! ⌣ ⌣ λ y . x P ´ u v ⌣ ⌣ y λ y . x M u 28
Key idea: let us track ancestors! ⌣ ⌣ λ x . x x P v u ´ ⌣ ⌣ λ x . x x M P P v 2 u MP v 1 MM 29
Standardisation cells b ( λy.M ) Q ( λx. ( λy.x )) MQ c a M ( λx. ( λy.x )) MN u ( λy.M ) N v 30
Illustration ⌣ ⌣ ⌣ ⌣ ⌣ ⌣ b λ x . λ y . x MQ λ y . M Q c a M ⌣ ⌣ ⌣ ⌣ ⌣ ⌣ λ x . λ y . x MN u λ y . M N v 31
Standardisation cells Definition. A standardisation cell θ : f g : M N is a triple ( f , g , ϕ ) consisting of two coinitial and cofinal paths u p v q u 1 u 2 v 1 v 2 · · · · · · f = M N g = M N and of a function ϕ { 1 , . . . , q } { 1 , . . . , p } : called the ancestor function of the standardisation cell. 32
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
III. Standard rewriting paths The normal forms of the 2-dimensional rewriting 34
Standard rewriting paths Definition. A rewriting path f : M N is called standard when every standardisation cell f ⇒ g is reversible. 35
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
Recommend
More recommend