File size: 54,190 Bytes
6fa4bc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
{
    "paper_id": "P85-1017",
    "header": {
        "generated_with": "S2ORC 1.0.0",
        "date_generated": "2023-01-19T09:39:18.429172Z"
    },
    "title": "A Structure-Sharing Representation for Unification-Based Grammar Formalisms",
    "authors": [
        {
            "first": "Fernando",
            "middle": [
                "C N"
            ],
            "last": "Pereira",
            "suffix": "",
            "affiliation": {
                "laboratory": "",
                "institution": "Stanford University",
                "location": {}
            },
            "email": ""
        }
    ],
    "year": "",
    "venue": null,
    "identifiers": {},
    "abstract": "This paper describes a structure-sharing method for the representation of complex phrase types in a parser for PATR-[I, a unification-based grammar formalism. In parsers for unification-based grammar formalisms, complex phrase types are derived by incremental refinement of rite phrase types defined in grammar rules and lexical entries. In a naive implementation, a new phrase type is built by copying older ones and then combining the copies according to the constraints stated in a grammar rule. The structure-sharing method was designed to eliminate most such copying; indeed, practical tests suggest that the use of this technique reduces parsing time by as much as 60%. The present work is inspired by the structure-sharing method for theorem proving introduced by Boyer and Moore and on the variant of it that is used in some Prolog implementations. This research, made possible in part by a gift from the Systems De* velol.~ment Foundation, wa~ also supported by the Defense Advanced Research Projects Agency under Contracts N00039*80-C-OG75 and N00039-84-C-0,524 with the Naval Electronic Systems Command. The views and conclusions contained in this document are those of the author and should not be inierpreted as representative ol the official policies, either expressed or implied, of the Defense Advanced Re* s,,arrh Projects Agency, or the United States government. Thanks are due to Stuart Shieber, Lauri Karttunen. aml Ray Perrault for their comments on earlier presentations of this materiM.",
    "pdf_parse": {
        "paper_id": "P85-1017",
        "_pdf_hash": "",
        "abstract": [
            {
                "text": "This paper describes a structure-sharing method for the representation of complex phrase types in a parser for PATR-[I, a unification-based grammar formalism. In parsers for unification-based grammar formalisms, complex phrase types are derived by incremental refinement of rite phrase types defined in grammar rules and lexical entries. In a naive implementation, a new phrase type is built by copying older ones and then combining the copies according to the constraints stated in a grammar rule. The structure-sharing method was designed to eliminate most such copying; indeed, practical tests suggest that the use of this technique reduces parsing time by as much as 60%. The present work is inspired by the structure-sharing method for theorem proving introduced by Boyer and Moore and on the variant of it that is used in some Prolog implementations. This research, made possible in part by a gift from the Systems De* velol.~ment Foundation, wa~ also supported by the Defense Advanced Research Projects Agency under Contracts N00039*80-C-OG75 and N00039-84-C-0,524 with the Naval Electronic Systems Command. The views and conclusions contained in this document are those of the author and should not be inierpreted as representative ol the official policies, either expressed or implied, of the Defense Advanced Re* s,,arrh Projects Agency, or the United States government. Thanks are due to Stuart Shieber, Lauri Karttunen. aml Ray Perrault for their comments on earlier presentations of this materiM.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Abstract",
                "sec_num": null
            }
        ],
        "body_text": [
            {
                "text": "In this paper I describe a method, structure sharing, for the representation of complex phrase types in 'a parser for PATR-II, a unification-based grammar formalism.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Overview",
                "sec_num": "1"
            },
            {
                "text": "In parsers for unification-based grammar formalisms, cfmtplex phrase types are derived by incremental refinement of the phrase types defined in grammar rules anti h, xical emries. In a naive implementation, a new phrase t.vpe is built by\" copying older ones and then combining the copies according to the constraints stated in a grammar ruh,. The structure-sharing method eliminates most such copying by representing updates to objects (phrase types) separately from the objects themselves.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Overview",
                "sec_num": "1"
            },
            {
                "text": "The present work is inspired by the structure-sharing method for theorem proving introduced by Boyer and Moore [11 and on the variant of it that is used in some Prolog implementations [9] .",
                "cite_spans": [
                    {
                        "start": 184,
                        "end": 187,
                        "text": "[9]",
                        "ref_id": "BIBREF8"
                    }
                ],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Overview",
                "sec_num": "1"
            },
            {
                "text": "The data representation discussed in this paper is applicable, with but minor changes, to a variety of grammar formalisms based on unification, such as definite-clause grammars [61, functional-unification grammar [4], lexical-fimctional grammar For the sake of concreteness, however, our discussion will be in terms of the PATR-II formalism.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "The basic idea of unification-ba.se, I grammar formalisms is very simple. As with context-free ~rammars. granlmar rules stafe how phrase types con,blue t(, yiehl ol her phr:~se types.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "[h,t where:m a context-free grammar allows only a finite nl,mber ,~f predefined atomic phrase types or nonlerminal.~, a unification-based grammar will in general define implicitly an infinity of phra.se types.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "A phrase type is defined by a net of constraints. A grammar m,le is a set of ronsl.rnints b,,twe,,u the type .\\,~ .f a phr:me ;lnd the types .\\', ...... \\', of its ,'on..,iitm,nis. The rt,h, niay I,, applied It, It,. analysis ~,f a -,Ir'irlg s,, ;is the c<mc;ih,nalion of rcmslil.m'nls \"~1,.....%t if and <rely if tho types ,,f the .~i arc' rOml);~iible with the lypes .\\', ;tml the constraints in the ruh,.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "Unification is the operation that determines whether two types are compauble by buihling the most general type compatible with both.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "if the constramls arc, Cqllationn I)elween at tril-iI,,s (~f phra.se types, ;is is the ,'ase in PATII-II. i~,, ltlir:l~e l. This rule may be read as stating that a phrase of type Xo can be the concatenation of a phrase of type Xt and a phrase of type X:, provided that the attribute equations of the rule are satisfied if the phrases axe substituted for their types. The equations state that phrases of types X0, Xt, and X: have categories S, NP, and VP, respectively, that types Xt and X~ have the same agreement value, that types Xo and X2 have the same translation, and that the first argument of X0's translation is the translation of Xt.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "Formally, the expressions of the form (it..-I,,,) used in attribute equations axe path8 and each I~ is a label.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "When all the phrase types in a rule axe given constant A dag node (and by extension a dag) is said to be atomic if it represents a constant value; complex if it has some outgoing arcs; and a leaf if is is neither atomic or complex, that is, if it represents an as yet completely undetermined value. For uniformity, lexical entries and grammar rules are also represented by appropriate dags. For example, the dag for rule (t) is shown in Figure 1 . [n a chart parser for context-free grammars, the solution is trivial: instances can be represented by the unique interhal names (that is, addresses) of their objects because the information contained in an instance is exactly the same a.s that in the original object.",
                "cite_spans": [],
                "ref_spans": [
                    {
                        "start": 437,
                        "end": 445,
                        "text": "Figure 1",
                        "ref_id": null
                    }
                ],
                "eq_spans": [],
                "section": "Grammars with Unification",
                "sec_num": "2"
            },
            {
                "text": "[n a parser for PATR-|I or any other unification-based forrealism, however, distinct instances of an object will in general specify different values for attributes left unspecified in the original object. Clearly, the attribute values specified for one instance are independent of those for another instance of the same object.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Problem",
                "sec_num": "3"
            },
            {
                "text": "One obvious solution is to build new instances by copying the original object and then updating the copy with the new attribute values. This was the solution adopted in the first PATR-II parser [8] . The high cost of this solution both in time spent copying and in space required for the copies thenmelves constitutes the principal justification for employing the method described here.",
                "cite_spans": [
                    {
                        "start": 194,
                        "end": 197,
                        "text": "[8]",
                        "ref_id": "BIBREF7"
                    }
                ],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Problem",
                "sec_num": "3"
            },
            {
                "text": "As in the variant of Boyer and Moore's method [1] used in Prolog [9] , I shall represent a dag instance by a molecule (see Figure 2) The choice of which dag is rerouted and which one gets arc bindings is arbitrary.",
                "cite_spans": [
                    {
                        "start": 46,
                        "end": 49,
                        "text": "[1]",
                        "ref_id": "BIBREF0"
                    },
                    {
                        "start": 65,
                        "end": 68,
                        "text": "[9]",
                        "ref_id": "BIBREF8"
                    }
                ],
                "ref_spans": [
                    {
                        "start": 123,
                        "end": 132,
                        "text": "Figure 2)",
                        "ref_id": null
                    }
                ],
                "eq_spans": [],
                "section": "The Problem",
                "sec_num": "3"
            },
            {
                "text": "For reasons discussed later, the cost of looking up instance node updates in Boyer and Moore's environment representation is O(]dl), where [d[ is the length of the derivation (a ~equence of resolutions) of the instance. In the present representation, however, this cost is only O(Iog ]d]). This better performance is achieved by particularizing the environment representation and by splitting the representational scheme into two components: a memory organization and a daft repre.sentation.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Problem",
                "sec_num": "3"
            },
            {
                "text": "A dag representation is & way of mapping the mathematical entity dag onto a memory. A memory organization is a way of putting together a memory that has certain properties with respect to lookup, updating and copying. One can think of the memory organization as the hardware and the dag representation as the data structure.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Problem",
                "sec_num": "3"
            },
            {
                "text": "In practice, random-access memory can be accessed and updated in constant time. However, updates destroy old values, which is obviously unacceptable when dealing with alternative updates of the same data structure. If we want to keep the old version, we need to copy it first into a separate part of memory and change the copy instead. For the normal kind of memory, copying time is proportional to the size of the object copied. The present scheme uses another type of memory organization -virtual-copy array~ ~ which requires O(logn) time to access or update an array with highest used index Virtual-copy arrays provide a fully general memory ~tructure: anything that can be stored in r,'tndom-a,-ces~ memory can be stored in virtual-copy arrays, althoqlgh p,~mters in machine memory correspond to indexes in a virtual-copy array. An updating operation takes a virtual-copy array, an index, and a new value and returns a new virtual-copy array with the new value stored at the given index. An access operation takes an array and an index, and returns the value at that index.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Memory organization",
                "sec_num": "5"
            },
            {
                "text": "Basically, virtual-copy arrays are 2k-ary trees for some fixed k > 0. Define the depth d(n) of a tree node n to be 0 for the root and d(p) + I if p is the parent of n. Each virtual-copy array a has also a positive depth D(a) > max{d(n) : n is a node of a}. A tree node at depth D(a) (necessarily a leaf) can be either an array element or the special marker .L for unassigned elements. All leaf nodes at depths lower than D(a) are also \u00b1, indicating that no elements have yet been stored in the subarray below the node. With this arrangement, the array can store at most 2 k\u00b0('l elements, numbered 0 through 2 k\u00b0~*l -l, but unused sdbarrays need not be allocated.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Memory organization",
                "sec_num": "5"
            },
            {
                "text": "By numbering the 2 h daughters of a nonleaf node from 0 to 2 k -1, a path from a's root to an array element (a leaf at depth D(a)) can be represented by a sequence no... no(ab-t in which n, is the number of the branch taken at depth d. This sequence is just the base 2 k representation of the index n of the array element, with no the most significant digit and no(.} the least significant ( Figure .t) .",
                "cite_spans": [],
                "ref_spans": [
                    {
                        "start": 392,
                        "end": 402,
                        "text": "Figure .t)",
                        "ref_id": null
                    }
                ],
                "eq_spans": [],
                "section": "Memory organization",
                "sec_num": "5"
            },
            {
                "text": "When a virtual-copy array a is updated, one of two things may happen. If the index for the updated element exceeds the maximum for the current depth (,a~ in the a [8] := ~/update in Figure 5 ), a new root node is created for the updated array and the old array becomes the leftmost daughter of the new root. Other node,, are also created, as appropriate, to reach the position of the new element. If, on the other hand, the index for the update is within the range for the current Figure 5 ). This description assumes that the element being updated has alroady been set. If not, the branch to the element may T,,rminate prematurely in a 2. leaf, in which case new nodes are created to the required depth and attached to the appropriate position at the end of the new path from the root.",
                "cite_spans": [
                    {
                        "start": 163,
                        "end": 166,
                        "text": "[8]",
                        "ref_id": "BIBREF7"
                    }
                ],
                "ref_spans": [
                    {
                        "start": 182,
                        "end": 190,
                        "text": "Figure 5",
                        "ref_id": null
                    },
                    {
                        "start": 481,
                        "end": 489,
                        "text": "Figure 5",
                        "ref_id": null
                    }
                ],
                "eq_spans": [],
                "section": "Memory organization",
                "sec_num": "5"
            },
            {
                "text": "Any dug representation can be implemented with virtualcopy memory instead of random-access memory. If that were ,lone for the original PATR-II copying implementation, a certain measure of structure sharing would be achieved. The present scheme, however, goes well b~yond that by using the method of structure sharing introduced in Section 4. As we saw there, an instance object is represented by a molecule, a pair consisting of a skeleton dug {from a rule or iexical entry) and an update environment. We shall now examine the structure of environments.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "In a chart parser for PATR-ll, dug instances in the chart fall into two classes.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "Base in.stances are those associated with edges that are created directly from lexical entries or rules.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "Derived instances occur in edges that result from the combination of a left and a right parent edge containing the left and right parent instances of the derived instance. The left ancestors of an instance {edge) are its left parent and that parent's ancestors, and similarly for right ancestors, l will assume, for ease of exposition, that a derived instance is always a subdag of the unification of its right parent with a subdag of its left parent. This is the case for most common parsing algorithms, although more general schemes are possible [7] .",
                "cite_spans": [
                    {
                        "start": 548,
                        "end": 551,
                        "text": "[7]",
                        "ref_id": "BIBREF6"
                    }
                ],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "If the original Boyer-Moore scheme were used directly, the environment for a derived instance would consist of pointers to left and right parent instances, as well as a list of the updates needed to build the current instance from its parents. As noted before, this method requires a worst-case O(Idl} search to find the updates that result in the current instance.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "The present scheme relies on the fact that in the great majority of cases no instance is both the left and the right ancestor of another instance. [ shall assume for the moment that this is always the case. In Section 9 this restriction will be removed.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "It is asimple observation about unification that an update of a node of an instance ]\" is either an update of ['s skeleton or of the value (a subdag of another instance) of another update of L If we iterate this reasoning, it becomes clear that every update is ultimately an update of the skeleton of a base instance ancestor of [. Since we assumed above that no instance could occur more than once in it's derivation, we can therefore conclude that ['s environment consists only of updates of nodes in the skeletons of its base instance ancestors. By numbering the base instances of a derivation consecutively, we can then represent an environment by an array of frames, each containing all the updates of the skeleton of a given base instance.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "Actually, the environment of an instance [ will be a branch environment containing not only those updates directly relevant to [, but also all those that are relevant to the instances of/'s particular branch through the parsing search space.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "In the context of a given branch environment, it is then possible to represent a molecule by a pair consisting of a skeleton and the index of a frame in the environment. In particular, this representation can be used for all the value~ (dags) in updates.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "More specifically, the frame of a base instance is an array of update records indexed by small integers representing the nodes of the instance's skeleton. An update record is either a list of arc bindings for distinct arc labels or a rerouting update. An arc binding is a pair consisting of a label and a molecule (the value of the arc binding). This represents an addition of an arc with that label and that value at th,, given node. A rerouting update is just a pointer to another molecule; it says that the subdag at that node in the updated dug is given by that molecule (rather than by whatever w,xs in the initial skeleton).",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "To see how skeletons and bindings work together to represent a dag, consider the operation of finding the sub(tag For the sake of simplicity, only the subdags corresponding to the explicit equations in these rules are shown (ie., the cat dug arcs and the rule arcs 0, 1,... are omitted}. In the figure, the three nonterminal edges (for phrase types S, .4 and B) are labeled by molecules representing the corresponding dags. The skeleton of each of the three molecules comes from the rule used to build the nonterminal. Each molecule points (via a frame index not shown in the figure) to a frame in the branch environment. The frames for the A and B edges contain arc bindings for the top nodes of the respective skeletons whereas the frame for the S edge reroute nodes 1 and 2 of the S rule skeleton to the A and B molecules respectively.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Dag representation",
                "sec_num": "6"
            },
            {
                "text": "I shall now give the u~nification algorithm for two molecules (dags} in the same branch environment. We can treat a complex dug d a8 a partial function from labels to dags that maps the label on each arc leaving the top node of the dag to the dug at the end of that arc. This allows us to define the following two operations between dags:",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Unification Algorithm",
                "sec_num": "7"
            },
            {
                "text": "d~ \\ d2 = {{l,d}ed~li~dom{d:}} di <3 d= = {(l,d) Edl J I Gdorn(d:)}",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Unification Algorithm",
                "sec_num": "7"
            },
            {
                "text": "It is clear that dom(dl <~ d~) = dom(d2 <~ dl).",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Unification Algorithm",
                "sec_num": "7"
            },
            {
                "text": "We also need the notion of dug dereferencing introduced in the last section. As a side effect of successive unifications, the top node of a dag may be rerouted to another dag whose top node will also end up being rerouted. Dereferencing is the process of following such chains of rerouting pointers to reach a dug that has not been rerouted.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Unification Algorithm",
                "sec_num": "7"
            },
            {
                "text": "The unification of dags dl and d~ in environment e consists of the following steps: If none of the conditions above applies, the unification fails.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Unification Algorithm",
                "sec_num": "7"
            },
            {
                "text": "To determine whether a dag node is a leaf or complex, both the skeleton and the frame of the corresponding molecule must be examined. For a dereferenced molecule. the set of arcs leaving a node is just the union of the skeleton arcs and the arc bindings for the node. For this to make sense, the skeleton arcs and arc bindings for any molecule node must be disjoint. The interested reader will have no di~cuhy in proving that this property is preserved by the unification algorithm and therefore all molecules built from skeletons and empty frames by unification wiU satisfy it.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Unification Algorithm",
                "sec_num": "7"
            },
            {
                "text": "As we saw above, any dag or set of dags constructed by the parser is built from just two kinds of material: (I) frames; (21 pieces of the initial skeletons from rules and [exical entries. The initial skeletons can be represented trivially by host language data structures, as they never change. F~'ames, though, are always being updated. A new frame is born with the creation of an instance of a rule or lexical entry when the rule or entry is used in some parsing step (uses of the same rule or entry in other steps beget their own frames). A frame is updated when the instance it belongs to participates in a unification. During parsing, there are in general several possible ways of continuing a derivation. These correspond to alternative ways of updating a branch environment. In abstract terms, In fact. the use of virtual-copy arrays for environments and frames renders this copying unnecessary, so each continuation path performs its own updating of its version of the environment without interfering with the other paths. Thus, all unchanged portions of the environment are shared.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "\u00b0 8 Mapping dags onto virtual-copy memory",
                "sec_num": null
            },
            {
                "text": "In fact, derivations as such are not explicit in a ,'hart parser. Instead, the instance in each edge has its own branch ,,nvironment, as described previously. Therefore. when two e,lges are combined, it is necessary to merge their environments. The cost of this merge operation is at most the same the worst case cost for unification proper (O([d[ log JdJ)). However, in the very common case in which the ranges of frame indices of the two environments do not overlap, the merge cost is only O (log [d[) .",
                "cite_spans": [],
                "ref_spans": [
                    {
                        "start": 494,
                        "end": 503,
                        "text": "(log [d[)",
                        "ref_id": null
                    }
                ],
                "eq_spans": [],
                "section": "\u00b0 8 Mapping dags onto virtual-copy memory",
                "sec_num": null
            },
            {
                "text": "To summarize, we have sharing at two levels: the Boyer-Moore style dag representation allows derived (lag instances to share input data structures (skeletons), and the virtual-copy array environment representation allows different branches of the search space to share update records.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "\u00b0 8 Mapping dags onto virtual-copy memory",
                "sec_num": null
            },
            {
                "text": "In the foregoing discussion of the structure-sharing method, [ assumed that the left and right ancestors of a derived instance were disjoint. In fact, it is easy to show that the con-dition holds whenever the graHtm;tr d.'s n\u00a2)t ~.llow elllpty deriv(,d edges.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Renaming Problem",
                "sec_num": "9"
            },
            {
                "text": "In ,',mtrast, it is p,)ssible t,) construct a grammar in which an empty derived edge with dag D is b.th a left and a right ancestor of another edge with dag E. Clearly, tile two uses (~f D a.s an ancestor of E are mutually independent and the corresponding updates have to be seqregated. In ,~ther words, we need two ,'~l)ies of tile instance D. 13v anal,,~' with theorem proving, [ call Ihi~ lhe renaminq pr~d,h,m.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Renaming Problem",
                "sec_num": "9"
            },
            {
                "text": "The ('nrreflt sol|,t.i(,n is t,) us,, real ,'(,I)YiV|g t,) turn th,, empty edge into a skelet(>n, which is the|| adde~l t~ the chart. The new skeleton is then used in the norn|al fa.shion to produce multiple instances that are free of mutual interference.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "The Renaming Problem",
                "sec_num": "9"
            },
            {
                "text": "The representation described here has been used in a PATR-II parser implemented in I)r,~l,)g \". Two versions of the parser exist -cme using all Ea,-h,y-st.vle algorithn| related to Earley deduction [7] , the other using a left-,'.rner algorithm. Preliminary tests of the left-corner algorithm with structure sharing on various grammars and input have shown parsing times as much as 60% faster (never less, in fact, than 40% faster) than those achieved by the same parsing algorithm with structure copying.",
                "cite_spans": [
                    {
                        "start": 198,
                        "end": 201,
                        "text": "[7]",
                        "ref_id": "BIBREF6"
                    }
                ],
                "ref_spans": [],
                "eq_spans": [],
                "section": "Implementation",
                "sec_num": "10"
            },
            {
                "text": "Structure SharingStructure sharing is based on the observation that an initial object, together with a list of update records, contains the same information as the object that results from applying the updates to the initial object. In this way, we can trade the cost of actually applying the updates (with possible copying to avoid the destruction of the source object) against the cost of having to compute the effects of updates when examining the derived object. This reasoning applies in particular to dag instances that are the result of adding attribute values to other instances.",
                "cite_spans": [],
                "ref_spans": [],
                "eq_spans": [],
                "section": "",
                "sec_num": null
            }
        ],
        "back_matter": [],
        "bib_entries": {
            "BIBREF0": {
                "ref_id": "b0",
                "title": "The sharing of structure in theorem-proving program&",
                "authors": [
                    {
                        "first": "R",
                        "middle": [
                            "S"
                        ],
                        "last": "Boyer",
                        "suffix": ""
                    },
                    {
                        "first": "J",
                        "middle": [
                            "S"
                        ],
                        "last": "Moore",
                        "suffix": ""
                    }
                ],
                "year": 1972,
                "venue": "Machine Intelligence 7",
                "volume": "",
                "issue": "",
                "pages": "101--116",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "R. S. Boyer and J S. Moore. The sharing of structure in theorem-proving program& In Machine Intelligence 7, pages 101-116, John Wiley and Sons, New York, New York, 1972.",
                "links": null
            },
            "BIBREF1": {
                "ref_id": "b1",
                "title": "Lexical-functional grammar: a formal system for grammatical representation",
                "authors": [
                    {
                        "first": "J",
                        "middle": [],
                        "last": "Bresnan",
                        "suffix": ""
                    },
                    {
                        "first": "R",
                        "middle": [],
                        "last": "Kaplan",
                        "suffix": ""
                    }
                ],
                "year": 1982,
                "venue": "",
                "volume": "",
                "issue": "",
                "pages": "173--281",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "J. Bresnan and R. Kaplan. Lexical-functional gram- mar: a formal system for grammatical representation. In J. Bresnan, editor, The Mental Representation of Grammatical Relations, pages 173-281, MIT Press, Cambridge, Massachusetts, 1982.",
                "links": null
            },
            "BIBREF2": {
                "ref_id": "b2",
                "title": "Algorithm Schemata and Data Structures in Syntactic Processing",
                "authors": [
                    {
                        "first": "M",
                        "middle": [],
                        "last": "Kay",
                        "suffix": ""
                    }
                ],
                "year": 1980,
                "venue": "of the Nobel Symposium on Text Processing",
                "volume": "",
                "issue": "",
                "pages": "",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "M. Kay. Algorithm Schemata and Data Structures in Syntactic Processing. Technical Report, XEROX Palo Alto Research Center, Palo Alto, California, 1980. A version will appear in the proceedings of the Nobel Symposium on Text Processing, Gothenburg, 1980.",
                "links": null
            },
            "BIBREF3": {
                "ref_id": "b3",
                "title": "Functional grammar",
                "authors": [
                    {
                        "first": "M",
                        "middle": [],
                        "last": "Kay",
                        "suffix": ""
                    }
                ],
                "year": 1979,
                "venue": "Pro\u00a2. of the Fifth Annual Meeting of the Berkeley Linguistic Society",
                "volume": "",
                "issue": "",
                "pages": "142--158",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "M. Kay. Functional grammar. In Pro\u00a2. of the Fifth Annual Meeting of the Berkeley Linguistic Society, pages 142-158, Berkeley Linguistic Society, Berkeley, California, February 17-19 1979.",
                "links": null
            },
            "BIBREF4": {
                "ref_id": "b4",
                "title": "The semantics of grammar formalisms seen as computer languages. |n Proe. of Coling8~",
                "authors": [
                    {
                        "first": "C",
                        "middle": [
                            "N"
                        ],
                        "last": "Fernando",
                        "suffix": ""
                    },
                    {
                        "first": "Stuart",
                        "middle": [
                            "M"
                        ],
                        "last": "Pereira",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Shieber",
                        "suffix": ""
                    }
                ],
                "year": 1984,
                "venue": "iation for Computational Linguistics",
                "volume": "",
                "issue": "",
                "pages": "123--129",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "Fernando C. N. Pereira and Stuart M. Shieber. The se- mantics of grammar formalisms seen as computer lan- guages. |n Proe. of Coling8~, pages 123-129, Asso,-ia- tion for Computational Linguistics, 1984.",
                "links": null
            },
            "BIBREF5": {
                "ref_id": "b5",
                "title": "Definite clause grammars for language analysis -a survey of the formalism and a comparison with augmented transition networks",
                "authors": [
                    {
                        "first": "C",
                        "middle": [
                            "N"
                        ],
                        "last": "Fernando",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Pereira",
                        "suffix": ""
                    },
                    {
                        "first": "H",
                        "middle": [
                            "D"
                        ],
                        "last": "David",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Warren",
                        "suffix": ""
                    }
                ],
                "year": 1980,
                "venue": "Artificial Inteilicence",
                "volume": "13",
                "issue": "",
                "pages": "231--278",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "Fernando C. N. Pereira and David H. D. Warren. Defi- nite clause grammars for language analysis -a survey of the formalism and a comparison with augmented transi- tion networks. Artificial Inteilicence, 13:231-278, 1980.",
                "links": null
            },
            "BIBREF6": {
                "ref_id": "b6",
                "title": "Parsing as deduction",
                "authors": [
                    {
                        "first": "C",
                        "middle": [
                            "N"
                        ],
                        "last": "Fernando",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Pereira",
                        "suffix": ""
                    },
                    {
                        "first": "H",
                        "middle": [
                            "D"
                        ],
                        "last": "David",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Warren",
                        "suffix": ""
                    }
                ],
                "year": 1983,
                "venue": "Proc. of the 9lst Annual 3Iectin~ of the Association for Computational Linguistics",
                "volume": "",
                "issue": "",
                "pages": "",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "Fernando C. N. Pereira and David H. D. Warren. Pars- ing as deduction. In Proc. of the 9lst Annual 3Iectin~ of the Association for Computational Linguistics, MIT, Cambridge, Massachusetts, June 15-17 1983.",
                "links": null
            },
            "BIBREF7": {
                "ref_id": "b7",
                "title": "The design of a computer language for linguistic information",
                "authors": [
                    {
                        "first": "M",
                        "middle": [],
                        "last": "Stuart",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Shieber",
                        "suffix": ""
                    }
                ],
                "year": 1984,
                "venue": "Proc. of Colinf8j",
                "volume": "",
                "issue": "",
                "pages": "362--366",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "Stuart M. Shieber. The design of a computer lan- guage for linguistic information. In Proc. of Colinf8j, pages 362-366, Association for Computational l,inguis- tics, 1984.",
                "links": null
            },
            "BIBREF8": {
                "ref_id": "b8",
                "title": "Applied Logic -its use and intple. menlalion as proqramming tool",
                "authors": [
                    {
                        "first": "H",
                        "middle": [
                            "D"
                        ],
                        "last": "David",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Warren",
                        "suffix": ""
                    }
                ],
                "year": 1977,
                "venue": "Artificial Intelligence Center, SRI, Intornational",
                "volume": "",
                "issue": "",
                "pages": "",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "David H. D. Warren. Applied Logic -its use and intple. menlalion as proqramming tool. PhD thesis, University of FMinburgh, Scotland, 1977. Reprinted as T~,,'hnical Note 290, Artificial Intelligence Center, SRI, Intorna- tional, Menlo Park, California.",
                "links": null
            },
            "BIBREF9": {
                "ref_id": "b9",
                "title": "Logarithmic access arrays for Prolog",
                "authors": [
                    {
                        "first": "H",
                        "middle": [
                            "D"
                        ],
                        "last": "David",
                        "suffix": ""
                    },
                    {
                        "first": "",
                        "middle": [],
                        "last": "Warren",
                        "suffix": ""
                    }
                ],
                "year": 1983,
                "venue": "",
                "volume": "",
                "issue": "",
                "pages": "",
                "other_ids": {},
                "num": null,
                "urls": [],
                "raw_text": "David H. D. Warren, Logarithmic access arrays for Prolog. Unpublished program, 1983.",
                "links": null
            }
        },
        "ref_entries": {
            "FIGREF0": {
                "uris": null,
                "text": "x t)ecan lie unilh,d wlH,iI~,~,l,r ih,,y ,Io liol ;l~-.ii.rli ,li~iinci ~,;ihie.~ I.o Ilie ,~;llll\u00a2, al, l.rillilh,. The illlilil;il illii i~, lhcll jil.~l Ih~, ~'lliijunction (,sOt Ilili(lll) Of the rorreslXlading sets of COll.~trailll~, lsl.Ilere is a sample rule, in a simplified version (if the PATR-trans) (Xo trans argt) = (Xt trans)",
                "type_str": "figure",
                "num": null
            },
            "FIGREF1": {
                "uris": null,
                "text": "cat (category} values by the rule, we can use an abbreviated notation in which the phrase type vaxiables X~ axe replaced by their category values and the category-setting equations are omitted. For example, rule (1) may be written as trana args) --(NP trans) In existing PATR-II implementations, phrase types are not actually represented by their sets of defining equations. Instead, they are represented by symbolic solutions of the equations in the form of directed acyclic graphs (dacs) with arcs labeled by the attributes used in the equations. Dag nodes represent the values of attributes and an arc labeled by l goes from node m to node n if and only if, according to the equations, the value represented by m has n as the value of its t attribute [~].",
                "type_str": "figure",
                "num": null
            },
            "FIGREF2": {
                "uris": null,
                "text": "domain dora(d) of a complex dag d is the set of labels on arcs leaving the top node of d. Given a dag d and a label l E dora(d) we denote by d/I the subdag of d at the end of the arc labeled I from the top node of d. By extension, for any path p whose labels are in the domains of the appropriate subdags, d/p represents the subdag of d at the end of path p from the root of d.",
                "type_str": "figure",
                "num": null
            },
            "FIGREF3": {
                "uris": null,
                "text": "the unification of the dags 1, \"-[a:z,b:y] z= = [c. [d: eli After unification, the top node of/2 is rerouted to It and the top node of [i gets an arc binding with label c and a value that is the subdag [d : e] of/2. As we shall see later, any update of a dag represented by a molecule is either an update of the molecule's skeleton or an update of a dag (to which the same reasoning applies) appearing in the molecule's enviroment. Therefore, the updates in a molecule's environment are always shown in figures tagged by a boxed number identifying the affected node in the molecule's skeleton.",
                "type_str": "figure",
                "num": null
            },
            "FIGREF4": {
                "uris": null,
                "text": "30 = 132 (base 4) O(a) = Virtual-Copy Array of n, but in which the old contents are not destroyed by updating. Virtual-copy arrays were developed by David H. D. Warren [10] as an implementation of extensible arrays for Prolog.",
                "type_str": "figure",
                "num": null
            },
            "FIGREF5": {
                "uris": null,
                "text": "Unification of Two Molecules a{21: Updating Virtual-Copy Arrays depth, the path from the root to the element being updated is copied and the old element is replaced in the new tree by the new element (as in the a[21 := h update in",
                "type_str": "figure",
                "num": null
            },
            "FIGREF6": {
                "uris": null,
                "text": "d/(It'\"lm) of dug d. For this purpose, we use a current skeleton s and a current frame f, given initially by the skeleton and frame of the molecule representing d. Now assume that the current skeleton s and current frame ,f correspond to the subdag d' --d/(ll.., l~-l). To find d/(l~.., l~) -\" ~/l~, we use the following method: I. If the top node of s has been rerouted in j\" to a dag v, dereference \u00a3 by setting s and .f from v and repeating this step; otherwise 2. If the top node of s has an arc labeled by l~ with value s', the subdag at l~ is given by the moledule (g,[); otherwise 3. If .f contains an arc binding labeled l~ for the top node of s, the subdag at l~ is the value of the binding If none of these steps can be applied, (It .-. l~) is not a path from the root in d. The details of the representation are illustrated by the example inFigure 6, which shows the passive edges for the chart analysis of the string ab according to the sample gram-S-*AB:",
                "type_str": "figure",
                "num": null
            },
            "FIGREF8": {
                "uris": null,
                "text": "Structure-Sharing Chart on coming to a choice point in the derivation with n possible continuations, n -1 copies of the environment are made, giving n environments --namely, one for each alternative.",
                "type_str": "figure",
                "num": null
            },
            "TABREF1": {
                "text": "consisting of 1. [A pointer to] the initial dag, the instance's skeleton 2. [A pointer to] a table of updates of the skeleton, the instance's environment.Environments may contain two kinds of updates: reroutings that replace a dag node with another dag; are bindings that add to a node a new outgoing arc pointing to a dag.",
                "html": null,
                "content": "<table/>",
                "num": null,
                "type_str": "table"
            }
        }
    }
}