| { |
| "paper_id": "P97-1002", |
| "header": { |
| "generated_with": "S2ORC 1.0.0", |
| "date_generated": "2023-01-19T09:15:19.365434Z" |
| }, |
| "title": "Fast Context-Free Parsing Requires Fast Boolean Matrix Multiplication", |
| "authors": [ |
| { |
| "first": "Lillian", |
| "middle": [], |
| "last": "Lee", |
| "suffix": "", |
| "affiliation": { |
| "laboratory": "", |
| "institution": "Harvard University", |
| "location": { |
| "addrLine": "33 Oxford Street Cambridge", |
| "postCode": "012138", |
| "settlement": "llee~eecs, harvard", |
| "region": "MA, edu" |
| } |
| }, |
| "email": "" |
| } |
| ], |
| "year": "", |
| "venue": null, |
| "identifiers": {}, |
| "abstract": "Valiant showed that Boolean matrix multiplication (BMM) can be used for CFG parsing. We prove a dual result: CFG parsers running in time O([Gl[w[ 3-e) on a grammar G and a string w can be used to multiply m x m Boolean matrices in time O(m3-e/3). In the process we also provide a formal definition of parsing motivated by an informal notion due to Lang. Our result establishes one of the first limitations on general CFG parsing: a fast, practical CFG parser would yield a fast, practical BMM algorithm, which is not believed to exist.", |
| "pdf_parse": { |
| "paper_id": "P97-1002", |
| "_pdf_hash": "", |
| "abstract": [ |
| { |
| "text": "Valiant showed that Boolean matrix multiplication (BMM) can be used for CFG parsing. We prove a dual result: CFG parsers running in time O([Gl[w[ 3-e) on a grammar G and a string w can be used to multiply m x m Boolean matrices in time O(m3-e/3). In the process we also provide a formal definition of parsing motivated by an informal notion due to Lang. Our result establishes one of the first limitations on general CFG parsing: a fast, practical CFG parser would yield a fast, practical BMM algorithm, which is not believed to exist.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Abstract", |
| "sec_num": null |
| } |
| ], |
| "body_text": [ |
| { |
| "text": "The context-free grammar (CFG) formalism was developed during the birth of the field of computational linguistics. The standard methods for CFG parsing are the CKY algorithm (Kasami, 1965; Younger, 1967) and Earley's algorithm (Earley, 1970) , both of which have a worst-case running time of O(gN 3) for a CFG (in Chomsky normal form) of size g and a string of length N. Graham et al. (1980) give a variant of Earley's algorithm which runs in time O(gN3/log N). Valiant's parsing method is the asymptotically fastest known (Valiant, 1975) . It uses Boolean matrix multiplication (BMM) to speed up the dynamic programming in the CKY algorithm: its worst-case running time is O(gM(N)), where M(rn) is the time it takes to multiply two m x m Boolean matrices together.", |
| "cite_spans": [ |
| { |
| "start": 174, |
| "end": 188, |
| "text": "(Kasami, 1965;", |
| "ref_id": "BIBREF7" |
| }, |
| { |
| "start": 189, |
| "end": 203, |
| "text": "Younger, 1967)", |
| "ref_id": "BIBREF14" |
| }, |
| { |
| "start": 208, |
| "end": 226, |
| "text": "Earley's algorithm", |
| "ref_id": null |
| }, |
| { |
| "start": 227, |
| "end": 241, |
| "text": "(Earley, 1970)", |
| "ref_id": null |
| }, |
| { |
| "start": 371, |
| "end": 391, |
| "text": "Graham et al. (1980)", |
| "ref_id": "BIBREF5" |
| }, |
| { |
| "start": 523, |
| "end": 538, |
| "text": "(Valiant, 1975)", |
| "ref_id": "BIBREF13" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "The standard method for multiplying matrices takes time O(m3). There exist matrix multiplication algorithms with time complexity O(m3-J); for instance, Strassen's has a worstcase running time of O(m 2\"sl) (Strassen, 1969) , and the fastest currently known has a worst-case running time of O(m 2\"376) (Coppersmith and Winograd, 1990) . Unfortunately, the constants involved are so large that these fast algorithms (with the possible exception of Strassen's) cannot be used in practice. As matrix multiplication is a very well-studied problem (see Strassen's historical account (Strassen, 1990 , section 10)), it is highly unlikely that simple, practical fast matrix multiplication algorithms exist. Since the best BMM algorithms all rely on general matrix multiplication 1, it is widely believed that there are no practical O(m 3-~) BMM algorithms.", |
| "cite_spans": [ |
| { |
| "start": 205, |
| "end": 221, |
| "text": "(Strassen, 1969)", |
| "ref_id": "BIBREF11" |
| }, |
| { |
| "start": 300, |
| "end": 332, |
| "text": "(Coppersmith and Winograd, 1990)", |
| "ref_id": "BIBREF1" |
| }, |
| { |
| "start": 576, |
| "end": 591, |
| "text": "(Strassen, 1990", |
| "ref_id": "BIBREF12" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "One might therefore hope to find a way to speed up CFG parsing without relying on matrix multiplication. However, we show in this paper that fast CFG parsing requires fast Boolean matrix multiplication in a precise sense: any parser running in time O(gN 3-e) that represents parse data in a retrieval-efficient way can be converted with little computational overhead into a O(m 3-e/3) BMM algorithm.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "Since it is very improbable that practical fast matrix multiplication algorithms exist, we thus establish one of the first nontrivial limitations on practical CFG parsing.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "1The \"four Russians\" algorithm (Arlazarov et al., 1970) , the fastest BMM algorithm that does not simply use ordinary matrix multiplication, has worst-case running time O(mS/log m).", |
| "cite_spans": [ |
| { |
| "start": 31, |
| "end": 55, |
| "text": "(Arlazarov et al., 1970)", |
| "ref_id": "BIBREF0" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "Our technique, adapted from that used by Satta (1994) for tree-adjoining grammar (TAG) parsing, is to show that BMM can be efficiently reduced to CFG parsing. Satta's result does not apply to CFG parsing, since it explicitly relies on the properties of TAGs that allow them to generate non-context-free languages.", |
| "cite_spans": [ |
| { |
| "start": 41, |
| "end": 53, |
| "text": "Satta (1994)", |
| "ref_id": "BIBREF9" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction", |
| "sec_num": "1" |
| }, |
| { |
| "text": "A Boolean matrix is a matrix with entries from the set {0, 1}. A Boolean matrix multiplication algorithm takes as input two m x m Boolean matrices A and B and returns their Boolean product A x B, which is the m \u00d7 m Boolean matrix C whose entries c~j are defined by m = V (a,k A bkj).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definitions", |
| "sec_num": "2" |
| }, |
| { |
| "text": "k=l That is, c.ij = 1 if and only if there exists a number k, 1 < k < m, such that aik = bkj = 1.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definitions", |
| "sec_num": "2" |
| }, |
| { |
| "text": "We use the usual definition of a context-free grammar (CFG) as a 4-tuple G = (E, V, R, S), where E is the set of terminals, V is the set of nonterminals, R is the set of productions, and S C V is the start symbol. Given a string w ~ WlW2...WN over E*, where each wi is an element of E, we use the notation ~ to denote the substring wiwi+l \" \" \" Wj-lWj", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definitions", |
| "sec_num": "2" |
| }, |
| { |
| "text": "We will be concerned with the notion of c-derivations, which are substring derivations that are consistent with a derivation of an entire string. Intuitively, A =~* w~i is a c-derivation if it is consistent with at least one parse of w.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "\u2022", |
| "sec_num": null |
| }, |
| { |
| "text": "\u2022 A ~* w~, and", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "\u2022 S =::~* i--lA N 'u] 1 14wit 1 .", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "(These conditions together imply that S ~* w.)", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "We would like our results to apply to all \"practical\" parsers, but what does it mean for a parser to be practical? First, we would like to be able to retrieve constituent information for all possible parses of a string (after all, the recovery of structural information is what distinguishes parsing algorithms from recognition algorithms); such information is very useful for applications like natural language understanding, where multiple interpretations for a sentence may result from different constituent structures. Therefore, practical parsers should keep track of c-derivations. Secondly, a parser should create an output structure from which information about constituents can be retrieved in an efficient way -- Satta (1994) points out an observation of Lang to the effect that one can consider the input string itself to be a retrievalinefficient representation of parse information. In short, we require practical parsers to output a representation of the parse forest for a string that allows efficient retrieval of parse information. Lang in fact argues that parsing means exactly the production of a shared forest structure \"from which any specific parse can be extracted in time linear with the size of the extracted parse tree\" (Lang, 1994, pg. 487) , and Satta (1994) makes this assumption as well.", |
| "cite_spans": [ |
| { |
| "start": 723, |
| "end": 735, |
| "text": "Satta (1994)", |
| "ref_id": "BIBREF9" |
| }, |
| { |
| "start": 1246, |
| "end": 1267, |
| "text": "(Lang, 1994, pg. 487)", |
| "ref_id": null |
| }, |
| { |
| "start": 1274, |
| "end": 1286, |
| "text": "Satta (1994)", |
| "ref_id": "BIBREF9" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "These notions lead us to equate practical parsers with the class of c-parsers, which keep track of c-derivations and may also calculate general substring derivations as well.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "Definition 2 A c-parser is an algorithm that takes a CFG grammar G = (E,V,R,S) and string w E E* as input and produces output ~G,w; J:G,w acts as an oracle about parse information, as follows:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "\u2022 If A c-derives w~, then .7:G,w(A,i,j) = \"yes \".", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "If A ~* J :which implies that A does not", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "\u2022 W i c-derive wJi )", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": ", then :7:G,w( A, i, j ) = \"no\".", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "\u2022 J:G,w answers queries in constant time.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "Note that the answer 5~c,w gives can be arbi-J trary if A :=v* J but A does not c-derive w i .", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Definition 1 Let G = (E, V, R, S) be a CFG, and let w = wlw2...wN, wi E ~. A nontermi-J hal A E V c-derives (consistently derives) w i if and only if the following conditions hold:", |
| "sec_num": null |
| }, |
| { |
| "text": "The constant-time constraint encodes the notion that information extraction is efficient; observe that this is a stronger condition than that called for by Lang. We define c-parsers in this way to make the class of c-parsers as broad as possible. If we had changed the first condition to \"If A derives ...\", then Earley parsers would be excluded, since they do not keep track of all substring derivations. If we had written the second condition as \"If A does not c-derive ur~i , then ... \", then CKY parsers would not be c-parsers, since they keep track of all substring derivations, not just c-derivations. So as it stands, the class of c-parsers includes tabular parsers (e.g. CKY), where 5rG,w is the table of substring derivations, and Earley-type parsers, where ~'G,~ is the chart. Indeed, it includes all of the parsing algorithms mentioned in the introduction, and can be thought of as a formalization of Lang's informal definition of parsing.", |
| "cite_spans": [ |
| { |
| "start": 156, |
| "end": 161, |
| "text": "Lang.", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "w i", |
| "sec_num": null |
| }, |
| { |
| "text": "We will reduce BMM to c-parsing, thus proving that any c-parsing algorithm can be used as a Boolean matrix multiplication algorithm. Our method, adapted from that of Satta (1994) (who considered the problem of parsing with tree-adjoining grammars), is to encode information about Boolean matrices into a CFG. Thus, given two Boolean matrices, we need to produce a string and a grammar such that parsing the string with respect to the grammar yields output from which information about the product of the two matrices can be easily retrieved.", |
| "cite_spans": [ |
| { |
| "start": 166, |
| "end": 178, |
| "text": "Satta (1994)", |
| "ref_id": "BIBREF9" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "We can sketch the behavior of the grammar as follows. Suppose entries aik in A and bkj in B are both 1. Assume we have some way to break up array indices into two parts so that i can be reconstructed from il and i2, j can be reconstructed from jl and J2, and k can be reconstructed from kl and k2. (We will describe a way to do this later.) Then, we will have the following derivation (for a quantity 5 to be defined later) :", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "Cil ,Jl ~ Ail ,kl Bkl ,jl derived by Ail,k I derived by Bkl,jl", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "The key thing to observe is that Cil,jt generates two nonterminals whose \"inner\" indices match, and that these two nonterminals generate substrings that lie exactly next to each other. The \"inner\" indices constitute a check on kl, and the substring adjacency constitutes a check on k2.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "Let A and B be two Boolean matrices, each of size m x m, and let C be their Boolean matrix product, C = A x B. In the rest of this section, we consider A, B, C, and m to be fixed. Set n = [ml/3] , and set 5 = n+2.", |
| "cite_spans": [ |
| { |
| "start": 188, |
| "end": 194, |
| "text": "[ml/3]", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "We will be constructing a string of length 35; we choose 5 slightly larger than n in order to avoid having epsilon-productions in our grammar.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "Recall that c/j is non-zero if and only if we can find a non-zero aik and a non-zero ~j such that k --k. In essence, we need simply check for the equality of indices k and k. We will break matrix indices into two parts: our grammar will check whether the first parts of k and are equal, and our string will check whether the second parts are also equal, as we sketched above. Encoding the indices ensures that the grammar is of as small a size as possible, which will be important for our time bound results.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "Our index encoding function is as follows. Let i be a matrix index, 1 < i < m. Then we define the function/", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "(i) --(fl(i), f2(i)) by fl(i) = [i/nJ (0 < fl(i) <_ n2)", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": ", and", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "f2(i) = (i mod n) + 2 (2_f2(i)_<n+l).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "Since fl and f2 are essentially the quotient and remainder of integer division of i by n, we can retrieve i from (fl(i),f2(i)).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "We will use the notational shorthand of using subscripts instead of the functions fl and f2, that is, we write il and i2 for fl(i) and f2(i).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "It is now our job to create a CFG G = (E, ~/: R, S) and a string w that encode information about A and B and express constraints about their product C. Our plan is to include a set of nonterminals {Cp,q : 1 < p,q < n 2} in V so that cij = 1 if and only if Cil,jl c-derives w j2+2~ In section 3.11 we describe a version i2 of G and prove it has this c-derivation property. Then, in section 3.2 we explain that G can easily be converted to Chomsky normal form in such a way as to preserve c-derivations.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "We choose the set of terminals to be E = {we : l<g<3n+6}, and choose the string to be parsed to be w = WlW2. \"'w3n+6. We consider w to be made up of three parts, x, y, and z, each of size 6: w = ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The reduction", |
| "sec_num": "3" |
| }, |
| { |
| "text": "Now we begin building the grammar G = (E, V, R, S). We start with the nonterminals V = {S} and the production set R = ~. We add nonterminal W to V for generating arbitrary non-empty substrings of w; thus we need the productions (W-rules) W > wtWlwe, 1 < g < 3n + 6.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "Next we encode the entries of the input matrices A and B in our grammar. We include sets of non-terminals { Ap,q : 1 < p, q < n 2 } and { Bp,q : 1 < p, q < n2}. Then, for every non-zero entry aij in A, we add the production (A-rules) Ai~,j~ > wi~Wwj2+~.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "For every non-zero entry bij in B, we add the production (B-rules) BQ,jl > zoi2+l+6Wzoj2+26.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "We need to represent entries of C, so we create nonterminals {Cp,q : 1 < p, q <_ n 2 } and productions", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "(C-rules) Cp,q > Ap,rBr,q, 1 < p, q, r < n 2.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "Finally, we complete the construction with productions for the start symbol S:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "(S-rules) S > WCp,qW, l <_ p,q < n 2.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "We now prove the following result about the grammar and string we have just described. Proof. Fix i and j. Let us prove the :'only if\" direction first. Thus, suppose c~j = 1. Then there exists a k such that aik = bkj = 1. Figure 1 sketches This claim is essentially trivial, since by the definition of the S-rules, we know that S =~* WCil,jl W. We need only show that nei-w3n+6 ther w~ \"2-1 nor j2+26+1 is the empty string (and hence can be derived by W); since 1 < i2 -1 and j2 + 26 + 1 <__ 3n + 6, the claim holds. Claims 1 and 2 together prove that Cil,jl cderives W j2+26 i2 , as required. 2 Next we prove the \"if\" direction.", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 222, |
| "end": 239, |
| "text": "Figure 1 sketches", |
| "ref_id": "FIGREF1" |
| } |
| ], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "Suppose Cil,j~ c-derives W j2+26 which by definition i2 '", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "means Cil,jl o* W j2+26 Then there must be i2 a derivation resulting from the application of a C-rule as follows:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "Cil,jl 0 Ail,k, Bk,,jl =~* w~. .'2+2ci i2", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "2This proof would have been simpler if we had allowed W to derive the empty string. However, we avoid epsilon-productions in order to facilitate the conversion to Chomsky normal form, discussed later. x y z Figure 1 : Schematic of the derivation process when aik -~ bkj ----1. The substrings derived by Ail,k~", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 207, |
| "end": 215, |
| "text": "Figure 1", |
| "ref_id": "FIGREF1" |
| } |
| ], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "and Bkl,jl lie right next to each other.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "for some k ~. It must be the case that for some ~, Ail,k' =:~* w ~. and Bk',jl 0\" ~ j~+2~ But", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "z2 ~\u00a3+1 \"", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "then we must have the productions Ail,k'", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "wi2Wwt and Bk',jl > ?.l)\u00a3+lWWj2+2 5 with ~ = k\" + ~ for some k\". But we can only have such productions if there exists a number k such that kl = k t, k2 = k n, aik = 1, and bkj ----1; and this implies that cij = 1. \u2022 Examination of the proof reveals that we have also shown the following two corollaries. S-rules. There are at most m 2 A-rules, since we have an A-rule for each non-zero entry in A; similarly, there are at most m 2 B-rules. And lastly, there are (n2) 3 = O(m 2) C-rules. Therefore, our grammar is of size O(m2); since G encodes matrices A and B, it is of optimal size.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "The grammar", |
| "sec_num": "3.1" |
| }, |
| { |
| "text": "We would like our results to be true for the largest class of parsers possible. Since some parsers require the input grammar to be in Chomsky normal form (CNF), we therefore wish to construct a CNF version G ~ of G. However, in order to preserve time bounds, we desire that O(IG'I) = O(]GI), and we also require that Theorem 1 holds for G ~ as well as G.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Chomsky normal form", |
| "sec_num": "3.2" |
| }, |
| { |
| "text": "The standard algorithm for converting CFGs to CNF can yield a quadratic blow-up in the size of the grammar and thus is clearly unsatisfactory for our purposes. However, since G contains no epsilon-productions or unit productions, it is easy to see that we can convert G simply by introducing a small (O(n)) number of nonterminals without changing any cderivations for the Cp,q. Thus, from now on we will simply assume that G is in CNF.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Chomsky normal form", |
| "sec_num": "3.2" |
| }, |
| { |
| "text": "We are now in a position to prove our relation between time bounds for Boolean matrix multiplication and time bounds for CFG parsing.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Time bounds", |
| "sec_num": "3.3" |
| }, |
| { |
| "text": "Theorem 2 Any c-parser P with running time O(T(g)t(N)) on grammars of size g and strings of length N can be converted into a BMM algorithm Mp that runs in time O(max(m 2, T(m2)t(mU3))). In particular, if P takes time O(gN3-e), then l~/Ip runs in time 0(m3-~/3).", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Time bounds", |
| "sec_num": "3.3" |
| }, |
| { |
| "text": "Proof. Me acts as follows. Given two Boolean m x m matrices A and B, it constructs G and w as described above. It feeds G and w to P, which outputs $'c,w-To compute the product matrix C, Me queries for each i and j, 1 < i,j < m, whether Ci~,jl derives wJ ~+2~", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Time bounds", |
| "sec_num": "3.3" |
| }, |
| { |
| "text": "-- -- 't 2", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Time bounds", |
| "sec_num": "3.3" |
| }, |
| { |
| "text": "(we do not need to ask whether Cil,j~ c-derives w' ]J ~+26 because of corollary 1), setting cij appro- The case in which P takes time linear in the grammar size is of the most interest, since in natural language processing applications, the grammar tends to be far larger than the strings to be parsed. Observe that theorem 2 translates the running time of the standard CFG parsers, O(gN3), into the running time of the standard BMM algorithm, O(m3). Also, a cparser with running time O(gN 2\"43) would yield a matrix multiplication algorithm rivalling that of Strassen's, and a c-parser with running time better than O(gN H2) could be converted into a BMM method faster than Coppersmith and Winograd. As per the discussion above, even if such parsers exist, they would in all likelihood not be very practical. Finally, we note that if a lower bound on BMM of the form f~(m 3-a) were found, then we would have an immediate lower bound of ~(N 3-3a) on c-parsers running in time linear in g.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Time bounds", |
| "sec_num": "3.3" |
| }, |
| { |
| "text": "We have shown that fast practical CFG parsing algorithms yield fast practical BMM algorithms. Given that fast practical BMM algorithms are unlikely to exist, we have established a limitation on practical CFG parsing.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Related results and conclusion", |
| "sec_num": "4" |
| }, |
| { |
| "text": "Valiant (personal communication) notes that there is a reduction of m \u00d7 m Boolean matrix multiplication checking to context-free recognition of strings of length m2; this reduction is alluded to in a footnote of a paper by Harrison and Havel (1974) . However, this reduction converts a parser running in time O(Iwl 1\"5) to a BMM checking algorithm running in time O(m 3) (the running time of the standard multiplication method), whereas our result says that sub-cubic practical parsers are quite unlikely; thus, our result is quite a bit stronger. Seiferas (1986) gives a simple proof of N 2", |
| "cite_spans": [ |
| { |
| "start": 223, |
| "end": 248, |
| "text": "Harrison and Havel (1974)", |
| "ref_id": "BIBREF6" |
| }, |
| { |
| "start": 548, |
| "end": 563, |
| "text": "Seiferas (1986)", |
| "ref_id": "BIBREF10" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Related results and conclusion", |
| "sec_num": "4" |
| }, |
| { |
| "text": "an ~t(lo-Q-W) lower bound (originally due to Gallaire (1969) ) for the problem of on-line linear CFL recognition by multitape Turing machines. However, his results concern on-line recognition, which is a harder problem than parsing, and so do not apply to the general offline parsing case. Finally, we recall Valiant's reduction of CFG parsing to boolean matrix multiplication (Valiant, 1975) ; it is rather pleasing to have the reduction cycle completed.", |
| "cite_spans": [ |
| { |
| "start": 45, |
| "end": 60, |
| "text": "Gallaire (1969)", |
| "ref_id": "BIBREF4" |
| }, |
| { |
| "start": 377, |
| "end": 392, |
| "text": "(Valiant, 1975)", |
| "ref_id": "BIBREF13" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Related results and conclusion", |
| "sec_num": "4" |
| } |
| ], |
| "back_matter": [ |
| { |
| "text": "I thank Joshua Goodman, Rebecca Hwa, Jon Kleinberg, and Stuart Shieber for many helpful comments and conversations. Thanks to Les Valiant for pointing out the \"folklore\" reduction. This material is based upon work supported in part by the National Science Foundation under Grant No. IRI-9350192. I also gratefully acknowledge partial support from an NSF Graduate Fellowship and an AT&T GRPW/ALFP grant. Finally, thanks to Giorgio Satta, who mailed me a preprint of his BMM/TAG paper several years ago.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Acknowledgments", |
| "sec_num": "5" |
| } |
| ], |
| "bib_entries": { |
| "BIBREF0": { |
| "ref_id": "b0", |
| "title": "On economical construction of the transitive closure of an oriented graph", |
| "authors": [ |
| { |
| "first": "V", |
| "middle": [ |
| "L" |
| ], |
| "last": "Arlazarov", |
| "suffix": "" |
| }, |
| { |
| "first": "E", |
| "middle": [ |
| "A" |
| ], |
| "last": "Dinic", |
| "suffix": "" |
| }, |
| { |
| "first": "M", |
| "middle": [ |
| "A" |
| ], |
| "last": "Kronrod", |
| "suffix": "" |
| }, |
| { |
| "first": "I", |
| "middle": [ |
| "A" |
| ], |
| "last": "Farad~ev", |
| "suffix": "" |
| } |
| ], |
| "year": 1970, |
| "venue": "Dokl. Akad. Nauk SSSR", |
| "volume": "11", |
| "issue": "", |
| "pages": "1209--1210", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Arlazarov, V. L., E. A. Dinic, M. A. Kronrod, and I. A. Farad~ev. 1970. On economical construc- tion of the transitive closure of an oriented graph. Soviet Math. Dokl., 11:1209-1210. English trans- lation of the Russian article in Dokl. Akad. Nauk SSSR 194 (1970).", |
| "links": null |
| }, |
| "BIBREF1": { |
| "ref_id": "b1", |
| "title": "Matrix multiplication via arithmetic progression", |
| "authors": [ |
| { |
| "first": "Don", |
| "middle": [], |
| "last": "Coppersmith", |
| "suffix": "" |
| }, |
| { |
| "first": "Shmuel", |
| "middle": [], |
| "last": "Winograd", |
| "suffix": "" |
| } |
| ], |
| "year": 1990, |
| "venue": "Special Issue on Computational Algebraic Complexity", |
| "volume": "9", |
| "issue": "3", |
| "pages": "251--280", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Coppersmith, Don and Shmuel Winograd. 1990. Matrix multiplication via arithmetic progression. Journal of Symbolic Computation, 9(3):251-280. Special Issue on Computational Algebraic Com- plexity.", |
| "links": null |
| }, |
| "BIBREF3": { |
| "ref_id": "b3", |
| "title": "An efficient context-free pars-Communications of the A CM", |
| "authors": [], |
| "year": null, |
| "venue": "", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "An efficient context-free pars- Communications of the A CM,", |
| "links": null |
| }, |
| "BIBREF4": { |
| "ref_id": "b4", |
| "title": "Recognition time of contextfree languages by on-line turing machines. Information and Control", |
| "authors": [ |
| { |
| "first": "Herv&", |
| "middle": [], |
| "last": "Gallaire", |
| "suffix": "" |
| } |
| ], |
| "year": 1969, |
| "venue": "", |
| "volume": "15", |
| "issue": "", |
| "pages": "288--295", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Gallaire, Herv& 1969. Recognition time of context- free languages by on-line turing machines. Infor- mation and Control, 15(3):288-295, September.", |
| "links": null |
| }, |
| "BIBREF5": { |
| "ref_id": "b5", |
| "title": "An improved context-free recognizer", |
| "authors": [ |
| { |
| "first": "Susan", |
| "middle": [ |
| "L" |
| ], |
| "last": "Graham", |
| "suffix": "" |
| }, |
| { |
| "first": "A", |
| "middle": [], |
| "last": "Michael", |
| "suffix": "" |
| }, |
| { |
| "first": "Walter", |
| "middle": [ |
| "L" |
| ], |
| "last": "Harrison", |
| "suffix": "" |
| }, |
| { |
| "first": "", |
| "middle": [], |
| "last": "Ruzzo", |
| "suffix": "" |
| } |
| ], |
| "year": 1980, |
| "venue": "A CM Transactions on Programming Languages and Systems", |
| "volume": "2", |
| "issue": "3", |
| "pages": "415--462", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Graham, Susan L., Michael A. Harrison, and Wal- ter L. Ruzzo. 1980. An improved context-free recognizer. A CM Transactions on Programming Languages and Systems, 2(3):415-462.", |
| "links": null |
| }, |
| "BIBREF6": { |
| "ref_id": "b6", |
| "title": "On the parsing of deterministic languages", |
| "authors": [ |
| { |
| "first": "Michael", |
| "middle": [], |
| "last": "Harrison", |
| "suffix": "" |
| }, |
| { |
| "first": "Ivan", |
| "middle": [], |
| "last": "Havel", |
| "suffix": "" |
| } |
| ], |
| "year": 1974, |
| "venue": "Journal of the ACM", |
| "volume": "21", |
| "issue": "4", |
| "pages": "525--548", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Harrison, Michael and Ivan Havel. 1974. On the parsing of deterministic languages. Journal of the ACM, 21(4):525-548, October.", |
| "links": null |
| }, |
| "BIBREF7": { |
| "ref_id": "b7", |
| "title": "An efficient recognition and syntax algorithm for context-free languages", |
| "authors": [ |
| { |
| "first": "Tadao", |
| "middle": [], |
| "last": "Kasami", |
| "suffix": "" |
| } |
| ], |
| "year": 1965, |
| "venue": "", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Kasami, Tadao. 1965. An efficient recognition and syntax algorithm for context-free languages. Sci- entific Report AFCRL-65-758, Air Force Cam- bridge Research Lab, Bedford, MA.", |
| "links": null |
| }, |
| "BIBREF8": { |
| "ref_id": "b8", |
| "title": "Recognition can be harder than parsing", |
| "authors": [ |
| { |
| "first": "Bernard", |
| "middle": [], |
| "last": "Lang", |
| "suffix": "" |
| } |
| ], |
| "year": 1994, |
| "venue": "Computational Intelligence", |
| "volume": "10", |
| "issue": "4", |
| "pages": "486--494", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Lang, Bernard. 1994. Recognition can be harder than parsing. Computational Intelligence, 10(4):486-494, November.", |
| "links": null |
| }, |
| "BIBREF9": { |
| "ref_id": "b9", |
| "title": "Tree-adjoining grammar parsing and boolean matrix multiplication", |
| "authors": [ |
| { |
| "first": "Giorgio", |
| "middle": [], |
| "last": "Satta", |
| "suffix": "" |
| } |
| ], |
| "year": 1994, |
| "venue": "Computational Linguistics", |
| "volume": "20", |
| "issue": "2", |
| "pages": "173--191", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Satta, Giorgio. 1994. Tree-adjoining grammar pars- ing and boolean matrix multiplication. Computa- tional Linguistics, 20(2):173-191, June.", |
| "links": null |
| }, |
| "BIBREF10": { |
| "ref_id": "b10", |
| "title": "A simplified lower bound for context-free-language recognition. Information and Control", |
| "authors": [ |
| { |
| "first": "Joel", |
| "middle": [], |
| "last": "Seiferas", |
| "suffix": "" |
| } |
| ], |
| "year": 1986, |
| "venue": "", |
| "volume": "69", |
| "issue": "", |
| "pages": "255--260", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Seiferas, Joel. 1986. A simplified lower bound for context-free-language recognition. Informa- tion and Control, 69:255-260.", |
| "links": null |
| }, |
| "BIBREF11": { |
| "ref_id": "b11", |
| "title": "Gaussian elimination is not optimal", |
| "authors": [ |
| { |
| "first": "Volker", |
| "middle": [], |
| "last": "Strassen", |
| "suffix": "" |
| } |
| ], |
| "year": 1969, |
| "venue": "Numerische Mathematik", |
| "volume": "14", |
| "issue": "3", |
| "pages": "354--356", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Strassen, Volker. 1969. Gaussian elimination is not optimal. Numerische Mathematik, 14(3):354-356.", |
| "links": null |
| }, |
| "BIBREF12": { |
| "ref_id": "b12", |
| "title": "Handbook of Theoretical Computer Science, volume A", |
| "authors": [ |
| { |
| "first": "Volker", |
| "middle": [], |
| "last": "Strassen", |
| "suffix": "" |
| } |
| ], |
| "year": 1990, |
| "venue": "", |
| "volume": "", |
| "issue": "", |
| "pages": "633--672", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Strassen, Volker. 1990. Algebraic complexity the- ory. In Jan van Leeuwen, editor, Handbook of Theoretical Computer Science, volume A. Elsevier Science Publishers, chapter 11, pages 633-672.", |
| "links": null |
| }, |
| "BIBREF13": { |
| "ref_id": "b13", |
| "title": "General context-free recognition in less than cubic time", |
| "authors": [ |
| { |
| "first": "Leslie", |
| "middle": [ |
| "G" |
| ], |
| "last": "Valiant", |
| "suffix": "" |
| } |
| ], |
| "year": 1975, |
| "venue": "Journal of Computer and System Sciences", |
| "volume": "10", |
| "issue": "", |
| "pages": "308--315", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Valiant, Leslie G. 1975. General context-free recog- nition in less than cubic time. Journal of Com- puter and System Sciences, 10:308-315.", |
| "links": null |
| }, |
| "BIBREF14": { |
| "ref_id": "b14", |
| "title": "Recognition and parsing of context-free languages in time n 3", |
| "authors": [ |
| { |
| "first": "Daniel", |
| "middle": [ |
| "H" |
| ], |
| "last": "Younger", |
| "suffix": "" |
| } |
| ], |
| "year": 1967, |
| "venue": "Information and Control", |
| "volume": "10", |
| "issue": "2", |
| "pages": "189--208", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Younger, Daniel H. 1967. Recognition and parsing of context-free languages in time n 3. Information and Control, 10(2):189-208.", |
| "links": null |
| } |
| }, |
| "ref_entries": { |
| "FIGREF1": { |
| "text": "For 1 < i,j < m, cij = 1 if and only if Cil,jl =:b* j2+2~ Wi 2 Corollary 2 S =~* w if and only if C is not the all-zeroes matrix. Let us now calculate the size of G. V consists of O((n2) 2) = O(m 4/3) nonterminals. R contains O(n) W-rules and O((n2) 2) = O(m 4/3)", |
| "type_str": "figure", |
| "uris": null, |
| "num": null |
| }, |
| "FIGREF2": { |
| "text": "By definition of c-parsers, each such query takes constant time. Let us compute the running time of Me. It takes O(m 2) time to read the input matrices. Since G is of size O(rn 2) and Iwl = O(ml/3), it takes O(m 2) time to build the input to P, which then computes 5rG,w in time O(T(m2)t(ml/3)). Retrieving C takes O(m2). So the total time spent by Mp is O(max(m 2, T(m2)t(mU3))), as was claimed. In the case where T(g) = g and t(N) = N 3-e, Mp has a running time of O(m2(ml/3) a-e) = O(m 2+1-\u00a3/3) = O(m3-e'/3). II", |
| "type_str": "figure", |
| "uris": null, |
| "num": null |
| } |
| } |
| } |
| } |