Compositional Z
Confluence for Permutative Conversion
Koji Nakazawa (Nagoya U) joint work with Ken-etsu Fujita (Gunma U) Workshop on Mathematical Logic and its Application 2016.9 @ Kyoto
Compositional Z Confluence for Permutative Conversion Koji Nakazawa - - PowerPoint PPT Presentation
Compositional Z Confluence for Permutative Conversion Koji Nakazawa (Nagoya U) joint work with Ken-etsu Fujita (Gunma U) Workshop on Mathematical Logic and its Application 2016.9 @ Kyoto } } } } Confluence M ! ! M 1 M 2 ! ! N } }
Koji Nakazawa (Nagoya U) joint work with Ken-etsu Fujita (Gunma U) Workshop on Mathematical Logic and its Application 2016.9 @ Kyoto
Uniqueness of result of computation
Uniqueness of result of computation Consistency of equational theory
(λx.M)N →β M[x := N]
If we find a mapping (·)* s.t. then the reduction system is confluent
Z theorem
1
2
3
Z theorem
1
2
3
Z theorem
1
2
3
Z theorem
1
2
3
Z theorem
1
2
3
Z theorem
1
2
3
x∗ = x (λx.M)∗ = λx.M∗ ((λx.M)N)∗ = M∗[x := N∗] (MN)∗ = M∗N∗ (M is not abst.)
x∗ = x (λx.M)∗ = λx.M∗ ((λx.M)N)∗ = M∗[x := N∗] (MN)∗ = M∗N∗ (M is not abst.)
M →∗ M∗ M∗[x := N∗] →∗ (M[x := N])∗
(i) (ii)
(i)
(ii)
M →∗ M∗ M∗[x := N∗] →∗ (M[x := N])∗
(i) (ii)
(i)
(ii)
M →∗ M∗ M∗[x := N∗] →∗ (M[x := N])∗
(i) (ii)
(i)
(ii)
M →∗ M∗ M∗[x := N∗] →∗ (M[x := N])∗
(i) (ii)
π
. . . . P Γ A1 A2 . . . . Q1 Γ, A1 B C . . . . Q2 Γ, A2 B C Γ B C (E∨) . . . . R Γ B Γ C (E→)
. . . . P Γ A1 A2 . . . . Q1 Γ, A1 B C . . . . R Γ B Γ, A1 C (E→) . . . . Q2 Γ, A2 B C . . . . R Γ B Γ, A1 C (E→) Γ C (E∨)
π
. . . . P Γ A1 A2 . . . . Q1 Γ, A1 B C . . . . Q2 Γ, A2 B C Γ B C (E∨) . . . . R Γ B Γ C (E→)
. . . . P Γ A1 A2 . . . . Q1 Γ, A1 B C . . . . R Γ B Γ, A1 C (E→) . . . . Q2 Γ, A2 B C . . . . R Γ B Γ, A1 C (E→) Γ C (E∨)
P[x1.Q1R, x2.Q2R]
π
(case P with x1→Q1 | x2→Q2)R P[x1.Q1,x2.Q2]R =
M, N ::= x | λx.M | ι1M | ι2M | Me e ::= M | [x1.N1, x2.N2] (λx.M)N →β M[x := N] (ιiM)[x1.N1, x2.N2] →β Ni[xi := M] M[x1.N1, x2.N2]e →π M[x1.N1e, x2.N2e]
M, N ::= x | λx.M | ι1M | ι2M | Me e ::= M | [x1.N1, x2.N2] (λx.M)N →β M[x := N] (ιiM)[x1.N1, x2.N2] →β Ni[xi := M] M[x1.N1, x2.N2]e →π M[x1.N1e, x2.N2e]
uniform representation
permutative conversion
left associative (M[x1.N1,x2.N2])e
M, N ::= x | λx.M | ι1M | ι2M | Me e ::= M | [x1.N1, x2.N2] (λx.M)N →β M[x := N] (ιiM)[x1.N1, x2.N2] →β Ni[xi := M] M[x1.N1, x2.N2]e →π M[x1.N1e, x2.N2e]
uniform representation
x[y.y][z.z][w.w]
π
π
π
π
x[y.y][z.z][w.w]
π
π
π
π
x[y.y][z.z][w.w]
π
π
π
π
these steps must be considered as
x[y.y][z.z][w.w]
π
π
π
π
these steps must be considered as
We can avoid parallel reduction by Z
x[y.y][z.z][w.w]
π
π
π
π
x[y.y][z.z][w.w]
π
π
π
π
we have to do π completely
x∗ = x (λx.M)∗ = λx.M∗ (ιM)∗ = ιM∗ ((λx.M)N)∗ = M∗[x := N∗] ((ιM)[x.N])∗ = N∗[x := M∗] (Me)∗ = M∗@e∗ (otherwise) (M[x.N])@e = M[x.N@e] M@e = Me (otherwise)
x∗ = x (λx.M)∗ = λx.M∗ (ιM)∗ = ιM∗ ((λx.M)N)∗ = M∗[x := N∗] ((ιM)[x.N])∗ = N∗[x := M∗] (Me)∗ = M∗@e∗ (otherwise) (M[x.N])@e = M[x.N@e] M@e = Me (otherwise)
x∗ = x (λx.M)∗ = λx.M∗ (ιM)∗ = ιM∗ ((λx.M)N)∗ = M∗[x := N∗] ((ιM)[x.N])∗ = N∗[x := M∗] (Me)∗ = M∗@e∗ (otherwise)
x∗ = x (λx.M)∗ = λx.M∗ (ιM)∗ = ιM∗ ((λx.M)N)∗ = M∗[x := N∗] ((ιM)[x.N])∗ = N∗[x := M∗] (Me)∗ = M∗@e∗ (otherwise)
((ι(x[y.y]))[z.z]w)∗ = ((ι(x[y.y]))[z.z])∗@w = (x[y.y])@w = x[y.yw] ((ι(x[y.y]))[z.zw])∗ = (zw)∗[z := x[y.y]] = x[y.y]w
x∗ = x (λx.M)∗ = λx.M∗ (ιM)∗ = ιM∗ ((λx.M)N)∗ = M∗[x := N∗] ((ιM)[x.N])∗ = N∗[x := M∗] (Me)∗ = M∗@e∗ (otherwise)
((ι(x[y.y]))[z.z]w)∗ = ((ι(x[y.y]))[z.z])∗@w = (x[y.y])@w = x[y.yw] ((ι(x[y.y]))[z.zw])∗ = (zw)∗[z := x[y.y]] = x[y.y]w permutation is applied to the result of β
x∗ = x (λx.M)∗ = λx.M∗ (ιM)∗ = ιM∗ ((λx.M)N)∗ = M∗[x := N∗] ((ιM)[x.N])∗ = N∗[x := M∗] (Me)∗ = M∗@e∗ (otherwise)
((ι(x[y.y]))[z.z]w)∗ = ((ι(x[y.y]))[z.z])∗@w = (x[y.y])@w = x[y.yw] ((ι(x[y.y]))[z.zw])∗ = (zw)∗[z := x[y.y]] = x[y.y]w permutation is applied to the result of β
(·)* is Z for → iff
(·)* is Z for → iff (·)* is weakly Z for → by →x iff
x
x N∗
1
1
2
1
Z for 1 Compositional Z
1
1
2
1
weak Z for 2 Z for 1 Compositional Z
1
1
2
1
xP = x (λx.M)P = λx.MP (ιM)P = ιMP (Me)P = MP@eP xB = x (λx.M)B = λx.MB (ιM)B = ιMB ((λx.M)N)B = MB[x := NB] ((ιM)[x.N])B = NB[x := MB] (Me)B = MBeB (otherwise)
λ with permutative conversion π and β
λ with permutative conversion π and β λμ with permutative conversion πμ and β
λ with permutative conversion π and β λμ with permutative conversion πμ and β extensional λ η and β
λ with permutative conversion π and β λμ with permutative conversion πμ and β extensional λ η and β λ with explicit subst. x and β
λ with permutative conversion π and β λμ with permutative conversion πμ and β extensional λ η and β λ with explicit subst. x and β
Compositional Z enables us to prove confluence by dividing reduction system into two parts
M1 ! ! M2 } } ∃N
n
= # of → in Mr … Mn = #r[r,n]
r = # of → in M0 = Mn l = # of ← in M0 = Mn
r
n
M N
N∗
r
M N
N∗
r
M N
N∗
For λβ, it is non-elementary
we can give a bound Main(M=N) in CR
M →1 N ⇒ N →Rev1(|M|) M1 M →Eval2(|M|) M2 M →2 N ⇒ N →Rev2(|M|) M12 M →n N ⇒ M12 →Mon(|M|,n) N12
M
2
/ N ⌅ ⌅ M12 / / N12 M
1
/ N
1
| | M1
1
/ / ✏✏ N1 M12 / / N12
Main(M=N) is defined as Main(M←N) = 1 Main(M→1N) = Rev1(|M|) + Eval2(|M1|) Main(M→2N) = Rev2(|M|) Main(M=P←Q) = Main(M=P) + 1 Main(M=P→1Q) = Mon(n,Main(M=P)) + Eval2(n) + Rev1(n) Main(M=P→2Q) = Mon(n,Main(M=P)) + Rev2(n) where n = maximum term size in M=N
Studia Logica, to appear.
In Proceedings of 33rd JSSST, 2016
composed by Sutoku-In (崇徳院) in 12th cent.
瀬を早み 岩にせかるる滝川の われても末に 逢はむとぞ思ふ
(direct translation) A stream of the river separates into two streams after hitting the rock, but it will become one stream again
(that is,) although if I love someone but we cannot be together in this life, I can be together with her in the next life
Japanese-English Bilingual Corpus of Wikipedia's Kyoto Articles (National Institute of Information and Communications Technology)
composed by Sutoku-In (崇徳院) in 12th cent.
瀬を早み 岩にせかるる滝川の われても末に 逢はむとぞ思ふ
(direct translation) A stream of the river separates into two streams after hitting the rock, but it will become one stream again
(that is,) although if I love someone but we cannot be together in this life, I can be together with her in the next life
Japanese-English Bilingual Corpus of Wikipedia's Kyoto Articles (National Institute of Information and Communications Technology)
confluence makes us happy!