File Information

File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/91/w91-0104_metho.xml

Size: 15,375 bytes

Last Modified: 2025-10-06 14:12:49

<?xml version="1.0" standalone="yes"?>
<Paper uid="W91-0104">
  <Title>Inherently Reversible Grammars, Logic Programming and Computability</Title>
  <Section position="3" start_page="24" end_page="25" type="metho">
    <SectionTitle>
4 Definite programs, unifor-
</SectionTitle>
    <Paragraph position="0"> mity of implementation, and reversibility It is sometimes stated that various grammatical formalisms, based on a variant or another of unification, are &amp;quot;reversible&amp;quot;. It should more properly be said that they are &amp;quot;well-adapted&amp;quot; to reversible grammar implementations. The paradigmatic case of a grammar given as a definite program G makes this especially clear.</Paragraph>
    <Paragraph position="1"> We know, from the discussion of SS3.1.1 and SS3.1.2, that we always have: (i) r is enumerable ?r(X#Y), produces an empty list of answers and terminates and (it) if this is not the case, then the grammar itself may serve as an enumerating program (perhaps a non-terminating one). Note that this does not entail that by looking at the grammar, one is actually able--even in principle---to decide which of these two situations actually holds! This is an extreme instance of the remark made above (in the discussion of finite enumerability of parsing) that the existence in principle of a program meeting certain criteria does not imply that it is obvious, or indeed possible, to find such a program.</Paragraph>
    <Paragraph position="2">  on 6P and (ii) r is enumerable on 66; we therefore know that there exist programs Pp and Pg which enumerate r respectively on ~P and ~G. But in fact we have more: if we use a sound and complete interpreter, we can simply take Pp = Pg = G. This follows from the fact that, by definition, relatively to such an interpreter, G enumerates rT, for any specialization T (see SS2.1.1): * G enumerates r on GP; * G enumerates r on GG.</Paragraph>
    <Paragraph position="3"> To be more concrete, suppose that we use a complete top-down interpreter; Its behavior will be along the following lines: 1. On query ?r(X#Y), the interpreter returns the (generally infinite) list of answers T~,T2,...,Tk,...</Paragraph>
    <Paragraph position="4"> where each ~ is a term of the form Ai~Bi; The (generally infinite) &amp;quot;union&amp;quot; of these terms &amp;quot;exactly covers&amp;quot; the query; 2. On a query of the form ?r(z#Y), where x is a ground term, the interpreter returns the list of answers TtU(x#Y), T2U(x#Y),..., Tk U(z#Y),...</Paragraph>
    <Paragraph position="5"> where I._1 is the operator of term unification, and where, with some abuse of notation, only the terms TitA(x#Y) for which unification is possible actually appear in the list; 3. On a query of the form ?r(X~y), where y is a ground term, the interpreter returns the list of answers T, u( X #y), T~u( X #y), . . . , TkU( X #y) .... (with the same abuse of notation as above).</Paragraph>
    <Paragraph position="6"> This is a rather striking property of definite programs: different &amp;quot;input modes&amp;quot; can be implemented using one and the same interpreter and one and the same program. (This property strongly contrasts with other programming paradigms, for instance functional or imperative ones. Programs of these types typically map an input x to an output y, and, while it is indeed true that, for a given y, the set of ~i which can serve as its input is recursively enumerable, the interpreter that could implement the (nondeterministic) mapping y ~ x would have to be widely different from the &amp;quot;normal&amp;quot; interpreter for the language at hand.) However, &amp;quot;reversibility&amp;quot; in this sense only means uniformity of implementation for different modes of use of a grammar. Intrinsic finite reversibility which is defined in the next section, gives a much stronger criterion of grammar reversibility.</Paragraph>
  </Section>
  <Section position="4" start_page="25" end_page="26" type="metho">
    <SectionTitle>
5 Inherently reversible gram-
</SectionTitle>
    <Paragraph position="0"> mars We say that a grammar G is (inherently) finitely reversible iff, in the terminology of SS3.1.1 and SS3.1.2, G is such that:  1. parsing is finitely enumerable; 2. generation is finitely enumerable. In other words, G is finitely reversible iff there exists a program Pp for parsing and a (not necessarily identical) program P9 for generation such that, relative to some sound and complete interpreter: is 1. On a query of the form ?r(x#Y), where x is any ground term, Pp returns a finite list of answers x#T1, x#T2,..., z#Tk and stops.</Paragraph>
    <Paragraph position="1"> 2. On a query of the form ?r(X#y), where y is any ground term, Pg returns a finite list of</Paragraph>
    <Paragraph position="3"> and stops.</Paragraph>
    <Paragraph position="4"> In order to guarantee that a grammar is finitely reversible, some strong assumptions must be made on its form. An example of such assumptions is provided by the class of Lezical Grammars described in \[5\]. 19 Lexical grammars are presented as definite programs. They all share the same core of rules, which describe basic compositionality assumptions (string compositionality, syntactic compositionality, semantic compositionality), but may have different lexicons, which contain all the more specific linguistic knowledge.</Paragraph>
    <Paragraph position="5"> lSIn fact, one can also take here an incomplete interpreter such as the standard Prolog interpreter stintpr. Obviously, if programs Pp and Pg exist for a sound and complete interpreter intpr, one can also find such programs P~ and P~ relative to stintpr, by simulating intpr inside stintpr. 19See also \[10\] for a related approach.</Paragraph>
    <Paragraph position="6">  The hypotheses made on string compositionality in Lexical Grammars are simply that sister constituents concatenate their strings; they entail that parsing is finitely e~numerable. The hypotheses on semantic compositignality are related to functional application and composition in categorial grammars (see e.g. \[15\]). They entail that generation is finitely enumerable.</Paragraph>
    <Paragraph position="7"> A lexical grammar G is therefore finitely reversible. This does not imply that it can be used directly for parsing and for generation, but only, as seen previously, that there exist two programs Pp and P9 implementing G respectively for parsing and for generation. These programs are each obtained by a technique of adding to the grammar some redundant knowledge--respectively a conservative guide for parsing and aconservative guide for generation--and by applying a left-recursion elimination transformation (see \[5\]).</Paragraph>
  </Section>
  <Section position="5" start_page="26" end_page="28" type="metho">
    <SectionTitle>
6 Some counter-examples to
</SectionTitle>
    <Paragraph position="0"> finite reversibility and a &amp;quot;moderation&amp;quot; condition on linguistic description Fig.1 sums up graphically some of tile relations which have been est,ablished in SS3 between tile computational problems associated with a grammar. The full arrows indicate entailments which have been established. The dotted arrows relate to a rather obvious question: What are the connections between the computational properties of parsing and those of generation? For instance, does the finite enumerability of parsing entail the finite enumerability of generation? If not, does it at least entail that g-acceptation is decidable? (The same questions can be asked in the reverse direction.) The answer is that, if no further assumptions are made (see below SS6.3), then there are no connections. To show this, we now sketch one example which shows that finite enumerability of parsing does not even entail that g-acceptation is decidable. null</Paragraph>
    <Section position="1" start_page="26" end_page="27" type="sub_section">
      <SectionTitle>
6.1 A &amp;quot;grammar&amp;quot; related to Matiya-
</SectionTitle>
      <Paragraph position="0"> sevich's theorem Matiyasevich's theorem \[2, p. 116\] provides-among other things--a negative solution to Hilbert's tenth problem: &amp;quot;Does there exist an algorithm capable of solving all diophantine equations?&amp;quot;, a diophantine equation being a multivariable polynomial in integer coefficients and whose variables range over N. 2deg Let K be a recursively enumerable, but nonrecursive, subset of N. One corollary of Matiyasevich's theorem is the following proPerty \[2, p. 127-28\]: There exists a polynomial q(zx,..., zn) in integer coefficients such that K is the set of values taken by q, for zl,..., z,~ ranging over all integers.</Paragraph>
      <Paragraph position="1"> This corollary can be exploited to give an example of a &amp;quot;grammar&amp;quot; which has a finitely enumerable parsing problem, but such that its g-acceptation problem is not decidable.</Paragraph>
      <Paragraph position="2"> Consider the relation r(x#y) which is true iff: (i) x is a string encoding any instance (for Zl,..., zn ranging over the integers) of the expression q(zl,..., zn), using the symbols 0,..., 9, '+', '*', '(', ')', etc., and (ii) y is a term encoding the integer resulting from the arithmetical evaluation of q(zl,..., zn). This relation can easily be described  by a &amp;quot;grammar&amp;quot; G: This grammar checks the welb formedness of string x, and calculates its &amp;quot;semantics&amp;quot; y.~l G has the following properties: * parsing is finitely enumerable: there is a program (namely G itself) finitely enumerating r on GP. In effect, for any string x, this programs checks z for well-formedness and calculates the (single) &amp;quot;semantics&amp;quot; y resulting from the evaluation of x.</Paragraph>
      <Paragraph position="3"> * g-acceptation is not decidable. Indeed, the problem of g-acceptation is the problem of deciding, for any given integer y, whether y is in the image of polynomial q, that is, whether y belongs to K. But K is a non-recursive set, hence the conclusion.</Paragraph>
    </Section>
    <Section position="2" start_page="27" end_page="27" type="sub_section">
      <SectionTitle>
6.2 A &amp;quot;grammar&amp;quot; related to the un-
</SectionTitle>
      <Paragraph position="0"> decidability of first-order logic I will only very broadly sketch this example, which I think may provide useful insights on the importance of constraining &amp;quot;string compositionality&amp;quot; in a grammar.</Paragraph>
      <Paragraph position="1"> Consider ordered pairs (x,y) of (ground) terms where x is a string encoding a certain first-order logic tautology, and y (the &amp;quot;semantics&amp;quot;) is a derivation of x using a certain fixed set of axiom schemata and rules of inference for a complete system of first-order logic. Let's assume for simplicity that the given rules of inference always have two premises and one conclusion. 22 A grammar G can be defined along the following general lines. The clauses of G correspond to the system's axiom schemata and rules of inference.</Paragraph>
      <Paragraph position="2"> Each clause corresponding to an axiom schema of name as defines &amp;quot;terminal constituents&amp;quot; (x, as(x)), where string z is any instance of schema as; each clause corresponding to an inference rule of name ir takes two &amp;quot;constituents&amp;quot; (xx,yl) and (x2,y2), and, if applicable (which is checked on the basis of strings Xl and x2), builds a new constituent (x, y), where x is the string obtained from xl and x2 according to it, and where y is a new derivation tree ir(x,yx, y2). We have the following properties: * generation is finitely enumerable: The generation problem is the problem, given a derivation ~1 This requires defining addition and multiplication of integers inside G, which presents no special problem.</Paragraph>
      <Paragraph position="3"> 22See for instance \[8, p. 43---44\] which describes a system having the two rules of in_ference p I pDqq and ~ (where x is free in p). The second rule has one premise, but can easily be viewed as having two, if the premise True is added to its original premise.</Paragraph>
      <Paragraph position="4"> tree y, of enumerating all formulas x that are associated with it. But y contains an explicit representation of x, so that generation is trivially finitely enumerable.</Paragraph>
      <Paragraph position="5"> p-acceptation is not decidable: The p-acceptation problem is the problem of checking if a string x can be derived from the axioms and the inference rules of the system. That is, it is the problem of checking if x is a tautology of first-order logic. By Church's undecidability result, this problem is undecidable.</Paragraph>
    </Section>
    <Section position="3" start_page="27" end_page="28" type="sub_section">
      <SectionTitle>
6.3 Under a &amp;quot;moderation&amp;quot; condition
</SectionTitle>
      <Paragraph position="0"> on linguistic description, parsing is finitely enumerable iff generation is The two counter-examples that we have just given have one property in common: the p-parameter can stay &amp;quot;small&amp;quot;, while the g-parameter grows indefinitely &amp;quot;large&amp;quot;, or conversely the g-parameter can stay small while the p-parameter grows indefinitely large. For instance, in the first counter-example, for a given value of y, there is no way to bound a priori the sizes of the integers zl,...,zn that may produce this y; in the second counter-example, there is similarly no way to bound a priori the sizes of proofs y for a given formula x.</Paragraph>
      <Paragraph position="1"> In order to characterize this phenomenon formally, we will define a notion of &amp;quot;moderation&amp;quot; for a grammar G, defined as a definite program over the Herbrand universe H. As previously r is the unary relation representing the denotational semantics of G.</Paragraph>
      <Paragraph position="2"> If a is a ground term in H, let us call size of this term, and denote by size(a), the number of nodes in a. Grammar G will be called moderate iff there exist total recursive functions f : N ~ N, and g : N ~ N, such that:</Paragraph>
      <Paragraph position="4"> We have the following property: If G is moderate, then, relative to G, parsing is finitely enumerable iff generation is (4) finitely enumerable.</Paragraph>
      <Paragraph position="5"> Let us briefly sketch the proof: Suppose that parsing is finitely enumerable, then we know (see SS3.1.4) that bi-acceptation is decidable. On the other hand, for any fixed ground term y, there are only finitely many ground terms z in H such that size(x) &lt;  g(size(y)). Therefore, we can finitely enumerate all these z's, and for each of them, decide whether r(x, y) holds. This shows that generation is finitely enumerable. The converse is proven in ,the same way.</Paragraph>
      <Paragraph position="6"> Moderation might be claimed to be a &amp;quot;natural&amp;quot; constraint to impose on grammars used for &amp;quot;legitimate&amp;quot; linguistic purposes: One might want to argue that, in natural language, complexity of expression is a rather direct reflection of complexity of meaning. For example, semantic rules which reduced &amp;quot;you love htm or you don't&amp;quot; to 'true', or * J 7&amp;quot; &amp;quot;how much is 6 times 7 . to '?x.(x = 42)' would seem to be ruled out as valid linguistic descriptions. But we will not ffirther pursue these tricky questions here.</Paragraph>
    </Section>
  </Section>
class="xml-element"></Paper>
Download Original XML