Second-order ACGs as Hyperedge Replacement Grammars · MCTAG: multi-component tree-adjoining...
Transcript of Second-order ACGs as Hyperedge Replacement Grammars · MCTAG: multi-component tree-adjoining...
Second-order ACGs as Hyperedge Replacement
GrammarsMakoto Kanazawa
NII, Tokyo
This talk
: second-order abstract categorial grammars (de Groote 2001) : hyperedge replacement graph grammars (Bauderon and Courcelle 1987, Habel and Kreowski 1987)Generalize “context-free” grammars on strings/trees
string generating power
tree generating power
STR(A) = STR(HR)
TR(A) = TR(HR)
A
HR
This talk
: second-order abstract categorial grammars (de Groote 2001) : hyperedge replacement graph grammars (Bauderon and Courcelle 1987, Habel and Kreowski 1987)Generalize “context-free” grammars on strings/trees
string generating power
tree generating power
STR(A) = STR(HR)
TR(A) = TR(HR)
A
HR
already known(de Groote & Pogodalla, Salvati)
This talk
: second-order abstract categorial grammars (de Groote 2001) : hyperedge replacement graph grammars (Bauderon and Courcelle 1987, Habel and Kreowski 1987)Generalize “context-free” grammars on strings/trees
string generating power
tree generating power
STR(A) = STR(HR)
TR(A) = TR(HR)
A
HR
already known(de Groote & Pogodalla, Salvati)
new!
“Context-free” grammar formalisms
A
B C
derivation tree
“yield” (string, tree, ...)
“Context-free” grammar formalisms
A
B C
derivation tree
“yield” (string, tree, ...)
set of derivation tree = local set
“Context-free” grammar formalisms
A
B C
derivation tree
“yield” (string, tree, ...)
set of derivation tree = local set
linear, non-deleting, non-destructive operation
“Context-free” grammar formalisms
A
B C
derivation tree
“yield” (string, tree, ...)
A! BC
X1 X2A
!:! B(X1), C(X2).
“context-free” production
top-down view bottom-up view
set of derivation tree = local set
linear, non-deleting, non-destructive operation
Multiple context-free grammars{ ambncmdn | m, n ! 0 }
S
A B
am cmbn dn
am bn cm dn
S(x1y1x2y2) :− A(x1, x2), B(y1, y2).A(ax1, cx2) :− A(x1, x2).A(!, !).
B(by1, dy2) :− B(y1, y2).B(!, !).
Multiple context-free grammars{ ambncmdn | m, n ! 0 }
S
A B
am cmbn dn
am bn cm dn
S(x1y1x2y2) :− A(x1, x2), B(y1, y2).A(ax1, cx2) :− A(x1, x2).A(!, !).
B(by1, dy2) :− B(y1, y2).B(!, !).
tuple of strings
“Context-free” grammars on …
RTG: regular tree grammarLCFTG: linear non-deleting context-free tree grammarMCFG: multiple context-free grammarMRTG: multiple regular tree grammarMCTAG: multi-component tree-adjoining grammar
strings trees tree contextsC[x1]
n-ary tree contexts C[x1,...,xn]
single CFG RTG TAG (monadic LCFTG) LCFTG
multiple MCFG MRTG MCTAG
“Context-free” grammars on …
RTG: regular tree grammarLCFTG: linear non-deleting context-free tree grammarMCFG: multiple context-free grammarMRTG: multiple regular tree grammarMCTAG: multi-component tree-adjoining grammar
strings trees tree contextsC[x1]
n-ary tree contexts C[x1,...,xn]
single CFG RTG TAG (monadic LCFTG) LCFTG
multiple MCFG MRTG MCTAG
MLCFTG: multiple linear non-deleting context-free tree grammar
MLCFTG
MLCFTG
S
A
A
A
A
„,
«.
f f
a a
f f
b b b b
a
a
f
b
b
b
b
a
a
f
b
b
b
b
f f
a
b b
a
b b
a
b b b b
a
f
e e e e
e eee
f
a a
b b b b
f f
y1 y2S
!:! A(y1, y2).
y1 y2A
,
!:! A(y1, y2).
string abbac !z.a(b(b(a(cz))))
tree a(f (be)(be))
n-ary tree context
!x1x2.a(f (bx1)(bx2))
tuple (N1, N2, N3) !w.wN1N2N3
logical formula !x"y(Rxy) !(!x."(!y.Rxy))
ACG: Everything is a linear λ-term
f
a
b b
f
a
b b
ee
MLCFTGs as second-order ACGs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
MLCFTGs as second-order ACGs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
2nd-order ACG: linear λ-termA
`!w.X(!y1y2.w(!x1x2.a(y1(bx1)(bx2)))(!x1x2.a(y2(bx1)(bx2))))
´:! A(X).
MLCFTGs as second-order ACGs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
a a
b b b b
y1 y2A
!w.X(!y1y2.w
„ «„ «)
!:! A(X).
2nd-order ACG: linear λ-termA
`!w.X(!y1y2.w(!x1x2.a(y1(bx1)(bx2)))(!x1x2.a(y2(bx1)(bx2))))
´:! A(X).
MLCFTGs as second-order ACGs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
f f
a
b b
a
b b
f f
MLCFTGs as second-order ACGs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
f f
a
b b
a
b b
f f
!w.(!v.v(!x1x2.f x1x2)(!x1x2.f x1x2))(!y1y2.w(!x1x2.a(y1(bx1)(bx2)))(!x1x2.a(y2(bx1)(bx2))))
!" !w.w(!x1x2.a(f (bx1)(bx2)))(!x1x2.a(f (bx1)(bx2)))
MLCFTGs as second-order ACGs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
f f
a
b b
a
b b
f f
β-reduction
a a
b b b b
y1 y2f f!w.(!v.v
„ «„ «)(!y1y2.w
„ «„ «)!" !w.w
„ «„ «f f
a
b b
a
b b
!w.(!v.v(!x1x2.f x1x2)(!x1x2.f x1x2))(!y1y2.w(!x1x2.a(y1(bx1)(bx2)))(!x1x2.a(y2(bx1)(bx2))))
!" !w.w(!x1x2.a(f (bx1)(bx2)))(!x1x2.a(f (bx1)(bx2)))
MLCFTGs as second-order ACGs
TR(A) ! MLCFTL
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
f f
a
b b
a
b b
f f
!w.(!v.v(!x1x2.f x1x2)(!x1x2.f x1x2))(!y1y2.w(!x1x2.a(y1(bx1)(bx2)))(!x1x2.a(y2(bx1)(bx2))))
!" !w.w(!x1x2.a(f (bx1)(bx2)))(!x1x2.a(f (bx1)(bx2)))
HR: Everything is a hypergrapha ab b c
1 2
string graph
bb
f
ee
1
a
bb
f
1
a
2
3
tree graph of type 1 tree graph of type 3
node
f1 2
3
hyperedge
2external node
HR: Everything is a hypergrapha ab b c
1 2
string graph
bb
f
ee
1
a
bb
f
1
a
2
3
tree graph of type 1 tree graph of type 3
node
f1 2
3
hyperedge
2external node
tuple = disjoint union
MLCFTGs as HRs
MLCFTG:
a a
b b b b
y1 y2A
,
!:! A(y1, y2).
HR:
X
a a
b b b b
3 6
1 2 4 5
1
2
3
4
5
6
A
!:! A(X)
hypergraph
Hyperedge replacement
a a
b b b b
3 6
1 2 4 5
1 2
3
4 5
6
f f
1 2
3
4 5
6
a a
b b b b
3 6
1 2 4 5
f f
hyperedgereplacement
Hyperedge replacement
a a
b b b b
3 6
1 2 4 5
1 2
3
4 5
6
f f
1 2
3
4 5
6
a a
b b b b
3 6
1 2 4 5
f f
hyperedgereplacement
TR(HR) ! MLCFTL
Example: LadderX
a
a
a
1 2
X
a a
1 2
1 2
S
!:! A(X).
A
!:! A(X).
A` ´
.1 2
a a
a
a a
a
a a
a
a a
a
a a
Example: LadderX
a
a
a
1 2
X
a a
1 2
1 2
S
!:! A(X).
A
!:! A(X).
A` ´
. hypergraphs λ-terms!"1 2
a a
a
a a
a
a a
a
a a
a
a a
Linear λ-terms vs. hypergraphs
stringstrees
tree contexts
ladder
?
hypergraphslinear λ-terms
λ-terms as hypergraphs!(!x."(!y.Rxy))
λ-terms as hypergraphs!(!x."(!y.Rxy))
tree graph
1
!
!x
!
λy
R
x y
λ-terms as hypergraphs!(!x."(!y.Rxy))
tree graph
1
!
!x
!
λy
R
x y
λ-terms as hypergraphs!(!x."(!y.Rxy))
tree graph
1
!
!x
!
λy
R
x y
!
!
R
x y
1
term graph
λ-terms as hypergraphs!(!x."(!y.Rxy))
tree graph
1
!
!x
!
λy
R
x y
!
!
R
x y
1
term graph
rank(c) = |type(c)|3 = |(e! t)! t|
λ-terms as hypergraphs!(!x."(!y.Rxy))
tree graph
1
!
!x
!
λy
R
x y
!
!
R
x y
1
term graph
linear λ-terms hypergraphs!
rank(c) = |type(c)|3 = |(e! t)! t|
2nd-order ACGs as HRsS
`X(!x.Y x)
´:! NP(X),VP(Y ).
VP`!x.Y (!y.Xxy)
´:! V(X),NP(Y ).
V(!xy.Rxy).
NP(!u."(!x.ux)).NP(!u.#(!x.ux)).
X
Y
1
2
x y
VP
!:! V(X),NP(Y ).
Linear β-reduction ashyperedge replacement
1
!
!
R
x y
1
!
2 3
x
!
R
x y
1
2
1
hyperedgereplacement
!(!x."(!y.Rxy))
Second-order ACGs vs. hyperedge replacement grammars
λ-term generating power
MLCFTL ! TR(A)MLCFTL ! TR(HR)LT (A) ! LT (HR)
Second-order ACGs vs. hyperedge replacement grammars
λ-term generating power
MLCFTL ! TR(A)MLCFTL ! TR(HR)LT (A) ! LT (HR)
(Engelfriet and Maneth 2000)TR(HR) ! MLCFTL
Second-order ACGs vs. hyperedge replacement grammars
λ-term generating power
TR(A) = TR(HR)
MLCFTL ! TR(A)MLCFTL ! TR(HR)LT (A) ! LT (HR)
(Engelfriet and Maneth 2000)TR(HR) ! MLCFTL
Convergence of mildly context-sensitive grammar formalisms
TAG=LIG=HG=C2
MCFG=MCTAG=DTWT=MG=HR=A
LCFTG
string languages
Convergence of mildly context-sensitive grammar formalisms
TAG=LIG=HG=C2
MCFG=MCTAG=DTWT=MG=HR=A
LCFTG
string languages
TAG
LCFTG
sur-AT=HR=A=MLCFTG
tree languages