Appendix A: Hierarchy of Grammar Formalisms
Total Page:16
File Type:pdf, Size:1020Kb
Appendix A: Hierarchy of Grammar Formalisms The following figure recalls the language hierarchy that we have developed in the course of the book. '' $$ '' $$ '' $$ ' ' $ $ CFG, 1-MCFG, PDA n n L1 = {a b | n ≥ 0} & % TAG, LIG, CCG, tree-local MCTAG, EPDA n n n ∗ L2 = {a b c | n ≥ 0}, L3 = {ww | w ∈{a, b} } & % 2-LCFRS, 2-MCFG, simple 2-RCG & % 3-LCFRS, 3-MCFG, simple 3-RCG n n n n n ∗ L4 = {a1 a2 a3 a4 a5 | n ≥ 0}, L5 = {www | w ∈{a, b} } & % ... LCFRS, MCFG, simple RCG, MG, set-local MCTAG, finite-copying LFG & % Thread Automata (TA) & % PMCFG 2n L6 = {a | n ≥ 0} & % RCG, simple LMG (= PTIME) & % mildly context-sensitive L. Kallmeyer, Parsing Beyond Context-Free Grammars, Cognitive Technologies, DOI 10.1007/978-3-642-14846-0, c Springer-Verlag Berlin Heidelberg 2010 216 Appendix A For each class the different formalisms and automata that generate/accept exactly the string languages contained in this class are listed. Furthermore, examples of typical languages for this class are added, i.e., of languages that belong to this class while not belonging to the next smaller class in our hier- archy. The inclusions are all proper inclusions, except for the relation between LCFRS and Thread Automata (TA). Here, we do not know whether the in- clusion is a proper one. It is possible that both devices yield the same class of languages. Appendix B: List of Acronyms The following table lists all acronyms that occur in this book. (2,2)-BRCG Binary bottom-up non-erasing RCG with at most two vari- ables per left-hand side argument 2-SA Two-Stack Automaton ACG Abstract Categorial Grammar AFL Abstract Family of Languages CCG Combinatory Categorial Grammar CFG Context-Free Grammar CNF Chomsky Normal Form EPDA Extended Push-Down Automaton FSA Finite State Automaton GCFG Generalized Context-Free Grammar GNF Greibach Normal Form HPSG Head-Driven Phrase Structure Grammar IG Indexed Grammar LCFRS Linear Context-Free Rewriting System LFG Lexical Functional Grammar LIG Linear Indexed Grammar LTAG Lexicalized TAG LMG Literal Movement Grammar MCFG Multiple Context-Free Grammar MCTAG Multicomponent Tree Adjoining Grammar MG Minimalist Grammar NRCG Negative Range Concatenation Grammar NPDA Nested Push-Down Automaton PDA Push-Down Automaton PMCFG Parallel Multiple Context-Free Grammar PRCG Positive Range Concatenation Grammar RCG Range Concatenation Grammar SD-2SA Strongly-Driven Two-Stack Automaton 218 Appendix B SNMCTAG tree-local MCTAG with shared nodes SRCG Simple Range Concatenation Grammar TA Thread Automaton TAG Tree Adjoining Grammar TSG Tree Substitution Grammar TT-MCTAG Tree-Tuple MCTAG with Shared Nodes V-TAG Vector-TAG Solutions Problems of Chapter 2 n n 2.1 L2 := {a b | n ≥ 0} 1. G = N,T,P,S with N = {S}, T = {a, b}, start symbol S and produc- tions S → aSb, S → ε. 2. Assume that such a CFG exists. Its productions are then all of the form X → αaβbγ with X ∈ N, α, β, γ ∈ N ∗ such that if such a production is applied when generating a string a1 ...anb1 ...bn, then the a and b of the production necessarily end up at positions i and n+i for some i, 1 ≤ i ≤ n. Then replacing each of these productions X → αaβbγ with X → αaβaγ and X → αbβbγ leads to a CFG generating the copy language. This contradicts the fact that the copy language is not context-free. 2.2 A first homomorphism can the homomorphism f from (Shieber, 1985). After having applied f to Swiss German, we intersect with the regular lan- ∗ ∗ ∗ ∗ guage w{a, b} x{c, d} y, which leads to {wv1xv2y | v1 ∈{a, b} ,v2 ∈{c, d} such that |v1| = |v2| and for all i,1≤ i ≤|v1|,iftheith symbol in v1 is an a (a b), the ith symbol in v2 is a c (a d)}. Finally we apply a second homomorphism g to the result of the intersection with g(w):=g(x):=g(y):=ε, g(a):=g(c):=a, g(b):=g(d):=b. This leads to the copy language. 2.3 There are several possibilities. The simplest one: S VP VP NP VP ADV VP V John always laughs 220 Solutions Linguistically, this is unsatisfying since the S node comes with the lexical item John even though it is the maximal projection of the verb. A lexicalized TSG for the given CFG where the S node comes with the verb is not possible. 2.4 1. The copy language L := {ww | w ∈ T ∗} is letter equivalent to L := {wwR | w ∈ T ∗ and wR is w in reverse order},whichisaCFL:Itis generated by the CFG with productions S → ε and S → xSx for all x ∈ T . Consequently (with Parikh’s theorem) L and also L are semilinear. 2n 2. Assume that {a | n ≥ 0} satisfies the constant growth property with c0 2m m and C. Then take a w = a with |w| =2 >max({c0}∪C). Then, m+1 according to the definition of constant growth, for w = a2 there must k be a w = a2 with |w| = |w| + c for some c ∈ C. I.e., 2m+1 =2k + c. Consequently (since k ≤ m) c ≥ 2m. Contradiction. Problems of Chapter 3 3.1 The items can have the form [•A, i, −], 0 ≤ i ≤ n (for predicted categories) and [A•,i,j], 0 ≤ i<j≤ n (for completed categories). The goal item is [S•, 0,n]. We need the following deduction rules: 1. An operation scan-predict that, starting from a predicted A-item, predicts a B-item, based on the existence of a production A → aB: [•A, i, −] there is a production A → aB ∈ P with wi+1 = a. [•B,i +1, −] 2. An operation scan that turns a predicted A into a completed A based on the existence of a production A → a: [•A, i, −] there is a production A → a ∈ P with wi+1 = a. [A•,i,i+1] 3. An operation complete that turns a predicted A into a completed A based on the existence of a completed B and a production A → aB: [•A, i, −][B•,i+1,j] there is a production A → aB ∈ P with wi+1 = a. [A•,i,j] 3.2 ∗ ∗ To show: If [A → α • β,i,j] then S ⇒ w1 ···wiAγ ⇒ w1 ···wiαβγ ⇒ ∗ w1 ···wjβγ for some γ ∈ (N ∪ T ) . We show this by an induction on the deduction rules: • Axioms: S → α ∈ P [S →•α, 0, 0] ∗ Trivially, if [S →•α, 0, 0] is obtained by this rule, then S ⇒ εS ⇒ εα. Solutions 221 [A → α • Bβ,i,j] • Predict: B → γ ∈ P [B →•γ,j,j] We assume that the claim holds for the antecedent item. We then obtain ∗ ∗ (because of the production B → γ) S ⇒ w1 ···wiAγ ⇒ w1 ···wiαBβγ ⇒ w1 ···wjBβγ ⇒ w1 ···wjγγ . [A → α • aβ,i,j] • Scan: wj+1 = a [A → αa • β,i,j +1] Since the claim holds for the antecedent item, with the side condition, it holds immediately for the consequent item. [A → α • Bβ,i,j], [B → γ•,j,k] • Complete: [A → αB • β,i,k] Since the induction claim holds for the antecedent items, we have in par- ∗ ticular B ⇒ wj+1 ···wk. With this and the claim for the antecedent A- ∗ ∗ item, we obtain S ⇒ w1 ···wiAγ ⇒ w1 ···wiαBβγ ⇒ w1 ···wjBβγ ⇒ w1 ···wkβγ . The algorithm is sound since, as a special case, we obtain for the goal ∗ items that [S → α•, 0,n] implies S ⇒ α ⇒ w1 ···wn. 3.3 The space complexity of the CYK algorithm is determined by the memory requirement for the chart. Since this is an |N|×n×n table, we obtain a space complexity O(n2). 3.4 The most complex rule is complete with three indices ranging form 0 to 2 n and with |P | possible productions and lrhs = maxA→α∈P (|α| +1)pos- sible positions for the dot in the antecedent A-items. Note that, once the A-production is fixed, the position of the dot determines the left-hand side symbol of the second production. Let mrhs = maxA∈N |{A → α ∈ P }|. Then 3 we have ≤ lrhs ·|P |·mrhs(n +1) possible different applications of complete. Consequently, as in the CYK case, the time complexity of the fixed recognition problem is O(n3). Problems of Chapter 4 4.1 1. TAG for L3: SNA S aS ε ∗ bSNA c 222 Solutions 2. Assume that a TAG G for L3 without adjunction constraints exists. As- sume without loss of generality that G contains no substitution nodes. G has at least one auxiliary tree β with leaves labeled with terminals. β must contain equal numbers of as, bsandcs. (Otherwise one could de- rive a word with different numbers of as, bsandcs.) One can adjoin β at its root, which leads to a derived auxiliary β. If the yield of β is aibici (i ≥ 1), there are the following possibilities for the foot node: a) The foot node is left of all as or right of all cs ⇒ using β a word with substring aibiciaibici can be derived. Contradiction. b) The foot node is right of the kth a for some k,1≤ k ≤ i ⇒ using β a word with substring ai−kbiciai−kbici can be derived. Contradiction. c) The foot node is right of the kth b for some k,1≤ k ≤ i ⇒ using β a word with substrings aibkaibk and bi−kcibi−kci can be derived. Contradiction. d) The foot node is left of the kth c for some k,1≤ k ≤ i ⇒ using β a word with substring aibick−1aibick−1 can be derived. Contradiction. Consequently, there is no TAG without adjunction constraints for L3.