File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/intro/94/j94-2002_intro.xml
Size: 17,429 bytes
Last Modified: 2025-10-06 14:05:45
<?xml version="1.0" standalone="yes"?> <Paper uid="J94-2002"> <Title>Tree-Adjoining Grammar Parsing and Boolean Matrix Multiplication</Title> <Section position="4" start_page="176" end_page="184" type="intro"> <SectionTitle> 3. Technical Part </SectionTitle> <Paragraph position="0"> In this section the Boolean matrix multiplication problem is related to the tree-adjoining grammar parsing problem, establishing the major result of this paper. A precise specification of the studied reduction is preceded by an informal discussion of the general idea underlying the construction.</Paragraph> <Section position="1" start_page="176" end_page="179" type="sub_section"> <SectionTitle> 3.1 The Basic Approach </SectionTitle> <Paragraph position="0"> Two maps ~ and ~ will be studied in this section. Map ~c establishes a correspondence between the set BMM and a proper subset of TGP containing, in some sense, its most difficult instances. Conversely, map ~ is defined on the set of solutions of all TGP problems in the image of Y', and gives values in the set of Boolean square matrices.</Paragraph> <Paragraph position="1"> Maps ~ and G are defined in such a way that, given any algorithm for the solution of the TGP problem, we can effectively construct an algorithm for the solution of the BMM problem using the commutative diagram shown in Figure 3.</Paragraph> <Paragraph position="2"> 1 I owe this observation to Bernard Lang (personal communication).</Paragraph> <Paragraph position="3"> Computational Linguistics Volume 20, Number 2 multiplication <,4, B> in BMM &quot; C = A x B parsing <G, w> in TGP , Rp Figure 3 Maps ~- and ~ define a commutative diagram with respect to any algorithm for Boolean matrix multiplication and any parsing algorithm for tree-adjoining grammars. Both the BMM and the TGP problems are viewed here as search problems whose solutions are obtained by exploring a search space of elementary combinations. In the case of the BMM problem, the elementary combinations are the combinations of elements of the input matrices. If m is the order of these matrices, the solution of the problem requires the specification of O(m 2) elements of the product matrix, where each element depends upon O(m) elementary combinations (see relation (1)). Therefore the problem involves a search in a space of O(m 3) different combinations. On the other hand, in the TGP problem the elementary combinations are taken to be single applications of the adjunction operation. In parsing a string w of length n according to a tree-adjoining grammar G, we have to construct a parse relation of size O(I G In 4) (see Definition 1), and there are O(n 2) distinguishable combinations in which each element of the relation can be obtained. In the general case then, a number O(I G In 6) of distinguishable combinations are involved in the parsing problem, and we have to perform a search within an abstract space of this size.</Paragraph> <Paragraph position="4"> In order to achieve our result, we then establish a size preserving correspondence between the two search spaces above. There is no way of representing matrices A and B within string w without blowing up the search space associated with the target parsing problem. Our choice will then be to represent the input matrices by means of grammar G, which fixes I GI to a quantity O(m2). This forces the choice of n to a quantity O(m~), obtaining therefore the desired relation I G In 6 = O(1/'/3). The general idea underlying the construction is the following one. Observe that non-null elements aik and bk,j in the input matrices force element cij to value 1 in the product matrix if and only if k = k t. The check of such a condition can be transferred to the computation of an adjunction operation in the target parsing problem using the following encoding method. We fix a positive integer b to a (rounded) quantity m~. Then we encode each index i of the input matrices by means of positive integers il, /2, and i3, such that il is O(b 4) and i2, is are O(b). Condition k = k t above is therefore reduced to the three tests kh = k~, 1 < h < 3, which can be performed independently. The test kl = k~ is precompiled into some auxiliary tree of G; the tests k2 = k~ and</Paragraph> <Paragraph position="6"> &quot;slices&quot; w (h), 1 < h < 6, each slice of length O(b). Map ~- also encodes the input matrices A and B within the target grammar G; it does so by transforming each non-null element in the input matrices into an auxiliary tree of G in the following way.</Paragraph> <Paragraph position="7"> Non-null element aik is mapped into an auxiliary tree &quot;~1 having its root (and foot node)</Paragraph> <Paragraph position="9"> String w is composed of six slices, and auxiliary trees corresponding to non-null elements aik and bk'j derive string pairs (xl, yl} and (x2, y2} matching the slices of w as shown above; integers are used to indicate the position within a single slice of the boundary symbols in strings xl, yl, x2, and y2. The figure depicts the case k = k', resulting in the exact nesting of the two derived trees.</Paragraph> <Paragraph position="10"> labeled by a symbol including integers i1 and kl. Moreover, 3'1 will eventually derive a string pair (xl, yl) with the following property. String xl is the smallest substring of w including the symbol in the /3th position within slice w (1) and the symbol in the k3th position within slice w (2). Furthermore, string yl is the smallest substring of w including the symbol in the (k2 + 1)-th position within slice w (5) and the symbol in the /2th position within slice w (6). This is schematically shown in Figure 4.</Paragraph> <Paragraph position="11"> At the same time 5 r maps non-null element bk,j into an auxiliary tree 3'2 having its root labeled by a symbol including integers k~ and jl. Crucial to our construction, 3`2 will derive a pair of strings (x2~y2> with the following property. String x2 is the smallest substring of w including the symbol in the (k~ + 1)-th position within slice w (2) and the symbol in the j3th position within slice w (3). Furthermore, string y2 is the smallest substring of w including the symbol in the j2th position within slice w (4) and the symbol in the k~th position within slice w (s). Let us call 3'~ and 3,~ the derived trees obtained from 3,1 and 3&quot;2 as above. Observe that k2 = k~ and k3 = k~ if and only if the yields of 3&quot;~ and 3`~ are exactly nested within w; see again Figure 4.</Paragraph> <Paragraph position="12"> To complete the construction of G, map 5 v provides an auxiliary tree 3,3 with the following property. Tree 3,3 can contribute to a sentential derivation of w in G if and only if 3&quot;~ and 3&quot;~ can be adjoined to it. This is in turn possible just in case integer kl in the root of 3&quot;1 and integer k~ in the root of 3`2 coincide, as specified by the adjunction sites in 3'3, and the yields of 3`~ and 3&quot;~ are exactly nested within w. It follows that, by deciding whether 3'3 contributes to a sentential derivation of w, the parser is able to perform the required test k = k'. Finally, index k in its coded form is discarded in the derivation process above, while indices i and j are preserved in such a way that map can eventually recover non-null element Cq by reading off the parse relation.</Paragraph> <Paragraph position="13"> Computational Linguistics Volume 20, Number 2 Table 1 Values off (b) (i) for b = 3 and 1 < i < 15.</Paragraph> <Paragraph position="14"> i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 f(b)(i) 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 f(2b)(i) 1 1 1 2 2 2 3 3 3 1 1 1 2 2 2 f(b)(i) 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 The next section presents a detailed specification of maps ~&quot; and G and proves the above claimed properties. As we will see, the search space defined by the resulting instance of the TAG parsing problem includes the solution of the source matrix multiplication problem.</Paragraph> </Section> <Section position="2" start_page="179" end_page="184" type="sub_section"> <SectionTitle> 3.2 The Two Maps </SectionTitle> <Paragraph position="0"> The goal of this subsection is to establish a mapping between comparisons of matrix indices in Boolean matrix multiplication and instances of the adjunction operation in tree-adjoining grammar parsing. As already mentioned in the previous subsection, this result is achieved by encoding natural numbers using three positive integers. The encoding is then used to chop off matrix indices into smaller numbers that will be processed independently. This is explained in detail in the following.</Paragraph> <Paragraph position="1"> For pairs of integers i and b, let qn(i, b) and rm(i, b) be the quotient and the remainder respectively of the integer division of i by b. We define qn+(i, b) = qn(i, b)+l</Paragraph> <Paragraph position="3"> Let b > I be an integer. We associate with b a functionf (b) defined on the set of positive natural numbers, specified as follows: where</Paragraph> <Paragraph position="5"> Table 1 shows some values off (b) for the case b = 3.</Paragraph> <Paragraph position="6"> Observe that, for i > 1, f(3 b) and f(2 b) give values in the range {1..b}, while f(1 b) can give any positive integer. It is not difficult to see that function fib) establishes a one-to-one correspondence between the set N of positive natural numbers and the set N x {1..b} x {1..b}. In an informal way, we will often refer to value f(1 b) (i) as the most significant digit corresponding to i, and to values f(2 b) (i) and f(3 b) (i) as the least significant digits corresponding to i. In the following, the superscript in fib) will be omitted whenever b can be understood from the context.</Paragraph> <Paragraph position="7"> We are now in a position to define in detail the maps F and G involved in the diagram of Figure 3 discussed in Section 3.1. As a first step, we study map ~- that takes as input an instance of BMM and returns an instance of TGP.</Paragraph> <Paragraph position="9"> Figure 5 Definition of families of auxiliary trees F~ n), n > 1 and 1 < h < 6. Each tree in some class is specified by the values of the integer parameters corresponding to that class. Let n > 1 be an integer. In the following we will refer to sets of terminal symbols VT (&quot;)={dp I' 1Gp_<6(n+1)}, and to sets of nonterminal symbols</Paragraph> <Paragraph position="11"> Based on these sets, Figure 5 defines families of auxiliary trees F~ n), 1 ( h _ 6. For example, an auxiliary tree 7(P, q, r, s, u, v) C 1~ &quot;) will be specified by providing actual values for the integer parameters p, q, r, s, u, and v, consistently with the definitions of sets V(T n) and V(N n). In the following we will also use the initial tree % depicted in Figure 6.</Paragraph> <Paragraph position="12"> The next definition introduces map ~, which is the core component of the proposed reduction. The definition is rather technical: it will be followed by a more intuitive example.</Paragraph> <Paragraph position="13"> Definition 3 Let (A, B) be an instance of BMM, m the order of matrices A and B. Let also n = Lm~/+1 and ~r -- n + 1. A map ~c is specified in such a way that YZ((A, B)) = (G, w), where</Paragraph> <Paragraph position="15"> belong to A(&quot;).</Paragraph> <Paragraph position="16"> In order to have a better understanding of map 9 r and of the idea underlying grammar G and string w, we discuss in the following a simple example, adding more details to the informal discussion presented in Section 3.1.</Paragraph> <Paragraph position="17"> Let us define a Boolean matrix by specifying only its non-null elements. Assume then that an input instance (A, B / of the BMM problem consists of two matrices of forcing element c2,7 in matrix C to value 1; each array element is represented as an arc in a directed graph. Correspondingly, trees 3`1, 3`2, 3'3 and 3'4 in (b) are introduced in G by map ~-. These trees can be composed, using adjunction, with trees in p~3) and r~ 3), in such a way that a derived tree is obtained that matches string w and encodes the indices of c2,7. order m = 64, specified as A = {a2,15}~ B :- {b15,7}.</Paragraph> <Paragraph position="18"> The multiplication of matrices A and B results in matrix C consisting of the only non-null element Ca, 7. As already mentioned in Section 3.1, the multiplication process can be seen as a test for equality performed on the second index of a2~ls and the first index of b15,7; in the following these indices will be called &quot;intermediate&quot; indices. Element c2,7 in the product matrix is forced to value I if this test succeeds, and the intermediate indices are discarded in the process. See Figure 7a for a schematic representation of such an operation.</Paragraph> <Paragraph position="19"> In performing an adjunction operation, two requirements must be satisfied. First, the nonterminal label at the adjunction site must match the nonterminal label at the root (and foot node) of the adjoined tree; and second, adjunction must compose trees in such a way that the derived string is compatible with w. In the proposed reduction, each test for equality performed on some pair of intermediate indices by matrix multiplication is transferred to an adjunction operation by map ~, using as targets the two requirements just described. This is exemplified in the following.</Paragraph> <Paragraph position="20"> Computational Linguistics Volume 20, Number 2 According to Definition 3, we find n = 3 and cr = 4. Map J: then constructs a string w = dld2...d24, which can be thought of as composed of six slices w (h) = 4(h-1)+lW4h, 1 _< h _< 6. Each element in a single slice will be used as a placeholder to record information about matrix indices. Furthermore, map jv exploits functionf (3) (see Table 1) in order to map each non-null element of the input matrices to an auxiliary tree in I~ 3) or F~ 3) (steps (i) and (ii) in Definition 3). More specifically, each index of a non-null element is converted into three digits: the most significative one is encoded as part of the nonterminal symbols, and the two least significative digits are encoded by the terminal symbols in the target tree. Trees &quot;)'1 and &quot;/2 obtained in this way from non-null elements a2,15 and b15,7 respectively have been depicted in Figure 7b. Two additional trees &quot;Y3 E F~ 3) and &quot;Y4 E 1~ 3) have been reported in the figure, that are also added to G by J: (step (iii) in Definition 3).</Paragraph> <Paragraph position="21"> Crucial to our construction, the test on the intermediate indices of elements a2,15 and b15,7 has been reduced to three independent tests involving smaller integers. More precisely, the equality test on the most significative digits obtained from the intermediate indices has been transferred to the requirement on the matching of the nonterminal labels of the nodes involved in the adjunction. In fact, &quot;Yl and &quot;Y2 can be adjoined into &quot;)/3 just in case such a test is satisfied. At the same time, the equality test on the least significative digits obtained from the intermediate indices has been transferred to the requirement on the matching of the derived string with w. In fact, after the adjunction of &quot;/1 and &quot;/2 into &quot;)'3 takes place, no terminal symbol can intervene between the internal boundaries of the yield of &quot;Y1 and the external boundaries of the yield of &quot;Y2 in slices w (2) and w (s) (see again Figure 7b). Then &quot;Y3 can participate in a sentential derivation of w just in case all three equality tests above are simultaneously satisfied.</Paragraph> <Paragraph position="22"> The choice of the order of I wl has been dictated by general considerations on the size of the search spaces associated with the two problems at hand, as already discussed in Section 3.1. As a note, we observe that slices w (2) and w (s) are used in the above construction to pair together least significative digits obtained from intermediate indices. The fact that these indices have range in {1..n} forces the choice of the length of these slices to ~r = n + 1; the example in Figure 7 actually uses the (n + 1)-th symbol of w (2). For uniformity, this value has then been extended to all other slices, fixing I wl to 6or.</Paragraph> <Paragraph position="23"> In Lemma 1 below we will state in a more precise way the above arguments, and we will also show how derivations of the kind outlined above are the only derivations in G than can match string w, proving therefore the correctness of the reduction. To complete the diagram of Figure 3, we now turn to the specification of map ~.</Paragraph> <Paragraph position="24"> Definition 4 Let/G, w) be an instance of TGP in the image of map ~-, and let m, n, and cr be as in Definition 3. Let also Rp be the parse relation that solves instance /G, w). A map G is specified in such a way that G(Rp) = C, C a Boolean matrix of order m, and element cij is non-null if and only if Rp('y, p, q, r, s) holds for an auxiliary tree ~/(u, v) E E~ n), where</Paragraph> <Paragraph position="26"> In the above definition, functionf (n) is used to retrieve the indices of non-null elements</Paragraph> <Paragraph position="28"/> </Section> </Section> class="xml-element"></Paper>