| { |
| "paper_id": "1993", |
| "header": { |
| "generated_with": "S2ORC 1.0.0", |
| "date_generated": "2023-01-19T07:36:48.668310Z" |
| }, |
| "title": "Chart Parsing of Attributed Structure-Sharing Flowgraphs with Tie-Point Relationships", |
| "authors": [ |
| { |
| "first": "Rudi", |
| "middle": [], |
| "last": "Lutz", |
| "suffix": "", |
| "affiliation": { |
| "laboratory": "", |
| "institution": "University of Sussex Falmer", |
| "location": { |
| "postCode": "BNl 9QH", |
| "settlement": "Brighton", |
| "country": "England" |
| } |
| }, |
| "email": "" |
| } |
| ], |
| "year": "", |
| "venue": null, |
| "identifiers": {}, |
| "abstract": "Many applications make use of diagrams to represent complex objects. In such applications it is often necessary to recognise how some diagram has been pieced together from other diagrams. Examples are electrical circuit analysis, and program understanding in the plan calculus (Rich, 1981}. In these applications the recognition process can be formalised as flowgraph parsing, where a flowgraph is a special case of a plex (Feder 1971}. Nodes in a flowgraph are connected to each other via intermediate points known as tie-points. Lutz (1986, 1989} generalised chart parsing of context-free string languages (Thompson-Ritchie, 1984} to context-free flowgraph languages, enabling bottom-up and top-down recognition of flowgraphs. However, there are various features of the plan calculus that complicate this-in particular attributes, structure sharing, and relation ships between tie-points. This paper will present a chart parsing algorithm for analysing graphs with all these features, suitable for both program understanding and digital circuit analysis. For a fixed grammar, this algorithm runs in time polynomial in the number of tie-points in the input graph.", |
| "pdf_parse": { |
| "paper_id": "1993", |
| "_pdf_hash": "", |
| "abstract": [ |
| { |
| "text": "Many applications make use of diagrams to represent complex objects. In such applications it is often necessary to recognise how some diagram has been pieced together from other diagrams. Examples are electrical circuit analysis, and program understanding in the plan calculus (Rich, 1981}. In these applications the recognition process can be formalised as flowgraph parsing, where a flowgraph is a special case of a plex (Feder 1971}. Nodes in a flowgraph are connected to each other via intermediate points known as tie-points. Lutz (1986, 1989} generalised chart parsing of context-free string languages (Thompson-Ritchie, 1984} to context-free flowgraph languages, enabling bottom-up and top-down recognition of flowgraphs. However, there are various features of the plan calculus that complicate this-in particular attributes, structure sharing, and relation ships between tie-points. This paper will present a chart parsing algorithm for analysing graphs with all these features, suitable for both program understanding and digital circuit analysis. For a fixed grammar, this algorithm runs in time polynomial in the number of tie-points in the input graph.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Abstract", |
| "sec_num": null |
| } |
| ], |
| "body_text": [ |
| { |
| "text": "Many applications make use of diagrams to repre sent complex objects, and we often need to recog nise how some diagram has been constructed. ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Introduction and Motiva tion", |
| "sec_num": "1" |
| }, |
| { |
| "text": "These tie-points either represent aggregate data structures corresponding to collections of other tie-points, or represent a more ab stract view of some tie-point ( e.g. viewing a list as implementing a set), and act as inputs or outputs of \"higher-level\" opera tions. Dealing with this involves using a second chart storing information about data objects.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Data Plans and Overlays -Some plans in the plan calculus allow the introduction of new tie-points not in the input graph.", |
| "sec_num": "2." |
| }, |
| { |
| "text": "This paper will present a parsing algorithm for analysing graphs with these features, noting that we permit structure sharing, but do not enfo rce it. For a fixed grammar, this algorithm runs in time polynomial in the number of tie-points in the input graph. We will begin by discussing simple flowgraphs, and then progressively deal with the above features. -Rosenfeld, 1969; Rosenfeld -Milgram, 1972 ", |
| "cite_spans": [ |
| { |
| "start": 359, |
| "end": 376, |
| "text": "-Rosenfeld, 1969;", |
| "ref_id": null |
| }, |
| { |
| "start": 377, |
| "end": 401, |
| "text": "Rosenfeld -Milgram, 1972", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Structure Sharing \ufffd when one component fe eds one or more of its \u2022 outputs to more than one other component (fan-out). In this situation the source component can be viewed as playing more than one role in the structure, and could have been dupli cated so that separate copies of the com ponent were responsible for each of these roles. This leads to no change in function ality, although there may be a loss in effi ciency as measured by the number of com ponents (digital circuits), or computational effort and code size (plan calculus).", |
| "sec_num": "3." |
| }, |
| { |
| "text": "A production in a string _grammar specifies how one string may be replaced \u2022 by another. How ever, with flowgraph grammars we encounter a difficulty ( due to their 2-dimensional nature) not apparent in the string case. In the string case a production A ==> aXYb applied to a string ... dAe ... (say) results in the string . .. daXYbe . .. -Rosenfeld, 1969; Rosenfeld -Milgram, 1972) ), but most of it also applies to flowgraphs. Our approach is to specify with each production which tie-points on the left cor respond to which tie-points on the right and then connect everything connecting to one of these left hand tie-points (from the surrounding subgraph) to its corresponding right-hand tie-point.", |
| "cite_spans": [ |
| { |
| "start": 294, |
| "end": 299, |
| "text": "(say)", |
| "ref_id": null |
| }, |
| { |
| "start": 339, |
| "end": 356, |
| "text": "-Rosenfeld, 1969;", |
| "ref_id": null |
| }, |
| { |
| "start": 357, |
| "end": 382, |
| "text": "Rosenfeld -Milgram, 1972)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "This type of plex will be called a flowgraph and is a generalisation of Brotsky's (1984) use of the term. See Figure 1 (top) for a simple example.", |
| "sec_num": null |
| }, |
| { |
| "text": "N is a finite non-empty set of NAPEs known as nonterminals.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "We define a flowgraph grammar to be a 4-tuple (N,T,P,S) where:", |
| "sec_num": null |
| }, |
| { |
| "text": "T is a finite non-empty set of NAPEs known as terminals.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "We define a flowgraph grammar to be a 4-tuple (N,T,P,S) where:", |
| "sec_num": null |
| }, |
| { |
| "text": "P is a finite set of productions.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "We define a flowgraph grammar to be a 4-tuple (N,T,P,S) where:", |
| "sec_num": null |
| }, |
| { |
| "text": "where the intersection of N and T is empty. (NAPElabel, inputlist, outputlist) where NAP E-label is the label on the NAPE, and input list is a list in which the i th entry is the tie point to which the i th input port is connected. Similarly the output list specifies to which tie point each of the output ports is connected. Using this convention a flowgraph G can be represented as a set G e (the component set) of such triples.", |
| "cite_spans": [ |
| { |
| "start": 44, |
| "end": 78, |
| "text": "(NAPElabel, inputlist, outputlist)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "S is a special member of N known as the ini tial, or start, NAPE", |
| "sec_num": null |
| }, |
| { |
| "text": "With the above conventions the productions in a flowgraph grammar have the general form", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "If we arbitrarily order the input and output ports of a NAPE then each NAPE in a flowgraph can be represented as a triple", |
| "sec_num": null |
| }, |
| { |
| "text": "AL i Lo ==> CRiRo", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "If we arbitrarily order the input and output ports of a NAPE then each NAPE in a flowgraph can be represented as a triple", |
| "sec_num": null |
| }, |
| { |
| "text": "where A is known as the left-side structure, repre-one can arrive at the notions of context-sensitive , context-free, and regular grammars (Ehrig, 1979) . In particular, restricting the productions to have a single NAPE in their left-side structure gives us a context-free flowgraph grammar, and we will restrict ourselves to these from now on. In this case we no longer need to store L i and L 0 since the input and output lists of the single triple on the left of the production already specify this in formation. See Figure 1 for ", |
| "cite_spans": [ |
| { |
| "start": 139, |
| "end": 152, |
| "text": "(Ehrig, 1979)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [ |
| { |
| "start": 520, |
| "end": 532, |
| "text": "Figure 1 for", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "If we arbitrarily order the input and output ports of a NAPE then each NAPE in a flowgraph can be represented as a triple", |
| "sec_num": null |
| }, |
| { |
| "text": "The instance of the left-side structure is re moved from W and replaced by an instance of the right-side structure. Now , for each tie-point ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "which is being rewritten according to the production. We define the arity of the left side of the rule to be the ordered pair ( ILi l, IL0 1) and the arity of the right side of the rule to be the or dered pair (IR i l, IR0 1). So this requirement simply states that the left-and right-side arities must be the same. The rewriting and embedding is done as follows:", |
| "sec_num": null |
| }, |
| { |
| "text": "are made for every rule in the grammar whose left-side structure is labelled by the start sym bol of the grammar. Each such rule\u2022 leads to several such empty patches, one for each per mutation of the input tie-points of the input graph. The inactive-inputs and active-outputs entries for these patches are the permuted in puts. The needed entry is the right-side structure of the rule with appropriate instantiations of the tie points occurring in it. These patches are also added to the agenda. The complete algorithm is shown below: initialise chart and agenda ; unt il the agenda is empty do pick a patch A from the agenda ; unless A is already in the chart then add A to the chart ; if A is complete then for each partial patch Bi n chart extendible by A do else make a new patch extending B with A and put on agenda ; endfor; if bottom-up then for each rule R in P such that rhs (R) has an input NAPE labelled by label (A) do for each such NAPE X in R do make new empty patch B with label (B)=lhs (R) and needed(B)=rhs (R) with instantiations dependent on match between X and A and inputs(B)=inputs(A) and active-outputs(B)=inputs(A) ; add B to agenda ; endfor; endfor; endif ;", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": ".149", |
| "sec_num": null |
| }, |
| { |
| "text": "for each complete patch Bi n chart which can extend A do make a new patch extending A with B and put on agenda; endfor; if top-down then for each object C immediately needed by A do for each rule R in P with lhs (R)=label (C) do ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": ".149", |
| "sec_num": null |
| }, |
| { |
| "text": "A similar technique can be used to store the grammar rules in order to enable efficient retrieval of appropriate rules. For the purposes of adding new patches to the chart, patches are only distinguished according to some of the information contained in them, rather than strict equality being necessary. Complete and partial patches will be dealt with separately.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "How can we organise the chart for efficient searching? The chart is divided into two parts, one for complete patches, and one for partial. The part for complete patches is organised as two ar rays, one for indexing each patch by its inputs, and one for indexing by its outputs. So each com plete patch is entered several times into the chart, once for each of its inputs and outputs. For fur ther efficiency each of the elements in these ar rays is a hash table and the patches are actu ally entered into these hashed by their label. So the entries in the hash table are actually lists of patches with the same label which share a given input or output tie-point. This enables efficient retrieval of all patches with a particular label at a particular tie-point. The treatment of partial patches is slightly more complicated. For each of their immediately needed N APEs partial patches are entered into their part of the chart indexed by the active inputs and outputs of the needed NAPE, and hashed by the labels of each of these N APEs. This structure for the chart enables a complete patch to easily find partial patches im mediately needing it, and enables partial patches to easily find complete patches that they imme diately need.", |
| "sec_num": null |
| }, |
| { |
| "text": "Complete patches are distinguished which dif fer in at least one of their input tie-points, their output tie-points, or their label. The maximum number of inputs and outputs in a patch is de termined by the grammar, as is the number of possible labels. So the number of possible com plete patches in the chart is bounded above by the product of L and the number of possible ways of selecting at most K out of T tie-points, and the number of possible ways of choosing at most M out of T tie-points. This gives us O(L \u2022 T K+ M ) complete patches altogether. A similar argument shows that at a given set of K (input) tie-points, there are at most O(T M ) complete patches with a given label.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "In this section a relatively informal argument will be given to show that, for a fixed grammar, the al gorithm runs in time polynomial in the number of tie-points T of the input graph (if the grammar is allowed to vary and is therefore regarded as part of the input to the parsing problem, then Wills (1992) has shown that the problem becomes NP complete). We will not give a tight upper bound", |
| "sec_num": null |
| }, |
| { |
| "text": "Partial patches are distinguished which differ in at least one of their inactive input tie-points, their inactive output tie-points, their label, or in what they need in order to complete themselves (their needed entry). Now, a partial patch repre sents the partially recognised right side structure of a rule. The rule used determines the label, and there are at most 2Q subsets of the ( at most) Q NAPEs in the rule that could still be needed. Each such subset determines a set of ( at most) A active tie-points for the patch. So there can be at most", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "In this section a relatively informal argument will be given to show that, for a fixed grammar, the al gorithm runs in time polynomial in the number of tie-points T of the input graph (if the grammar is allowed to vary and is therefore regarded as part of the input to the parsing problem, then Wills (1992) has shown that the problem becomes NP complete). We will not give a tight upper bound", |
| "sec_num": null |
| }, |
| { |
| "text": "partial patches altogether. In fact there will be very much less than this, as this includes com plete patches with nothing needed, and (more im portantly) ignores completely any additional con straint\ufffd implied by the connectivity of the graph.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "O(R \u2022 2Q \u2022T A \u2022 T K \u2022T M ) = O(R \u2022 2Q \u2022 T A+ K+ M )", |
| "sec_num": null |
| }, |
| { |
| "text": "We can use these upper bounds to demon strate that the algorithm terminates, and does so in polynomial time. Let N denote the number of iterations of the main loop of the algorithm while it is running, and let: So, in both the bottom-up and top-down cases, C N and P N are monotonic functions of N. As dis cussed earlier both are bounded above. There fore after some number of iterations they must both have reached their maximum value (nor mally much less than the crude estimates above). Once this happens all patches on the agenda must be already present in the chart and AN de creases by one on each subsequent iteration until it reaches O (an empty agenda), and the algorithm terminates. Now on each iteration it can be seen that either:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "CN", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "1. both C N and P N remain constant (in which case AN decreases), or 2. P N increases by 1, and items are possibly added to the agenda, or 3. CN increases by 1, and items are possibly added to the agenda.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "From the above, at most O(L \u2022 T K + M ) itera tions involve adding a complete patch to the chart and add some items to the agenda, and at most O(R . 2 Q \u2022 r A + K + M ) iterations involve adding a partial patch to the chart and add some items to the agenda. All other iterations simply remove items from the agenda. So how many items get added to the agenda? This is given by:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "(no. of items in initial agenda) +(no. added for complete patches) +(no. added for partial patches)", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "In the top down case this bounded by", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "A0 + O(L \u2022 T K + M ) \u2022 O((K +M) \u2022 R \u2022 LUTZ 2 Q . r K + M + A -1 ) + O(R . 2 Q . r A + K + M) . (O(A . Q . r K + M -1 )) + Q . R", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "and in the bottom-up case this is bounded by -1 ) which are both clearly polynomial. So, in both cases the number of items added to the agenda, which is the same as the number of iterations performed, is polynomially bounded. How much work is done on each of these itera tions? The cost of seeing if a patch is already in the chart can be done in polynomial time. This is because ( even with no clever indexing) there are at most a polynomial number of patches \u2022 in the chart that need to be checked. If the no-shar ing check is included then the cost of checking if one patch is extendible by another can be done in time at worst O(G) since both the partial and complete patches are each ultimately made up of at most G NAPEs (at lowest level), and check ing for inter\ufffdection of these two sets can be done in linear time. If the no-sharing check is omitted then the cost of checking if one patch is extendible by another can be done in constant time (since it depends on checking that the instantiated tie points of the patches are compatible with each other, and the number of tie-points involved de pends on the grammar), as can the cost of making a new patch. All the costs involved in checking rules etc. are purely a function of the grammar. So the total cost of the algorithm is easily seen to have an upper bound which is a polynomial function of T.", |
| "cite_spans": [ |
| { |
| "start": 45, |
| "end": 49, |
| "text": "-1 )", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "A0 + O(L \u2022 T K + M) \u2022 (O((K +M) \u2022 R \u2022 2 Q . r K + M + A-1 ) + Q . R) + O(R \u2022 2 Q . r A + K + M) . O(A . Q . r K + M", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Since the basic operation of the chart pars ing algorithm involves extending partial patches by complete ones, we need to know, for a given partial patch, the largest number of complete patches that could possibly extend it. A par tial patch can be extended at any of its ( at most) A active tie-points, and any complete patch which could extend it must join at least one of these tie-points, and must share a label with at least one of the NAPEs immediately required by the partial patch. So there are at most O(A . Q . T K+ Ml) such complete patches. Sim ilarly, given a complete patch, there are at most O((K +M) \u2022 R \u2022 2Q \u2022 T K+ M+ A -l) possible match ing partial patches.", |
| "sec_num": null |
| }, |
| { |
| "text": "Athough the algorithm performs flowgraph recog nition in polynomial time, it does not find all parses in polynomial time. This is because for some flowgraphs and some grammars there may well be an exponential number of parses ( this is even true of Earley's algorithm operating on strings!). The algorithm will however find a parse if one exists. If an application requires all possi ble parses, then the algorithm can be modified to store any complete patch which is equal to one already in the chart in terms of its inputs, out puts, and label, but not equal in terms of its com ponents, in an auxiliary data structure. At the end of the parsing there is then enough informa tion around in the chart and the auxiliary data structure to easily compute additional parses, by simply adding all the patches in the auxiliary structure to the agenda, and letting the pars ing continue with the test for equality of patches now being strict equality (i.e. all the components must be equal as well) rather than just the partial equality used earlier.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "2 Finding All Parses", |
| "sec_num": "4." |
| }, |
| { |
| "text": "As stated earlier graphs and rules in the plan calculus also have a second type of connection between NAPEs -control flow arcs. These are handled as attributes of the graphs, where the attribute for a non-terminal NAPE is calculated from the attributes of its components. Details of this method of handling the control flows can be found in Wills (1986 Wills ( , 1990 Wills ( , 1992 , and a general isation can be found in Lutz (1992) . For our pur poses we will assume that each NAPE in the orig inal graph is annotated with initial values for the attributes, and we will also assume that each rule has annotations describing how each attribute for the left-hand side of the rule is computed from the attributes of the NAPEs on its right-hand side. These annotations have the general form:", |
| "cite_spans": [ |
| { |
| "start": 341, |
| "end": 352, |
| "text": "Wills (1986", |
| "ref_id": null |
| }, |
| { |
| "start": 353, |
| "end": 367, |
| "text": "Wills ( , 1990", |
| "ref_id": null |
| }, |
| { |
| "start": 368, |
| "end": 382, |
| "text": "Wills ( , 1992", |
| "ref_id": null |
| }, |
| { |
| "start": 423, |
| "end": 434, |
| "text": "Lutz (1992)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Attributes", |
| "sec_num": "5" |
| }, |
| { |
| "text": "where A ths represents an attribute of the left hand side of the rule, f Rule represents the rule specific computation, and A1 , ... , Ak represent the attributes of the NAPEs on the right.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Attributes", |
| "sec_num": "5" |
| }, |
| { |
| "text": "Computing the attributes is straightforward. Each patch is given an extra field for each of its attributes. When a complete patch ( correspond ing to some rule of the grammar) whose compo nents have attributes A1 , ... , Ak , is added to the chart, f Rule (Al, ... , Ak) is computed, and stored in the appropriate field for the attribute in the patch. The initial patches receive their attribute values from the original graph.", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 256, |
| "end": 270, |
| "text": "(Al, ... , Ak)", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Attributes", |
| "sec_num": "5" |
| }, |
| { |
| "text": "In order to capture implementation decisions, and data abstractions, the plan calculus contains what Rich (1981) calls data plans and data over lays. So far as the grammatical formalism is con cerned, these ' can be viewed as allowing rules to express named functional relationships that hold between tie-points. To handle these our gram matical formalism is extended to allow annota tions (following the keyword where) of the form: F(t j i, . .. , t jk ) Jar k 2:: 1", |
| "cite_spans": [ |
| { |
| "start": 101, |
| "end": 112, |
| "text": "Rich (1981)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [ |
| { |
| "start": 433, |
| "end": 443, |
| "text": "F(t j i, .", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "ti =", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "where ti represents either any of the tie-points occurring in the N APEs of the rule, or an ad ditional new tie-point, t j1 , \u2022\u2022\u2022 , t jk represent any of the tie-points occurring in the NAPEs of the rule or any new tie-points mentioned on the left of other relationships in the rule ( this must be non-recursive!), and F is the name of the func tional relationship involved. The set of these will be referred to as the tie-point relationships of the rule. We will only discuss the changes to deal with tie-point relationships for the parser running in bottom-up mode. Dealing with them in top-down mode is rather complicated and will not be de scribed further in this paper.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "Conside the rules bump+update and bump+update->push (Figures 4 and 5) , which cause problems for the algorithm. Flowgraph grammar rules as described earlier have the same arities for their left-and right-hand sides, and this is true for bump+update. However, the left hand side of bump+update->push has arity (2,1), while the right hand side has arity (3,2). Further more, although the tie-point t3 occurs as input on both sides of the overlay, this is not true of t6 and any tie-point of the bump+update plan. It does not even correspond to the compound object ( the upper-segment) represented by t1 and t2. It corresponds to the upper-segment viewed as a list ( via a function upper-segment-> list) . To cope with these features the basic bottom-up chart parser presented earlier is modified as follows:", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 52, |
| "end": 69, |
| "text": "(Figures 4 and 5)", |
| "ref_id": null |
| }, |
| { |
| "start": 562, |
| "end": 582, |
| "text": "( the upper-segment)", |
| "ref_id": null |
| }, |
| { |
| "start": 609, |
| "end": 702, |
| "text": "It corresponds to the upper-segment viewed as a list ( via a function upper-segment-> list)", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "1. The rule format is modified to include the left-hand side inputs and outputs, since these may now be distinct from those on the right. Correspondingly, each patch now 5. A patch is only considered complete if both its needed entry and its relations-needed en try are empty. If they are, then the patch is added to the chart as normal. If not , then the patch is considered partial, and is stored in the chart indexed as before, but also indexed by the relationship names and instantiated tie-points of any immediately needed (in the obvious generalised sense of the term) relationships in the relations needed entry.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "6. When a relationship is added to the tie point chart, the (patch) chart is consulted to see if there are any partial patches wait ing for a tie-point relationship compatible with the one just added. If so, the patch is extended by the relationship, and added to the agenda. Figure 6 illustrates this for the above rules.", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 276, |
| "end": 284, |
| "text": "Figure 6", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "Now consider rules like those in Figure 7 , which includes a rule (for A) with a \"straight-through\" arc, and a graph like that in Figure 8 . This can be recognised as forming an S, by the following sequence of events:", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 33, |
| "end": 41, |
| "text": "Figure 7", |
| "ref_id": null |
| }, |
| { |
| "start": 130, |
| "end": 138, |
| "text": "Figure 8", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "1. The N APEs labelled b and c in Figure 8 are recognised as forming a partial A, which still has: iteratar(l, t4) t2 = iteratar(3, t4)", |
| "cite_spans": [ |
| { |
| "start": 99, |
| "end": 114, |
| "text": "iteratar(l, t4)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [ |
| { |
| "start": 34, |
| "end": 42, |
| "text": "Figure 8", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "tl =", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "in its relations-needed entry.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "matching this one. The partial A discovered earlier is found, and on matching 8 = iteratar(3, 4) and t2 = iteratar(3, t4)", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "t4 gets instantiated to 4, and t2 gets instan tiated to 8. The patch is therefore extended, and it now has only the single relationship: iteratar(l, 4) in its relations-needed entry. This causes the creation of a new tie-point 10 to which t1 is instantiated, and an assertion:", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 137, |
| "end": 151, |
| "text": "iteratar(l, 4)", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "tl =", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "10 = iteratar(l, 4)", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "is added to the tie-point chart. As a re sult of all this we now have a complete A patch (with input 10 and output 8) which gets added to the chart. This causes the creation of an empty S patch (with input 10) immediately needing an A (with input 10) to be added to the chart .", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "4. This patch is extended first by the A patch, and then again by the B patch, giving us a complete S patch with input 10 and output 9, where: 10 = iteratar(l, 4) and 9 = iteratar( 6, 7)", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "This illustrates very nicely the role of the second chart. These relationships are added to the tie point chart.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Dealing With Tie-Point Relationships", |
| "sec_num": "6" |
| }, |
| { |
| "text": "added to the tie-point chart, the main chart is ' consulted to see if there are any partial patches immediately needing a relationship", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "When the relationship 8=iterator(3, 4) is", |
| "sec_num": "3." |
| }, |
| { |
| "text": "As stated earlier we are also interested in the case where structure sharing is allowed. However, for reasons discussed in Lutz (1992), we do not want to allow any two NAPEs sharing the same inputs to be collapsed, but only NAPEs with appropri ate labels. To make this more precise we define a slightly more general notion: A re stricted structure sharing fiowgraph gram mar (RSSFG) is a 5-tuple (N, T, P, S, R) where N, T, P, S are the same as for ordinary context get a (full) structure sharing flowgraph grammar as defined in Lutz (1989) . Figure 9 illustrates several phenomena that can occur with RSSFGs, and which motivated the above definition.", |
| "cite_spans": [ |
| { |
| "start": 529, |
| "end": 540, |
| "text": "Lutz (1989)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [ |
| { |
| "start": 388, |
| "end": 411, |
| "text": "5-tuple (N, T, P, S, R)", |
| "ref_id": null |
| }, |
| { |
| "start": 543, |
| "end": 551, |
| "text": "Figure 9", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "When the relationship 8=iterator(3, 4) is", |
| "sec_num": "3." |
| }, |
| { |
| "text": "To see how the parsing algorithm can be mod ified to cope with RSSFGs it should first be noted that for any flowgraph G there is a smallest flow graph G m i n which is R-share-equivalent to G. Secondly, the right-side structure of any rule in an RSSFG can be replaced by any flowgraph R share-equivalent to it without altering the gen erative capacity of the grammar. We therefore define a canonical form for an RSSFG in which each rule of the form:", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "When the relationship 8=iterator(3, 4) is", |
| "sec_num": "3." |
| }, |
| { |
| "text": "A ==> Bmin", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "A==> B has been replaced by the rule:", |
| "sec_num": null |
| }, |
| { |
| "text": "or by an assertion held separately. Finally, the no-sharing check must be omitted.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "So the first change to the algorithm is to put the grammar into canonical form. The second change is to the action of adding a complete patch to the chart. Previously the only check that was done was to see if the patch was already in the chart. Now the algorithm must additionally check if the label of the patch is in R and if there is an other patch in the chart with the same label and the same inputs. If so, the algorithm must col lapse the new patch and the one already present into a single patch, by identifying the output tie points of the two patches. Provided tie-points in the various triples making up the patches are represented as pointers to pointers to tie-points (rather than storing the tie-points directly in the triples) then simply changing the values of the second set of pointers will implement the identi fication universally throughout all patches in the chart. This can lead to \"chains\" of pointers which need to be fully dereferenced in order to actually access the tie-points themselves ( this is similar to the way variables are handled in many implemen tations of Prolog). After collapsing an additional step is needed since there may be patches in the chart indexed by the tiE\ufffd-point which has been effectively removed by the identification. These patches must now be stored in the chart indexed by their new output tie-points. If the informa tion that collapsing has been done is needed by an application the algorithm can make a note this fa ct either by annotating the tie-points involved", |
| "sec_num": null |
| }, |
| { |
| "text": "If the grammar also has attributes, then we need to specify how to compute the attribute A res of a NAPE resulting from collapsing two patches with attributes A 1 and A 2 \u2022 This specification takes the form (for each attribute):", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "So the first change to the algorithm is to put the grammar into canonical form. The second change is to the action of adding a complete patch to the chart. Previously the only check that was done was to see if the patch was already in the chart. Now the algorithm must additionally check if the label of the patch is in R and if there is an other patch in the chart with the same label and the same inputs. If so, the algorithm must col lapse the new patch and the one already present into a single patch, by identifying the output tie points of the two patches. Provided tie-points in the various triples making up the patches are represented as pointers to pointers to tie-points (rather than storing the tie-points directly in the triples) then simply changing the values of the second set of pointers will implement the identi fication universally throughout all patches in the chart. This can lead to \"chains\" of pointers which need to be fully dereferenced in order to actually access the tie-points themselves ( this is similar to the way variables are handled in many implemen tations of Prolog). After collapsing an additional step is needed since there may be patches in the chart indexed by the tiE\ufffd-point which has been effectively removed by the identification. These patches must now be stored in the chart indexed by their new output tie-points. If the informa tion that collapsing has been done is needed by an application the algorithm can make a note this fa ct either by annotating the tie-points involved", |
| "sec_num": null |
| }, |
| { |
| "text": "where ! co lla p se is a function which computes the value of the attribute for the new patch from the values for the two collapsed patches. Two NAPEs are only collapsed when an attempt is made to add a complete patch P2 (with attribute A2 ) to the chart, and there is already a patch Pi ( with attribute A 1 ) present in the chart with the same label and inputs. In this . case Pi is left in the chart (i.e. it is the output tie-points in P2 which are identified with those in Pi). Pi then has the value of its attribute set to f co ll a p se (A1 ,A2). If this new value for its attribute is different from its previous value, then any complete patches in the chart which have Pi as one of their compo nents must also have their attributes recalculated, and any of these patches whose attributes change must also have their attributes recalculated, and so on recursively. To facilitate this, each com plete patch P needs an extra field partof which holds a list of all corn plete patches of which P is a component. To maintain this field, whenever a complete patch P is added to the chart, P is added to the partof field of each of its compo nent patches. The initial patches ( corresponding to the original graph) all have this field initially set to empty.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "So the first change to the algorithm is to put the grammar into canonical form. The second change is to the action of adding a complete patch to the chart. Previously the only check that was done was to see if the patch was already in the chart. Now the algorithm must additionally check if the label of the patch is in R and if there is an other patch in the chart with the same label and the same inputs. If so, the algorithm must col lapse the new patch and the one already present into a single patch, by identifying the output tie points of the two patches. Provided tie-points in the various triples making up the patches are represented as pointers to pointers to tie-points (rather than storing the tie-points directly in the triples) then simply changing the values of the second set of pointers will implement the identi fication universally throughout all patches in the chart. This can lead to \"chains\" of pointers which need to be fully dereferenced in order to actually access the tie-points themselves ( this is similar to the way variables are handled in many implemen tations of Prolog). After collapsing an additional step is needed since there may be patches in the chart indexed by the tiE\ufffd-point which has been effectively removed by the identification. These patches must now be stored in the chart indexed by their new output tie-points. If the informa tion that collapsing has been done is needed by an application the algorithm can make a note this fa ct either by annotating the tie-points involved", |
| "sec_num": null |
| }, |
| { |
| "text": "The algorithm just described forms the basis of the program understanding process described in Lutz (1989b Lutz ( , 1991 Lutz ( , 1992 . However, there are other domains, in particular digital circuit analy sis, in which a similar ability to parse flowgraphs is useful. Consider Figure 10 which shows a cir cuit for addition of 3-bit numbers. The grammar shown in Figure 11 is capable of generating this circuit. Adding a rule like that shown in Figure 12 enables the parser to recognise the circuit in Figure 10 as being equivalent to Figure 13 i.e. to recognise the circuit as adding two numbers, with the tie-point chart holding information about how the numbers have been \"implemented\" .", |
| "cite_spans": [ |
| { |
| "start": 95, |
| "end": 106, |
| "text": "Lutz (1989b", |
| "ref_id": null |
| }, |
| { |
| "start": 107, |
| "end": 120, |
| "text": "Lutz ( , 1991", |
| "ref_id": "BIBREF5" |
| }, |
| { |
| "start": 121, |
| "end": 134, |
| "text": "Lutz ( , 1992", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [ |
| { |
| "start": 279, |
| "end": 288, |
| "text": "Figure 10", |
| "ref_id": null |
| }, |
| { |
| "start": 364, |
| "end": 373, |
| "text": "Figure 11", |
| "ref_id": null |
| }, |
| { |
| "start": 446, |
| "end": 456, |
| "text": "Figure 12", |
| "ref_id": null |
| }, |
| { |
| "start": 504, |
| "end": 513, |
| "text": "Figure 10", |
| "ref_id": null |
| }, |
| { |
| "start": 537, |
| "end": 546, |
| "text": "Figure 13", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Applications", |
| "sec_num": "8" |
| }, |
| { |
| "text": "This paper has presented a polynomial time chart parsing algorithm for context-free flowgraph lan guages, capable of handling all the features of the plan calculus (Rich, 1981) , and which is also ap plicable to digital circuit analysis.", |
| "cite_spans": [ |
| { |
| "start": 164, |
| "end": 176, |
| "text": "(Rich, 1981)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Conclusions", |
| "sec_num": "9" |
| }, |
| { |
| "text": "Although there is a large literature on the gen erative abilities of various types of graph gram mar formalisms (see e.g. (Ehrig, 1979; Feder, 1971; Fu, 1974; Gonzalez -Thomason, 1978; Pfaltz -Rosenfeld, 1969; Rosenfeld -Milgram, 1972) ), there is relatively little on parsing strate gies, except for restricted classes of graph and web grammars (e.g. Della Vigna -Ghezzi (1978) ). In its top-down strictly left-to-right form chart pars ing of context-free string languages corresponds to Earley's algorithm (Earley, 1970) , which was generalised by Brotsky (1984) to parsing flow graphs of the kind described here, except that his algorithm could not cope with fan-out at tie points, or with tie-point relationships. However the approach taken here can also run bottom up, which is particularly useful in applications in which we want to recognise as much as possible even though full recognition may be impossible (because of errors in the graph, or because the grammar is necessarily incomplete). Wills (1986 Wills ( , 1990 ) modified Brotsky's algorithm to cope with fan-out, but her algorithm only runs in a pseudo bottom-up fashion by starting it running top down looking for every possible non-terminal at every possible place in the graph. More re cently, Wills (1992) developed an algorithm heav ily based on the chart parsing algorithm described here and in (Lutz, 1986 (Lutz, , 1989 , which is also capa ble of dealing with attributes and tie-point rela tionships. However her algorithm and graph rep resentations make no mention of tie-points, but deal directly with the edges connecting N APEs. This makes it harder to deal elegantly with the tie-point relationships.", |
| "cite_spans": [ |
| { |
| "start": 112, |
| "end": 135, |
| "text": "(see e.g. (Ehrig, 1979;", |
| "ref_id": null |
| }, |
| { |
| "start": 136, |
| "end": 148, |
| "text": "Feder, 1971;", |
| "ref_id": null |
| }, |
| { |
| "start": 149, |
| "end": 158, |
| "text": "Fu, 1974;", |
| "ref_id": null |
| }, |
| { |
| "start": 159, |
| "end": 184, |
| "text": "Gonzalez -Thomason, 1978;", |
| "ref_id": null |
| }, |
| { |
| "start": 185, |
| "end": 209, |
| "text": "Pfaltz -Rosenfeld, 1969;", |
| "ref_id": null |
| }, |
| { |
| "start": 210, |
| "end": 235, |
| "text": "Rosenfeld -Milgram, 1972)", |
| "ref_id": null |
| }, |
| { |
| "start": 358, |
| "end": 378, |
| "text": "Vigna -Ghezzi (1978)", |
| "ref_id": "BIBREF3" |
| }, |
| { |
| "start": 508, |
| "end": 522, |
| "text": "(Earley, 1970)", |
| "ref_id": null |
| }, |
| { |
| "start": 550, |
| "end": 564, |
| "text": "Brotsky (1984)", |
| "ref_id": "BIBREF1" |
| }, |
| { |
| "start": 1000, |
| "end": 1011, |
| "text": "Wills (1986", |
| "ref_id": null |
| }, |
| { |
| "start": 1012, |
| "end": 1026, |
| "text": "Wills ( , 1990", |
| "ref_id": null |
| }, |
| { |
| "start": 1264, |
| "end": 1276, |
| "text": "Wills (1992)", |
| "ref_id": null |
| }, |
| { |
| "start": 1368, |
| "end": 1379, |
| "text": "(Lutz, 1986", |
| "ref_id": null |
| }, |
| { |
| "start": 1380, |
| "end": 1393, |
| "text": "(Lutz, , 1989", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Conclusions", |
| "sec_num": "9" |
| }, |
| { |
| "text": "More recently there have been several pa pers in the visual language literature which have adopted a chart parsing approach. In particu lar, Wittenburg et al. (1991) and Golin (1991) have both developed bottom up parsers for 2-dimensional languages, while O'Gorman (1992), Costagliola et al. (1991) , and Wittenburg (1992) have developed top-down parsers. This work is all similar in spirit to that presented here, al though differences in representation, and appli cation, make it very different in detail. Indeed this seems to be a general problem with work on 2-dimensional languages -there is no known general method suitable for conveniently repre senting all the different classes of language, and this leads to algorithms for one domain being very different from those in another. Of course, some kind of definite clause encoding could be used for all of these, but this is not always natural, and does not always lend itself to the development of efficient algorithms. In this connection it should be noted that the flowgraph languages discussed in this paper can be encoded in the Datalog for-LUTZ malism (Abitoul -Vianu, 1988) for which it is known that parsing can be performed in polyno mial time. However, a special-purpose algorithm like the one presented can be particularly efficient and adaptable ( cf. the control of structure shar ing).", |
| "cite_spans": [ |
| { |
| "start": 141, |
| "end": 165, |
| "text": "Wittenburg et al. (1991)", |
| "ref_id": "BIBREF5" |
| }, |
| { |
| "start": 170, |
| "end": 182, |
| "text": "Golin (1991)", |
| "ref_id": null |
| }, |
| { |
| "start": 273, |
| "end": 298, |
| "text": "Costagliola et al. (1991)", |
| "ref_id": "BIBREF2" |
| }, |
| { |
| "start": 305, |
| "end": 322, |
| "text": "Wittenburg (1992)", |
| "ref_id": "BIBREF4" |
| }, |
| { |
| "start": 1114, |
| "end": 1136, |
| "text": "(Abitoul -Vianu, 1988)", |
| "ref_id": "BIBREF0" |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Conclusions", |
| "sec_num": "9" |
| }, |
| { |
| "text": "A particular advantage of a chart parser is that it keeps a record of all partial patches. This is useful when we do not just wish to analyse how some graph has been generated, but also to make suggestions based on \"near-miss\" informa tion about how to correct the graph. As such this algorithm is being used as the basis of \u2022 an intelligent debugging system for Pascal programs (Lutz, 1992) .", |
| "cite_spans": [], |
| "ref_spans": [ |
| { |
| "start": 379, |
| "end": 391, |
| "text": "(Lutz, 1992)", |
| "ref_id": null |
| } |
| ], |
| "eq_spans": [], |
| "section": "Conclusions", |
| "sec_num": "9" |
| }, |
| { |
| "text": "The algorithms described in this paper have been implemented in Pop-11, running under the POPLOG \u2122 system.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Conclusions", |
| "sec_num": "9" |
| }, |
| { |
| "text": "R s is the number of rules for S (the start symbol); P a is the number of permutations of inputs of graph.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "", |
| "sec_num": null |
| } |
| ], |
| "back_matter": [ |
| { |
| "text": "has two extra fieldsleft-hand-ins, and left-hand-outs, in addition to the two fields inputs and outputs ( corresponding to in puts and outputs of the right hand side of the rule). Complete patches are stored in the chart indexed by their left-hand-ins and left-hand-outs, rather than by their inputs and outputs as before. Partial patches are stored as before. S1, ... , Sk) . where T and S 1 , ..", |
| "cite_spans": [ |
| { |
| "start": 361, |
| "end": 364, |
| "text": "S1,", |
| "ref_id": null |
| }, |
| { |
| "start": 365, |
| "end": 370, |
| "text": "... ,", |
| "ref_id": null |
| }, |
| { |
| "start": 371, |
| "end": 374, |
| "text": "Sk)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "annex", |
| "sec_num": null |
| }, |
| { |
| "text": ", and by the relationship name.", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": ". , Sk are known (i.e. in stantiated) tie-points. This chart is or ganised similarly to the earlier (complete) chart, in that it is split into two parts, one used for storing relationships indexed by the left hand side tie-point (T) and by the relationship name (F), and the other used for storing the relationships indexed by the right-hand side tie-points (S1, ... , Sk)", |
| "sec_num": null |
| }, |
| { |
| "text": "patch is created this is initialised to empty. ... , Sk) where T must be a known tie-point.", |
| "cite_spans": [ |
| { |
| "start": 47, |
| "end": 56, |
| "text": "... , Sk)", |
| "ref_id": null |
| } |
| ], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Two new fields are added to each patch. These are: (a) relations-needed -When an empty patch is created this is initialised to the set of tie-point relationships of the rule involved in creating the patch. (b) relations-found -When an empty", |
| "sec_num": "3." |
| }, |
| { |
| "text": "If there is, then V is instantiated to T, and this instantiation is propagated throughout the patch (including its relations-needed entry). If not, then a new tie-point T is created, the asser tion: T = F( S1, . free flowgraph grammars, and R \ufffd N U T. R is the set of NAPEs for which collapsing is allowed. Such a grammar has an additional rewriting rule which will be described below. We define a re lation R-collapses on the set of flowgraphs over NUT by: ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "When a new patch is created, either by ex tending a partial patch, or by creating a new empty patch for some rule, any instan tiations for the tie-point variables occur ring in the patch are also propagated into", |
| "sec_num": "4." |
| }, |
| { |
| "text": "Parsing Algorithm\". In: Co mmunications of the ACM Volume(13), 94 -102. ", |
| "cite_spans": [], |
| "ref_spans": [], |
| "eq_spans": [], |
| "section": "Earley, J. (1970) \"An Efficient Context-Free", |
| "sec_num": null |
| } |
| ], |
| "bib_entries": { |
| "BIBREF0": { |
| "ref_id": "b0", |
| "title": "Data.log Ex tensions for Database Updates and Queries", |
| "authors": [ |
| { |
| "first": "S. -\u2022 V", |
| "middle": [], |
| "last": "Abitoul", |
| "suffix": "" |
| }, |
| { |
| "first": "", |
| "middle": [], |
| "last": "Vianu", |
| "suffix": "" |
| } |
| ], |
| "year": 1988, |
| "venue": "I.N.R.I.A. Te chnical Report", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Abitoul, S. -\u2022 v. Vianu (1988) \"Data.log Ex tensions for Database Updates and Queries\". I.N.R.I.A. Te chnical Report No. 715", |
| "links": null |
| }, |
| "BIBREF1": { |
| "ref_id": "b1", |
| "title": "An Algorithm for Parsing Flow Graphs", |
| "authors": [ |
| { |
| "first": "D", |
| "middle": [ |
| "C" |
| ], |
| "last": "Brotsky", |
| "suffix": "" |
| } |
| ], |
| "year": 1984, |
| "venue": "", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Brotsky, D.C. (1984) \"An Algorithm for Parsing Flow Graphs\". AI-TR-704. MIT Artificial In telligence Laboratory.", |
| "links": null |
| }, |
| "BIBREF2": { |
| "ref_id": "b2", |
| "title": "A Generalised Parser for 2-D Lan guages", |
| "authors": [ |
| { |
| "first": "G. -M. To Mita -S.-K", |
| "middle": [], |
| "last": "Costagliola", |
| "suffix": "" |
| }, |
| { |
| "first": "", |
| "middle": [], |
| "last": "Chang", |
| "suffix": "" |
| } |
| ], |
| "year": 1991, |
| "venue": "Proceedings of IEEE Workshop on Visual Languages", |
| "volume": "", |
| "issue": "", |
| "pages": "98--104", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Costagliola, G. -M. To mita -S.-K. Chang (1991) \"A Generalised Parser for 2-D Lan guages\" In: Proceedings of IEEE Workshop on Visual Languages 98 -104.", |
| "links": null |
| }, |
| "BIBREF3": { |
| "ref_id": "b3", |
| "title": "Context Free Graph Grammars", |
| "authors": [ |
| { |
| "first": "Della", |
| "middle": [], |
| "last": "Vigna", |
| "suffix": "" |
| }, |
| { |
| "first": ", P. -C", |
| "middle": [], |
| "last": "Ghezzi", |
| "suffix": "" |
| } |
| ], |
| "year": 1978, |
| "venue": "Information and Co ntrol", |
| "volume": "", |
| "issue": "37", |
| "pages": "207--233", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Della Vigna, P. -C. Ghezzi (1978) \"Context Free Graph Grammars\". In: Information and Co ntrol Volume(37), 207 -233 .", |
| "links": null |
| }, |
| "BIBREF4": { |
| "ref_id": "b4", |
| "title": "Earley-style Parsing for Relational Languages", |
| "authors": [ |
| { |
| "first": "K", |
| "middle": [], |
| "last": "Wittenburg", |
| "suffix": "" |
| } |
| ], |
| "year": 1992, |
| "venue": "Proceedings of IEEE Workshop on Visual Languages", |
| "volume": "", |
| "issue": "", |
| "pages": "192--199", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "Wittenburg, K. (1992) \"Earley-style Parsing for Relational Languages\" In: Proceedings of IEEE Workshop on Visual Languages 192 - 199.", |
| "links": null |
| }, |
| "BIBREF5": { |
| "ref_id": "b5", |
| "title": "Unification-based Grammars and Tabular Parsing for Graphical Languages", |
| "authors": [ |
| { |
| "first": ", K. -L", |
| "middle": [], |
| "last": "Lutz Wittenburg", |
| "suffix": "" |
| }, |
| { |
| "first": "", |
| "middle": [], |
| "last": "We Itzman -J", |
| "suffix": "" |
| }, |
| { |
| "first": "", |
| "middle": [], |
| "last": "Ley", |
| "suffix": "" |
| } |
| ], |
| "year": 1991, |
| "venue": "In: Journal of Visual Languages and Computing", |
| "volume": "", |
| "issue": "2", |
| "pages": "347--370", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "LUTZ Wittenburg, K. -L. We itzman -J. Tal ley (1991) \"Unification-based Grammars and Tabular Parsing for Graphical Languages\" In: Journal of Visual Languages and Computing Volume(2), 347 -370.", |
| "links": null |
| }, |
| "BIBREF6": { |
| "ref_id": "b6", |
| "title": "A 3-Btt Addition Circuit", |
| "authors": [], |
| "year": null, |
| "venue": "", |
| "volume": "", |
| "issue": "", |
| "pages": "", |
| "other_ids": {}, |
| "num": null, |
| "urls": [], |
| "raw_text": "A 3-Btt Addition Circuit", |
| "links": null |
| } |
| }, |
| "ref_entries": { |
| "FIGREF0": { |
| "type_str": "figure", |
| "num": null, |
| "uris": null, |
| "text": "ever connected to a single tie-point, although fan-out and fan-in is allowed at .tie points. Lutz {1986, 1989) generalised chart pars ing of context-free string languages {Thompson -Ritchie, 1984) to context-free flowgraph lan guages, enabling bottom-up and top-down recog nition of flowgraphs. However, there are features of the plan calculus that complicate this: 1. Attributes -control flows in the plan cal culus are treated as attributes of the gram mar which are propagated during parsing." |
| }, |
| "FIGREF1": { |
| "type_str": "figure", |
| "num": null, |
| "uris": null, |
| "text": "endfor endfor endif make new empty patch B with label(B)=label(C) and needed(B)=rhs (R) with instant iations dependent on match between C and lhs (R) and inputs(B)=inputs(C) and active-outputs(B)=inputs(C) ; add B to agenda; endif endunless enduntil ; { = . AN -1 if patch is already present in the chart AN + l \ufffd AN -1 + AQT K+ Ml + QR if patch partial and not in chart _ \u2022 \ufffd AN \ufffd l + (K + M) \u2022 R2QT K+ M+ Al if patch camplete and not in chart CN+l {: CN if patch chosen is already present in the chart CN if patch chosen is partial and not in the chart CN + l if patch chosen is camplete and not in the chart PN +l { : PN if patch chosen is already present in the chart PN + l if patch chosen is partial and not in the chart PN if patch chosen is camplete and not in the chart Figure 14: The top-down case, the N + 1 th iteration On termination the parsing is successful if the chart contains a complete patch for S whose in puts and outputs entries are the input and output tie-points of the input graph." |
| }, |
| "FIGREF2": { |
| "type_str": "figure", |
| "num": null, |
| "uris": null, |
| "text": "l +A \u2022 Q \u2022 T K+ M -l if patch partial and not in chart { = ANl if patch chosen is already present in the chart N + l < ANl + (K + M) . R2QT K+ M+A -l + QR if patch complete and not in chart CN + I {: CN if patch chosen is already present in the chart CN if patch chosen is partial and not in the chart CN + l if patch chosen is complete and not in the chart PN + I {: PN if patch chosen is already present in the chart PN + l if patch chosen is partial and not in the chart PN if patch chosen is complete and not in the chart Figure 15: The bottom-up case, the N + 1 th iteration" |
| }, |
| "FIGREF3": { |
| "type_str": "figure", |
| "num": null, |
| "uris": null, |
| "text": "=number of complete patches in the\u2022 chart after iteration N PN =number of partial patches in the chart after iteration N AN =length of agenda after iteration N Then in the top-down case we have: 1The equation for the (N + l) th iteration is inFig ure 14. In the bottom-up case we have (N + l) th iteration seeFigure 15." |
| }, |
| "FIGREF4": { |
| "type_str": "figure", |
| "num": null, |
| "uris": null, |
| "text": "2. The NAPEs labelled d and e in Figure 8 are recognised as forming a complete B, with 7 input given by a em new tie-point 8, and output given by a new tie-point 9, satisfy-" |
| }, |
| "TABREF0": { |
| "type_str": "table", |
| "html": null, |
| "content": "<table/>", |
| "text": "", |
| "num": null |
| }, |
| "TABREF1": { |
| "type_str": "table", |
| "html": null, |
| "content": "<table><tr><td>.</td><td>\u2022 \u2022</td></tr><tr><td>2. inputs( A) -</td><td/></tr></table>", |
| "text": "", |
| "num": null |
| } |
| } |
| } |
| } |