File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/intro/92/c92-1057_intro.xml
Size: 5,371 bytes
Last Modified: 2025-10-06 14:05:11
<?xml version="1.0" standalone="yes"?> <Paper uid="C92-1057"> <Title>A Generalized Greibach Normal Form for Definite Clause Grammars</Title> <Section position="2" start_page="0" end_page="0" type="intro"> <SectionTitle> 1 Introduction </SectionTitle> <Paragraph position="0"> From the point of view of decidability, the parsing problem with a definite clause grammar is much more complex than the corresponding problem with a context-free grammar. The parsing problem with a context-live grammar is decidable, i.e. there exists an algorithm which determines whethex a given string is accepted or not by the grammar; t by contrast, the parsing problem with a deftnite clause grammar is undecidable, even if the auxiliary Prolog predicates are restricted to be unifications. 2 t For instance the standard top-down parsing algorithm using a GNF of the grammar.</Paragraph> <Paragraph position="1"> 2This assumption, or a similar one, is always made when the decidability proparfies of logical (or unification) grammars are studied. The reason is simple: if the auxiliary predicates are defined through an unrestricted Prolog program, there is no means of guaranteeing that calling some auxill~y predicate will not result in nontexmination, for reasons quite independent from the structure of the grammar under consideration. The In other words, there does not exist, in general, an algorithm for deciding whether a definil~ clause grammar DCGI accepts a string String, i.e. whether there exists some linguistic structure S such that DCG1 &quot;analyses String into S'. On the other hand, ander the condition that DCCx is offline-parsable, that is, under the condition that the context-free skeleton of DCG1 is not infinitely ambiguous, then the parsing problem is indeed decidable \[7\].</Paragraph> <Paragraph position="2"> The fact that the parsing problem with DCGt is decidable in theory should be carefully distinguished from the fact that a given algorithm for parsing is able to exploit this potentiality. A parsing algorithm for which this is the case, that is, an algorithm which is able, for any offline-parsable DCGx, to decide whether a given string is accepted or not by DCG1 is said to be strongly stable \[7\]. Most parsing algorithms are not strongly stable s, a notable exception being the &quot;Earley deduction&quot; algorithm \[7\], once modified according to the proposals in \[10\]. 4 Top-down implementations--and in particular the standard Prolog implementation of a DCG---are especially fragile in this respect, for they fail to terminate as soon as the grammar contains a left-recursive rule such as:</Paragraph> <Paragraph position="4"> In \[2\], automatic local transformations were performed on a DCG in order to eliminate some limited, but frequent in practice, types of left-recarsion in such a way that the resulting grammar could be directly implemented in Prolog. This initial work led us naturally to the more general question: Question: Is it possible to automatically transform an assumption that auxiliary predicates are unifications takes care of this interfering problem.</Paragraph> <Paragraph position="5"> aAn important cl~s of offline-parsable grammars---which we will call here the class of explicitly offline-parsable grammars--is the class of DCGs whose context free skeleton is a proper context-free grammar, that is, a grammar without rules of the type A ~ \[ \] (empty productions) or of the type A ~ B (chain rules) \[1\]. This subclass is much less problematic to parse than the full class of offline-parsuble DCGs (for instance a left-comer parsing algorithm will work). However, it is an easy consequence of the GGNF result that, for any offline-parsable DCG, there exists an explicitly offline-parsable DCG equivalent to it.</Paragraph> <Paragraph position="6"> AcrEs DE COLIN'G-92, NANT~.s, 23-28 hOt\]T 1992 3 6 6 PROC. OF COLING-92, NANTES, AUG. 23-28, 1992 arbitrary oflliue-parsable DUG1 into an equivalent DCG2 in such a way that the standard top-down execution of DCG2 terminates (in success or failure) for any given input string? To answer this question (in the positive), we have taken an indirect route, and, adapting to the case of definite clause grammars some of the standard techniques used to transform context-free grammars into GNF, s have established the following results: 1. Generalized Greibach Normal Form for definite clause grammars It is possible to translorm any definite clause grammar DCG1 (oflline-parsable or not) into a definite clause grammar DUG2 equivalent to DCGI~at is, assigning the same analyses to the same strings--and which is in a certain form, called the Generalized Greibach Normal Form, or GGNF, of DCG1.</Paragraph> <Paragraph position="7"> 2. Explicit representation of offline-parsability in the GGNF The offline-parsability of DCGI is equivalent to an elementary textual property of DCG2: the so-called &quot;unit subgrammar&quot; contains no cycle, i.e. no nonterminal calling itself directly or indirectly. ~ 3. Termination condition for top-down parsing with the GGNF If DCG1 is offline-parsable, and such that its auxiliary predicates it are unifications, then, for any input String, the standard top-down (Prulog) execution of DCG2 enumerates all solutions to the parsing problem for String and terminates.</Paragraph> </Section> class="xml-element"></Paper>