{ "paper_id": "P91-1041", "header": { "generated_with": "S2ORC 1.0.0", "date_generated": "2023-01-19T09:03:36.418521Z" }, "title": "Quasi-Destructive Graph Unification", "authors": [ { "first": "Hideto", "middle": [], "last": "Tomabechi", "suffix": "", "affiliation": { "laboratory": "Research Laboratories* tomabech+@cs.cmu.edu Seika-cho", "institution": "Carnegie Mellon University ATR Interpreting Telephony", "location": { "addrLine": "109 EDSH", "postCode": "15213-3890, 619-02", "settlement": "Pittsburgh, Sorakugun", "region": "PA, Kyoto", "country": "JAPAN" } }, "email": "" } ], "year": "", "venue": null, "identifiers": {}, "abstract": "Graph unification is the most expensive part of unification-based grammar parsing. It often takes over 90% of the total parsing time of a sentence. We focus on two speed-up elements in the design of unification algorithms: 1) elimination of excessive copying by only copying successful unifications, 2) Finding unification failures as soon as possible. We have developed a scheme to attain these two elements without expensive overhead through temporarily modifying graphs during unification to eliminate copying during unification. We found that parsing relatively long sentences (requiring about 500 top-level unifications during a parse) using our algorithm is approximately twice as fast as parsing the same sentences using Wroblewski's algorithm.", "pdf_parse": { "paper_id": "P91-1041", "_pdf_hash": "", "abstract": [ { "text": "Graph unification is the most expensive part of unification-based grammar parsing. It often takes over 90% of the total parsing time of a sentence. We focus on two speed-up elements in the design of unification algorithms: 1) elimination of excessive copying by only copying successful unifications, 2) Finding unification failures as soon as possible. We have developed a scheme to attain these two elements without expensive overhead through temporarily modifying graphs during unification to eliminate copying during unification. We found that parsing relatively long sentences (requiring about 500 top-level unifications during a parse) using our algorithm is approximately twice as fast as parsing the same sentences using Wroblewski's algorithm.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Abstract", "sec_num": null } ], "body_text": [ { "text": "Graph unification is the most expensive part of unification-based grammar parsing systems. For example, in the three types of parsing systems currently used at ATR ], all of which use graph unification algorithms based on [Wroblewski, 1987] , unification operations consume 85 to 90 percent of the total cpu time devoted to a parse. 2 The number of unification operations per sentence tends to grow as the grammar gets larger and more complicated. An unavoidable paradox is that when the natural language system gets larger and the coverage of linguistic phenomena increases the writers of natural language grammars tend to rely more on deeper and more complex path equations (cycles and frequent reentrancy) to lessen the complexity of writing the grammar. As a result, we have seen that the number of unification operations increases rapidly as the coverage of the grammar grows in contrast to the parsing algorithm itself which does not seem to *Visiting Research Scientist. Local email address: tomabech%al~-la.al~.co.jp@ uunet.UU.NET.", "cite_spans": [ { "start": 222, "end": 240, "text": "[Wroblewski, 1987]", "ref_id": "BIBREF6" } ], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "1The three parsing systems are based on: 1. Earley's algorithm, 2. active chartparsing, 3. generalized LR parsing.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "2In the large-scale HPSG-based spoken Japanese analysis system developed at ATR, sometimes 98 percent of the elapsed time is devoted to graph unification ([Kogure, 1990] ). grow so quickly. Thus, it makes sense to speed up the unification operations to improve the total speed performance of the natural language systems.", "cite_spans": [ { "start": 154, "end": 169, "text": "([Kogure, 1990]", "ref_id": "BIBREF4" } ], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Our original unification algorithm was based on [Wroblewskl, 1987] which was chosen in 1988 as the then fastest algorithm available for our application (HPSG based unification grammar, three types of parsers (Earley, Tomita-LR, and active chart), unification with variables and cycles 3 combined with Kasper's ([Kasper, 1987] ) scheme for handling disjunctions. In designing the graph unification algorithm, we have made the following observation which influenced the basic design of the new algorithm described in this paper:", "cite_spans": [ { "start": 48, "end": 66, "text": "[Wroblewskl, 1987]", "ref_id": null }, { "start": 301, "end": 325, "text": "Kasper's ([Kasper, 1987]", "ref_id": "BIBREF3" } ], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Unification does not always succeed.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "As we will see from the data presented in a later section, when our parsing system operates with a relatively small grammar, about 60 percent of the unifications attempted during a successful parse result in failure. If a unification falls, any computation performed and memory consumed during the unification is wasted. As the grammar size increases, the number of unification failures for each successful parse increases 4. Without completely rewriting the grammar and the parser, it seems difficult to shift any significant amount of the computational burden to the parser in order to reduce the number of unification failures 5.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Another problem that we would like to address in our design, which seems to be well documented in the existing literature is that:", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Copying is an expensive operation.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "The copying of a node is a heavy burden to the parsing system. [Wroblewski, 1987] calls it a \"computational sink\". Copying is expensive in two ways: 1) it takes time; 2) it takes space. Copying takes time and space essentially because the area in the random access memory needs to be dynamically allocated which is an expensive operation. [Godden, 1990] calculates the computation time cost of copying to be about 67 per-3Please refer to [Kogure, 1989] for trivial time modification of Wroblewski's algorithm to handle cycles.", "cite_spans": [ { "start": 63, "end": 81, "text": "[Wroblewski, 1987]", "ref_id": "BIBREF6" }, { "start": 339, "end": 353, "text": "[Godden, 1990]", "ref_id": "BIBREF0" }, { "start": 438, "end": 452, "text": "[Kogure, 1989]", "ref_id": "BIBREF4" } ], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "4We estimate over 80% of unifications to be failures in our large-scale speech-to-speech translation system under development.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "5Of course, whether that will improve the overall performance is another question. cent of the total parsing time in his TIME parsing system. This time/space burden of copying is non-trivial when we consider the fact that creation of unnecessary copies will eventually trigger garbage collections more often (in a Lisp environment) which will also slow down the overall performance of the parsing system. In general, parsing systems are always short of memory space (such as large LR tables of Tomita-LR parsers and expan~ng tables and charts of Farley and active chart parsers\"), and the marginal addition or subtraction of the amount of memory space consumed by other parts of the system often has critical effects on the performance of these systems.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Considering the aforementioned problems, we propose the following principles to be the desirable conditions for a fast graph unification algorithm:", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "\u2022 Copying should be performed only for successful unifications.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "\u2022 Unification failures should be found as soon as possible.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "By way of definition we would like to categorize excessive copying of dags into Over Copying and Early Copying. Our definition of over copying is the same as Wroblewski's; however, our definition of early copying is slightly different.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "\u2022 Over Copying: Two dags are created in order to create one new dag. -This typically happens when copies of two input dags are created prior to a destructive unification operation to build one new dag. ([Godden, 1990] calls such a unification: Eager Unification.). When two arcs point to the same node, over copying is often unavoidable with incremental copying schemes. \u2022 Early Copying: Copies are created prior to the failure of unification so that copies created since the beginning of the unification up to the point of failure are wasted.", "cite_spans": [ { "start": 202, "end": 217, "text": "([Godden, 1990]", "ref_id": "BIBREF0" } ], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Wroblewski defines Early Copying as follows: \"The argument dags are copied before unification started. If the unification falls then some of the copying is wasted effort\" and restricts early copying to cases that only apply to copies that are created prior to a unification.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Restricting early copying to copies that are made prior to a unification leaves a number of wasted copies that are created during a unification up to the point of failure to be uncovered by either of the above definitions for excessive copying. We would like Early Copying to mean all copies that are wasted due to a unification failure whether these copies are created before or during the actual unification operations.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "Incremental copying has been accepted as an effective method of minimizing over copying and eliminat-6For example, our phoneme-based generalized LR parser for speech input is always running on a swapping space because the LR table is too big.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "ing early copying as defined by Wroblewski. However, while being effective in minimizing over copying (it over copies only in some cases of convergent arcs into one node), incremental copying is ineffective in eliminating early copying as we define it. 7 Incremental copying is ineffective in eliminating early copying because when a gra_ph unification algorithm recurses for shared arcs (i.e. the arcs with labels that exist in both input graphs), each created unification operation recursing into each shared arc is independent of other recursive calls into other arcs. In other words, the recursive calls into shared arcs are non-deterministic and there is no way for one particular recursion into a shared arc to know the result of future recursions into other shared arcs. Thus even if a particular recursion into one arc succeeds (with minimum over copying and no early copying in Wroblewski's sense), other arcs may eventually fail and thus the copies that are created in the successful arcs are all wasted. We consider it a drawback of incremental copying schemes that copies that are incrementally created up to the point of failure get wasted. This problem will be particularly felt when we consider parallel implementations of incremental copying algorithms. Because each recursion into shared arcs is non-deterministic,parallel processes can be created to work concurrently on all arcs. In each of the parallelly created processes for each shared arc, another recursion may take place creating more parallel processes. While some parallel recursive call into some arc may take time (due to a large number of subarcs, etc.) another non-deterministic call to other arcs may proceed deeper and deeper creating a large number of parallel processes. In the meantime, copies are incrementally created at different depths of subgraphs as long as the subgraphs of each of them are unified successfully. This way, when a failure is finally detected at some deep location in some subgraph, other numerous processes may have created a large number of copies that are wasted. Thus, early copying will be a significant problem when we consider the possibility of parallelizing the unification algorithms as well.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Motivation", "sec_num": "1." }, { "text": "We would like to introduce an algorithm which addresses the criteria for fast unification discussed in the previous sections. It also handles cycles without over copying (without any additional schemes such as those introduced by [Kogure, 1989] ).", "cite_spans": [ { "start": 230, "end": 244, "text": "[Kogure, 1989]", "ref_id": "BIBREF4" } ], "ref_spans": [], "eq_spans": [], "section": "Our Scheme", "sec_num": "2." }, { "text": "As a data structure, a node is represented with eight fields: type, arc-list, comp-arc-list, forward, copy, comp-arc-mark, forward-mark, and copy-mark. Although this number may seem high for a graph node data structure, the amount of memory consumed is not significantly different from that consumed by other 7'Early copying' will henceforth be used to refer to early copying as defined by us. algorithms. Type can be represented by three bits; comp-arc-mark, forward-mark, and copy-mark can be represented by short integers (i.e. fixnums); and comparc-list (just like arc-lis0 is a mere collection of pointers to memory locations. Thus this additional information is trivial in terms of memory cells consumed and because of this dam structure the unification algorithm itself can remain simple. ", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Our Scheme", "sec_num": "2." }, { "text": "The representation for an arc is no different from that of other unification algorithms. Each arc has two fields for 'label' and 'value'. 'Label' is an atomic symbol which labels the arc, and 'value' is a pointer to a node.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "The central notion of our algorithm is the dependency of the representational content on the global timing clock (or the global counter for the current generation of unification algorithms). This scheme was used in [Wroblewski, 1987] to invalidate the copy field of a node after one unification by incrementing a global counter. This is an extremely cheap operation but has the power to invalidate the copy fields of all nodes in the system simultaneously. In our algorithm, this dependency of the content of fields on global timing is adopted for arc lists, forwarding pointers, and copy pointers. Thus any modification made, such as adding forwarding links, copy links or arcs during one top-level unification (unify0) to any node in memory can be invalidated by one increment operation on the global timing counter. During unification (in unifyl) and copying after a successful unification, the global timing ID for a specific field can be checked by comparing the content of mark fields with the global counter value and if they match then the content is respected; if not it is simply ignored. Thus the whole operation is a trivial addition to the original destructive unification algorithm (Pereira's and Wroblewski's unifyl) .", "cite_spans": [ { "start": 215, "end": 233, "text": "[Wroblewski, 1987]", "ref_id": "BIBREF6" }, { "start": 1196, "end": 1231, "text": "(Pereira's and Wroblewski's unifyl)", "ref_id": null } ], "ref_spans": [], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "We have two kinds of arc lists 1) arc-list and comp-arc-list. Arc-list contains the arcs that are permanent (i.e., usual graph arcs) and compare-list contains arcs that are only valid during one graph unification operation. We also have two kinds of forwarding links, i.e., permanent and temporary. A permanent forwarding link is the usual forwarding link found in other algorithms ( [Pereira, 1985] , [Wroblewski, 1987] , etc). Temporary forwarding links are links that are only valid during one unification. The currency of the temporary links is determined by matching the content of the mark field for the links with the global counter and if they match then the content of this field is respected 8. As in [Pereira, 1985] , we have three types of nodes: 1) :atomic, 2) :bottom 9, and 3) :complex. :atomic type nodes represent atomic symbol values (such as Noun), :bottom type nodes are variables and :complex type nodes are nodes that have arcs coming out of them. Arcs are stored in the arc-list field. The atomic value is also stored in the arc-list if the node type is :atomic. :bottom nodes succeed in unifying with any nodes and the result of unification takes the type and the value of the node that the :bottom node was unified with. :atomic nodes succeed in unifying with :bottom nodes or :atomic nodes with the same value (stored in the arc-lis0. Unification of an :atomic node with a :complex node immediately fails. :complex nodes succeed in unifying with :bottom nodes or with :complex nodes whose subgraphs all unify. Arc values are always nodes and never symbolic values because the :atomic and :bottom nodes may be pointed to by multiple arcs (just as in structure sharing of :complex nodes) depending on grammar constraints, and we do not want arcs to contain terminal atomic values. Figure 2 is the central quasi-destructive graph unification algorithm and Figure 3 shows the algorithm for copying nodes and arcs (called by unify0) while respecting the contents of comp-arc-lists.", "cite_spans": [ { "start": 384, "end": 399, "text": "[Pereira, 1985]", "ref_id": "BIBREF5" }, { "start": 402, "end": 420, "text": "[Wroblewski, 1987]", "ref_id": "BIBREF6" }, { "start": 711, "end": 726, "text": "[Pereira, 1985]", "ref_id": "BIBREF5" } ], "ref_spans": [ { "start": 1805, "end": 1813, "text": "Figure 2", "ref_id": null }, { "start": 1879, "end": 1887, "text": "Figure 3", "ref_id": null } ], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "The functions Complementarcs(dg 1,dg2) and Intersectarcs(dgl,dg2) are similar to Wroblewski's algorithm and return the set-difference (the arcs with labels that exist in dgl but not in rig2) and intersection (the arcs with labels that exist both in dgl and dg2) respectively. During the set-difference and setintersection operations, the content of comp-arc-lists are respected as parts of arc lists if the comp-arcmarks match the current value of the global timing counter. Dereference-dg(dg) recursively traverses the forwarding link to return the forwarded node. In doing so, it checks the forward-mark of the node and if the forward-mark value is 9 (9 represents a permanent forwarding link) or its value matches the current 8We do not have a separate field for temporary forwarding links; instead, we designate the integer value 9 to represent a permanent forwarding link. We start incrementing the global counter from 10 so whenever the forward-mark is not 9 the integer value must equal the global counter value to respect the forwarding link.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "9Bottom is called leaf in Pereira's algorithm.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "value of *unify-global-counter*, then the function returns the forwarded node; otherwise it simply returns the input node. Forward(dgl, dg2, :forward-type) puts (the pointer to) dg2 in the forward field of dgl. If the keyword in the function call is :temporary, the current value of the *unify-global-counter* is written in the forward-mark field of dgl. If the keyword is :permanent, 9 is written in the forward-mark field of dgl. Our algorithm itself does not require any permanent forwarding; however, the functionality is added because the grammar reader module that reads the path equation specifications into dg feature-structures uses permanent forwarding to merge the additional grammatical specifications into a graph structure 1\u00b0. The temporary forwarding links are necessary to handle reentrancy and cycles. As soon as unification (at any level of recursion through shared arcs) succeeds, a temporary forwarding link is made from dg2 to dgl (dgl to dg2 if dgl is of type :bottom). Thus, during unification, a node already unified by other recursive calls to unifyl within the same unify0 call has a temporary forwarding link from dg2 to dgl (or dgl to dg2). As a result, if this node becomes an input argument node, dereferencing the node causes dgl and dg2 to become the same node and unification immediately succeeds. Thus a subgraph below an already unified node will not be checked more than once even if an argument graph has a cycle. Also, during copying done subsequently to a successful unification, two ares converging into the same node will not cause over copying simply because if a node already has a copy then the copy is returned. For example, as a case that may cause over copies in other schemes for dg2 convergent arcs, let us consider the case when the destination node has a corresponding node in dgl and only one of the convergent arcs has a corresponding are in dgl. This destination node is already temporarily forwarded to the node in dgl (since the unification check was successful prior to copying). Once a copy is created for the corresponding dgl node and recorded in the copy field of dgl, every time a convergent arc in dg2 that needs to be copied points to its destination node, dereferencing the node returns the corresponding node in dgl and since a copy of it already exists, this copy is returned. Thus no duplicate copy is created H.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "roWe have been using Wroblewski's algorithm for the unification part of the parser and thus usage of (permanent) forwarding links is adopted by the grammar reader module to convert path equations to graphs. For example, permanent forwarding is done when a :bottom node is to be merged with other nodes.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "nCopying of dg2 ares happens for arcs that exist in dg2 but not in dgl (i.e., Complementarcs(dg2,dgl)). Such arcs are pushed to the cornp-arc-list of dgl during unify1 and are copied into the are-list of the copy during subsequent copying. If there is a cycle or a convergence in arcs in dgl or in ares in dg2 that do not have corresponding arcs in dg 1, then the mechanism is even simpler than the one discussed here. A copy is made once, and the same copy is simply returned FUNCTION copy-arc-and-comp-arcs(input-arc); label ,---input-arc.label; value ,--copy-dg-with-comp-arcs(input-are.value); return a new arc with label and value; END; Figure 4 shows a simple example of quasidestructive graph unification with dg2 convergent arcs. The round nodes indicate atomic nodes and the rectangular nodes indicate bottom (variable) nodes. First, top-level unifyl finds that each of the input graphs has arc-a and arc-b (shared). Then unifyl is recursively called. At step two, the recursion into arc-a locally succeeds, and a temporary forwarding link with timestamp(n) is made from node [-]2 to node s. At the third step (recursion into arc-b), by the previous forwarding, node f12 already has the value s (by dereferencing). Then this unification returns a success and a temporary forwarding link with time-stamp(n) is created from an immediate return to unify.dg.", "cite_spans": [], "ref_spans": [ { "start": 642, "end": 650, "text": "Figure 4", "ref_id": null } ], "eq_spans": [], "section": "Figure 1: Node and Arc Structures", "sec_num": null }, { "text": "17I.e., the existing copy of the node.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 3: Node and Arc Copying Functions", "sec_num": null }, { "text": "lSCreates an empty node structure.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Figure 3: Node and Arc Copying Functions", "sec_num": null }, { "text": "node [-] 1 to node s. At the fourth step, since all recursive unifications (unifyls) into shared arcs succeeded, top-level unifyl creates a temporary forwarding link with time-stamp(n) from dag2's root node to dagl's root node, and sets arc-c (new) into comp-arc-list of dagl and returns success ('*T*). At the fifth step, a copy of dagl is created respecting the content of comparc-list and dereferencing the valid forward links. This copy is returned as a result of unification. At the last step (step six), the global timing counter is incremented (n =:, n+ 1). After this operation, temporary forwarding links and comp-arc-lists with time-stamp (< n+l) will be ignored. Therefore, the original dagl and dag2 are recovered in a constant time without a costly reversing operations. (Also, note that recursions into shared-arcs can be done in any order producing the same result). As we just saw, the algorithm itself is simple. The basic control structure of the unification is similar to Pereira's and Wroblewski's unifyl. The essential difference between our unifyl and the previous ones is that our unifyl is non-destructive. It is because the complementarcs(dg2,dgl) are set to the comp-arc-list of dgl and not into the are-list of dgl. Thus, as soon as we increment the global counter, the changes made to dgl (i.e., addition of complement arcs into compare-list) vanish. As long as the comp-arc-mark value matches that of the global counter the content of the comp-arc-list can be considered a part of arc-list and therefore, dgl is the result of unification. Hence the name quasi-destructive graph unification. In order to create a copy for subsequent use we only need to make a copy of dgl before we increment the global counter while respecting the content of the comp-arc-list of dgl.", "cite_spans": [ { "start": 5, "end": 8, "text": "[-]", "ref_id": null } ], "ref_spans": [], "eq_spans": [], "section": "Figure 3: Node and Arc Copying Functions", "sec_num": null }, { "text": "Thus instead of calling other unification functions (such as unify2 of Wroblewski) for incrementally ereating a copy node during a unification, we only need to create a copy after unification. Thus, if unification fails no copies are made at all (as in [Karttunen, 1986] 's scheme). Because unification that recurses into shared ares carries no burden of incremental copying (i.e., it simply checks if nodes are compatible), as the depth of unification increases (i.e., the graph gets larger) the speed-up of our method should get conspicuous if a unification eventually fails. If all unifications during a parse are going to be successful, our algorithm should be as fast as or slightly slower than Wroblewski's algorithm 19. Since a parse that does not fail on a single unification is unrealistic, the gain from our scheme should depend on the amount of unification failures that occur during a unification. As the number of failures per parse increases and the graphs that failed get larger, the speed-up from our algorithm should become more apparent. Therefore, the characteristics of our algorithm seem desirable. In the next section, we will see the actual results of experiments which compare our unification algorithm to Wroblewski's algorithm (slightly modified to handle variables and cycles that are required by our HPSG based grammar). Table 1 shows the results of our experiments using an HPSG-based Japanese grammar developed at ATR for a conference registration telephone dialogue domain.", "cite_spans": [ { "start": 253, "end": 270, "text": "[Karttunen, 1986]", "ref_id": "BIBREF1" } ], "ref_spans": [ { "start": 1349, "end": 1356, "text": "Table 1", "ref_id": "TABREF3" } ], "eq_spans": [], "section": "Figure 3: Node and Arc Copying Functions", "sec_num": null }, { "text": "19h may be slightly slower becauseour unification recurses twice on a graph: once to unify and once to copy, whereas in incremental unification schemes copying is performed during the same recursion as unifying. Additional bookkeeping for incremental copying and an additional set-difference operation (i.e, complementarcs(dgl,dg2)) during unify2 may offset this, however. 'Unifs' represents the total number of unifications during a parse (the number of calls to the top-level 'unifydg', and not 'unifyl'). 'USrate' represents the ratio of successful unifications to the total number of unifications. We parsed each sentence three times on a Symbolics 3620 using both unification methods and took the shortest elapsed time for both methods ('T' represents our scheme, 'W' represents Wroblewski's algorithm with a modification to handle cycles and variables2\u00b0). Data structures are the same for both unification algorithms (except for additional fields for a node in our algorithm, i.e., comp-arc-list, comp-arcmark, and forward-mark). Same functions are used to interface with Earley's parser and the same subfunctions are used wherever possible (such as creation and access of arcs) to minimize the differences that are not purely algorithmic. 'Number of copies' represents the number of nodes created during each parse (and does not include the number of arc structures that are created during a parse). 'Number of conses' represents the amount of structure words consed during a parse. This number represents the real comparison of the amount of space being consumed by each unification algorithm 0ncluding added fields for nodes in our algorithm and arcs that are created in both algorithms).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Experiments", "sec_num": "3." }, { "text": "We used Earley's parsing algorithm for the experiment. The Japanese grammar is based on HPSG analysis ([Pollard and Sag, 1987] ) covering phenomena such as coordination, case adjunction, adjuncts, control, slash categories, zero-pronouns, interrogatives, WH constructs, and some pragmatics (speaker, hearer relations, politeness, etc.) ([Yoshimoto and Kogure, 1989] ). The grammar covers many of the important linguistic phenomena in conversational Japanese. The grammar graphs which are converted from the path equations contain 2324 nodes. We used 16 sentences from a sample telephone conversation dialog which range from very short sentences (one word, i.e., iie 'no') to relatively long ones (such as soredehakochirakarasochiranitourokuyoushiwoookuriitashimasu \" In that case, we [speaker] will send you [hearer] the registration form.'). Thus, the number of (top-level) unifications per sentence varied widely (from 6 to over 500).", "cite_spans": [ { "start": 102, "end": 126, "text": "([Pollard and Sag, 1987]", "ref_id": null }, { "start": 336, "end": 365, "text": "([Yoshimoto and Kogure, 1989]", "ref_id": null } ], "ref_spans": [], "eq_spans": [], "section": "Experiments", "sec_num": "3." }, { "text": "~Cycles can be handled in Wroblewski's algorithm by checking whether an arc with the same label already exists when arcs are added to a node. And ff such an arc already exists, we destructively unify the node which is the destination of the existing arc with the node which is the destination of the arc being added. If such an arc does not exist, we simply add the arc. ([Kogure, 1989] ). Thus, cycles can be handled very cheaply in Wroblewski's algorithm. Handling variables in Wroblewski's algorithm is basically the same as in our algorithm (i.e., Pereira's scheme), and the addition of this functionality can be ignored in terms of comparison to our algorithm. Our algorithm does not require any additional scheme to handle cycles in input dgs. ", "cite_spans": [ { "start": 371, "end": 386, "text": "([Kogure, 1989]", "ref_id": "BIBREF4" } ], "ref_spans": [], "eq_spans": [], "section": "Experiments", "sec_num": "3." }, { "text": "The control structure of our algorithm is identical to that of [Pereira, 1985] . However, instead of storing changes to the argument (lags in the environment we store the changes in the (lags themselves nondestructively. Because we do not use the environment, the log(d) overhead (where d is the number of nodes in a dag) associated with Pereira's scheme that is required during node access (to assemble the whole dag from the skeleton and the updates in the environment) is avoided in our scheme. We share the principle of storing changes in a restorable way with [Karttunen, 1986] 's reversible unification and copy graphs only after a successful unification. Karttunen originally introduced this scheme in order to replace the less efficient structure-sharing implementations ( [Pereira, 1985] , [Karttunen and Kay, 1985] ). In Karttunen's method 21, whenever a destructive change is about to be made, the attribute value pairs 22 stored in the body of the node are saved into an array. The dag node structure itself is also saved in another array. These values are restored after the top level unification is completed. (A copy is made prior to the restoration operation if the unification was a successful one.) The difference between Karttunen's method and ours is that in our algorithm, one increment to the global counter can invalidate all the changes made to nodes, while in Karttunen's algorithm each node in the entire argument graph that has been destructively modified must be restored separately by retrieving the attribute-values saved in an 21The discussion ofKartunnen's method is based on the D-PATR implementation on Xerox 1100 machines ( [Karttunen, 1986] ). ~'Le., arc structures: 'label' and 'value' pairs in our vocabulary.", "cite_spans": [ { "start": 63, "end": 78, "text": "[Pereira, 1985]", "ref_id": "BIBREF5" }, { "start": 565, "end": 582, "text": "[Karttunen, 1986]", "ref_id": "BIBREF1" }, { "start": 781, "end": 796, "text": "[Pereira, 1985]", "ref_id": "BIBREF5" }, { "start": 799, "end": 824, "text": "[Karttunen and Kay, 1985]", "ref_id": "BIBREF2" }, { "start": 1659, "end": 1676, "text": "[Karttunen, 1986]", "ref_id": "BIBREF1" } ], "ref_spans": [], "eq_spans": [], "section": "Discussion: Comparison to Other Approaches", "sec_num": "4." }, { "text": "array and resetting the values into the dag structure skeletons saved in another array. In both Karttunen's and our algorithm, there will be a non-destructive (reversible, and quasi-destructive) saving of intersection arcs that may be wasted when a subgraph of a particular node successfully unifies but the final unification fails due to a failure in some other part of the argument graphs. This is not a problem in our method because the temporary change made to a node is performed as pushing pointers into already existing structures (nodes) and it does not require entirely new structures to be created and dynamically allocated memory (which was necessary for the copy (create-node) operation), z3 [Godden, 1990 ] presents a method of using lazy evaluation in unification which seems to be one SUCC~sful actualization of [Karttunen and Kay, 1985] 's lazy evaluation idea. One question about lazy evaluation is that the efficiency of lazy evaluation varies depending upon the particular hardware and programming language environment. For example, in CommonLisp, to attain a lazy evalaa_tion, as soon as a function is delayed, a closure (or a structure) needs to be created receiving a dynamic allocation of memory Oust as in creating a copy node). Thus, there is a shift of memory and associated computation consumed from making copies to making closures. In terms of memory cells saved, although the lazy scheme may reduce the total number of copies created, if we consider the memory consumed to create closures, the saving may be significantly canceled. In terms of speed, since delayed evaluation requires additional bookkeeping, how schemes such as the one introduced by [Godden, 1990] would compare with nonlazy incremental copying schemes is an open question. Unfortunately Godden offers a comparison of his algo-Z3Although, in Karttunen's method it may become rather expensive ff the arrays require resizing during the saving operation of the subgraphs. rithm with one that uses a full copying method (i.e. his Eager Copying) which is already significantly slower than Wroblewski's algorithm. However, no comparison is offered with prevailing unification schemes such as Wroblewski's. With the complexity for lazy evaluation and the memory consumed for delayed closures added, it is hard to estimate whether lazy unification runs considerably faster than Wroblewski's incremental copying scheme, ~", "cite_spans": [ { "start": 704, "end": 717, "text": "[Godden, 1990", "ref_id": "BIBREF0" }, { "start": 827, "end": 852, "text": "[Karttunen and Kay, 1985]", "ref_id": "BIBREF2" }, { "start": 1681, "end": 1695, "text": "[Godden, 1990]", "ref_id": "BIBREF0" } ], "ref_spans": [], "eq_spans": [], "section": "Discussion: Comparison to Other Approaches", "sec_num": "4." }, { "text": "The algorithm introduced in this paper runs significantly faster than Wroblewski's algorithm using Earley's parser and an HPSG based grammar developed at ATR. The gain comes from the fact that our algorithm does not create any over copies or early copies. In Wroblewski's algorithm, although over copies are essentially avoided, early copies (by our definition) are a significant problem because about 60 percent of unifications result in failure in a successful parse in our sample parses. The additional set-difference operation required for incremental copying during unify2 may also be contributing to the slower speed of Wroblewski's algorithm. Given that our sample grammar is relatively small, we would expect that the difference in the performance between the incremental copying schemes and ours will expand as the grammar size increases and both the number of failures ~ and the size of the wasted subgraphs of failed unifications become larger. Since our algorithm is essentially parallel, patallelization is one logical choice to pursue further speedup. Parallel processes can be continuously created as unifyl reeurses deeper and deeper without creating any copies by simply looking for a possible failure of the unification (and preparing for successive copying in ease unification succeeds). So far, we have completed a preliminary implementation on a shared memory parallel hardware with about 75 percent of effective parallelization rate. With the simplicity of our algorithm and the ease of implementing it (compared to both incremental copying schemes and lazy schemes), combined with the demonstrated speed of the algorithm, the algorithm could be a viable alternative to existing unification algorithms used in current ~That is, unless some new scheme for reducing excessive copying is introduced such as scucture-sharing of an unchanged shared-forest ([Kogure, 1990] ). Even then, our criticism of the cost of delaying evaluation would still be valid. Also, although different in methodology from the way suggested by Kogure for Wroblewski's algorithm, it is possible to at~in structure-sharing of an unchanged forest in our scheme as well. We have already developed a preliminary version of such a scheme which is not discussed in this paper.", "cite_spans": [ { "start": 1873, "end": 1888, "text": "([Kogure, 1990]", "ref_id": "BIBREF4" } ], "ref_spans": [], "eq_spans": [], "section": "Conclusion", "sec_num": "5." }, { "text": "Z~For example, in our large-scale speech-to-speech translation system under development, the USrate is estimated to be under 20%, i.e., over 80% of unifications are estimated to be failures. natural language systems.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Conclusion", "sec_num": "5." }, { "text": "The author would like to thank Akira Kurematsu, Tsuyoshi Morimoto, Hitoshi Iida, Osamu Furuse, Masaaki Nagata, Toshiyuki Takezawa and other members of ATR and Masaru Tomita and Jaime Carbonell at CMU. Thanks are also due to Margalit Zabludowski and Hiroaki Kitano for comments on the final version of this paper and Takako Fujioka for assistance in implementing the parallel version of the algorithm.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "ACKNOWLEDGMENTS", "sec_num": null }, { "text": "The unification algorithms, Farley parser and the HPSG path equation to graph converter programs are implemented in CommonLisp on a Symbolics machine. The preliminary parallel version of our unification algorithm is currently implemented on a Sequent/Symmetry closely-coupled shared-memory parallel machine running Allegro CLiP parallel Common-Lisp.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Appendix: Implementation", "sec_num": null } ], "back_matter": [], "bib_entries": { "BIBREF0": { "ref_id": "b0", "title": "Lazy Unification", "authors": [ { "first": "K", "middle": [], "last": "Godden ; Godden", "suffix": "" } ], "year": 1990, "venue": "Proceedings of ACL-90", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "Godden, 1990] Godden, K. \"Lazy Unification\" In Proceed- ings of ACL-90, 1990.", "links": null }, "BIBREF1": { "ref_id": "b1", "title": "D-PATR: A Development Environment for Unificadon-Based Grammars", "authors": [ { "first": "L", "middle": [], "last": "Karttunen ; Karttunen", "suffix": "" } ], "year": 1986, "venue": "", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "Karttunen, 1986] Karttunen, L. \"D-PATR: A Development Environment for Unificadon-Based Grammars\". In Pro- ceedingsofCOLING-86, 1986. (Also, Report CSLL86-61 Stanford University).", "links": null }, "BIBREF2": { "ref_id": "b2", "title": "Structure Sharing with Binary Trees", "authors": [ { "first": "L", "middle": [], "last": "Kay ; Karttunen", "suffix": "" }, { "first": "M", "middle": [], "last": "Kay", "suffix": "" } ], "year": 1985, "venue": "Proceedings of ACL-85", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "and Kay, 1985] Karttunen, L. and M. Kay \"Structure Sharing with Binary Trees\". In Proceedings of ACL-85, 1985.", "links": null }, "BIBREF3": { "ref_id": "b3", "title": "A Unification Method for Disjunctive Feature Descriptions", "authors": [ { "first": "R", "middle": [], "last": "Kasper ; Kasper", "suffix": "" } ], "year": 1987, "venue": "ProceedingsofACL-87", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "Kasper, 1987] Kasper, R. \"A Unification Method for Dis- junctive Feature Descriptions'. In ProceedingsofACL-87, 1987.", "links": null }, "BIBREF4": { "ref_id": "b4", "title": "Strategic Lazy Incremental Copy Graph Unification", "authors": [ { "first": "K", "middle": [], "last": "Kogure ; Kogure", "suffix": "" }, { "first": "K", "middle": [], "last": "Kogure", "suffix": "" } ], "year": 1988, "venue": "Proceedings of COLING-90", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "Kogure, 1989] Kogure, K. A Study on Feature Structures and Unification. ATR Technical Report. TR-1-0032,1988. [Kogure, 1990] Kogure, K. \"Strategic Lazy Incremental Copy Graph Unification\". In Proceedings of COLING-90, 1990.", "links": null }, "BIBREF5": { "ref_id": "b5", "title": "A Structure-Sharing Representation for Unificadon-Based Grammar Formalisms", "authors": [ { "first": ";", "middle": [], "last": "Pereira", "suffix": "" }, { "first": "E \" ;", "middle": [], "last": "Pereira", "suffix": "" }, { "first": "C", "middle": [], "last": "Pollard", "suffix": "" }, { "first": "I", "middle": [], "last": "", "suffix": "" } ], "year": 1985, "venue": "Proceedings of ACL-85", "volume": "1", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "Pereira, 1985] Pereira, E \"A Structure-Sharing Represen- tation for Unificadon-Based Grammar Formalisms\". In Proceedings of ACL-85, 1985. [Pollard and Sag, 1987] Pollard, C. and I. Sag Information- based Syntax and Semantics. Vol 1, CSLI, 1987. [Yoshimoto and Kogure, 1989] Yoshimoto, K. and K.", "links": null }, "BIBREF6": { "ref_id": "b6", "title": "Kogure Japanese Sentence Analysis by means of Phrase Structure Grammar", "authors": [ { "first": "D", "middle": [], "last": "Wroblewski", "suffix": "" } ], "year": 1987, "venue": "Proceedings of AAAI87", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "Kogure Japanese Sentence Analysis by means of Phrase Structure Grammar. ATR Technical Report. TR-1-0049, 1989. [Wroblewski, 1987] Wroblewski, D.\"Nondestrucdve Graph Unification\" In Proceedings of AAAI87, 1987.", "links": null } }, "ref_entries": { "FIGREF0": { "text": "............. + copy + ............... + comp-arc-mark + ............... + forward-mark + ..............", "type_str": "figure", "num": null, "uris": null }, "TABREF3": { "content": "