File Information
File: 05-lr/acl_arc_1_sum/cleansed_text/xml_by_section/metho/99/p99-1013_metho.xml
Size: 20,891 bytes
Last Modified: 2025-10-06 14:15:25
<?xml version="1.0" standalone="yes"?> <Paper uid="P99-1013"> <Title>Compositional Semantics for Linguistic Formalisms</Title> <Section position="4" start_page="0" end_page="98" type="metho"> <SectionTitle> 2 Grammar semantics </SectionTitle> <Paragraph position="0"> Viewing grammars as formal entities that share many features with computer programs, it is 9{} natural to consider the notion of semantics of ratification-based formalisms. We review in this se(:tion the operational definition of Shieber et a,1. (1995) and the denotational definition of, e.g., Pereira and Shieber (1984) or Carpenter (1992, pp. 204-206). We show that these definitions are equivalent and that none of them supports compositionality.</Paragraph> <Section position="1" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 2.1 Basic notions </SectionTitle> <Paragraph position="0"> W(, assume familiarity with theories of feature structure based unification grammars, as formulated by, e.g., Carpenter (1992) or Shieber (1992). Grammars are defined over typed featwre .structures (TFSs) which can be viewed as generalizations of first-order terms (Carpenter, 1991). TFSs are partially ordered by subsumption, with +- the least (or most general) TFS. A multi-rooted structure (MRS, see Sikkel (1997) ()r Wintner and Francez (1999)) is a sequence of TFSs, with possible reentrancies among diffi;rent elements in the sequence. Meta-variables A,/3 range over TFSs and a, p - over MRSs.</Paragraph> <Paragraph position="1"> MRSs are partially ordered by subsumption, den()ted '__', with a least upper bound operation ()f 'an'llfication, denoted 'U', and a greatest lowest t)(mnd denoted 'W. We assume the existence of a. fixed, finite set WORDS of words. A lexicon associates with every word a set of TFSs, its category. Meta-variable a ranges over WORDS and .w -- over strings of words (elements of WORDS*).</Paragraph> <Paragraph position="2"> Grammars are defined over a signature of types and features, assumed to be fixed below.</Paragraph> <Paragraph position="3"> Definition 1. A rule is an MRS of length greater than or equal to 1 with a designated (fir'st) element, the head o.f the rule. The rest of the elements .form the rule's body (which may be em, pty, in which case the rule is depicted a.s' a TFS). A lexicon is a total .function .from WORDS to .finite, possibly empty sets o.f TFSs.</Paragraph> <Paragraph position="4"> A grammar G = (TC/,/:, A s} is a .finite set of ,rules TO, a lexicon PS. and a start symbol A s that is a TFS.</Paragraph> <Paragraph position="5"> Figure 1 depicts an example grammar, 1 suppressing the underlying type hierarchy. 2 The definition of unification is lifted to MRSs: let a,p be two MRSs of the same length; the 'Grammars are displayed using a simple description language, where ':' denotes feature values.</Paragraph> <Paragraph position="6"> 2Assmne that in all the example grammars, the types s, n, v and vp are maximal and (pairwise) inconsistent.</Paragraph> <Paragraph position="8"> to a TFS A with respect to a gram, mar G (denoted (At,...,Ak) ~(-~ A) 'li~' th, ere exists a rule p E T~ such, that (B,131,...,B~:) = p ll (_L, A1,..., Ak) and B V- A. Wll, en G is understood from. the context it is om, itted. Reduction can be viewed as the bottom-up counterpart of derivation.</Paragraph> <Paragraph position="9"> If f, g, are flmctions over the same (set) domain, .f + g is )~I..f(I) U .q(I). Let ITEMS = {\[w,i,A,j\] \[ w E WORDS*, A is a TFS and i,j E {0,1,2,3,...}}. Let Z = 2 ITEMS. Meta-variables x, y range over items and I - over sets of items. When 27 is ordered by set inclusion it forms a complete lattice with set union as a least upper bound (lub) operation. A flmction</Paragraph> <Paragraph position="11"> function T is monotone it has a least fixpoint (Tarski-Knaster theorem); if T is also continuous, the fixpoint can be obtained by iterative application of T to the empty set (Kleene theorem): lfp(T) = TSw, where TI&quot; 0 = 0 and T t n = T(T t (n- 1)) when 'n is a successor ordinal and (_Jk<n(T i&quot; n) when n is a limit ordinal.</Paragraph> <Paragraph position="12"> When the semantics of programming languages are concerned, a notion of observables is called for: Ob is a flmction associating a set of objects, the observables, with every program.</Paragraph> <Paragraph position="13"> The choice of semantics induces a natural equivalence operator on grammars: given a semantics 'H', G1 ~ G2 iff ~GI~ = ~G2~. An essential requirement of any semantic equivalence is that it be correct (observables-preserving): if G1 -G2, then Ob(G1) = Ob(G2).</Paragraph> <Paragraph position="14"> Let 'U' be a composition operation on grammars and '*' a combination operator on denorations. A (correct) semantics 'H' is compo.s'itional (Gaifinan and Shapiro, 1989) if whenever ~1~ : ~G2~ and ~G3\] -- ~G4\], also ~G, U G3~ = \[G2 U G4\]. A semantics is commutative (Brogi et al., 1992) if ~G1 UG2\] = ~G,~ * \[G2~. This is a stronger notion than (:ompositionality: if a semantics is commutative with respect to some operator then it is compositional. null</Paragraph> </Section> <Section position="2" start_page="0" end_page="0" type="sub_section"> <SectionTitle> 2.2 An operational semantics </SectionTitle> <Paragraph position="0"> As Van Emden and Kowalski (1976) note, &quot;to define an operational semantics for a programruing language is to define an implementational independent interpreter for it. For predicate logic the proof procedure behaves as such an interpreter.&quot; Shieber et al. (1995) view parsing as a. deductive process that proves claims about the grammatical status of strings from assumptions derived from the grammar. We follow their insight and notation and list a deductive system for parsing unification-based grammars.</Paragraph> <Paragraph position="1"> Definition 3. The deductive parsing system associated with a grammar G = (7~,F.,AS} is defined over ITEMS and is characterized by: Axioms: \[a, i, A, i + 1\] i.f B E Z.(a) and B K A; \[e, i, A, i\] if B is an e-rule in T~ and B K_ A Goals: \[w, 0, A, \[w\]\] where A ~ A s Inference rules: \[wx , i l , A1, ill,..., \[Wk, ik, Ak , Jk \] \[Wl &quot; &quot; &quot; Wk, i, A, j\] if .'h = i1,+1 .for 1 <_ l < k and i = il and J = Jk and (A1,...,Ak) =>a A When an item \[w,i,A,j\] can be deduced, applying k times the inference rules associz~ted with a grammar G, we write F-~\[w, i, A, j\]. When the number of inference steps is irrelevant it is omitted. Notice that the domain of items is infinite, and in particular that the number of axioms is infinite. Also, notice that the goal is to deduce a TFS which is subsumed by the start symbol, and when TFSs can be cyclic, there can be infinitely many such TFSs (and, hence, goals) - see Wintner and Francez (1999).</Paragraph> <Paragraph position="2"> Definition 4. The operational denotation o.f a grammar G is EG~o,, = {x IF-v; :,:}. G1 -op G2 iy \]C1 o, = G2Bo , We use the operational semantics to define the language generated by a grammar G:</Paragraph> <Paragraph position="4"> that a language is not merely a set of strings; rather, each string is associated with a TFS through the deduction procedure. Note also that the start symbol A ' does not play a role in this definition; this is equivalent to assuming that the start symbol is always the most general TFS, _k.</Paragraph> <Paragraph position="5"> The most natural observable for a grammar would be its language, either as a set of strings or augmented by TFSs. Thus we take Ob(G) to be L(G) and by definition, the operational semantics '~.\] op' preserves observables.</Paragraph> </Section> <Section position="3" start_page="0" end_page="98" type="sub_section"> <SectionTitle> 2.3 Denotational semantics </SectionTitle> <Paragraph position="0"> In this section we consider denotational semantics through a fixpoint of a transformational operator associated with grammars. -This is essentially similar to the definition of Pereira and Shieber (1984) and Carpenter (1992, pp. 204206). We then show that the denotational semantics is equivalent to the operational one.</Paragraph> <Paragraph position="1"> Associate with a grammar G an operator 7~ that, analogously to the immediate consequence operator of logic programming, can be thought of as a &quot;parsing step&quot; operator in the context of grammatical formalisms. For the following discussion fix a particular grammar G = (n,E,A~).</Paragraph> <Paragraph position="2"> Definition 5. Let Tc : Z -+ Z be a transformation on sets o.f items, where .for every I C_ ITEMS, \[w,i,A,j\] E T(~(I) iff either * there exist Yl,...,yk E I such that Yl = \[w1,,iz,Al,jt\] .for&quot; 1 < 1 <_ k and il+l = jz for 1 < l < k and il = 1 and jk = J and (A1,... ,Ak) ~ A and w = &quot;w~ .. * wk; or * i =j andB is an e-rule in G andB K A and w = e; or * i+l =j and \[w\[ = 1 andB G 12(w) and BKA.</Paragraph> <Paragraph position="3"> For every grammar G, To., is monotone and continuous, and hence its least fixpoint exists and l.fp(TG) = TG $ w. Following the paradigm of logic programming languages, define a fixpoint semantics for unification-based grammars by taking the least fixpoint of the parsing step operator as the denotation of a grammar.</Paragraph> <Paragraph position="4"> Definition 6. The fixpoint denotation of a grammar G is ~G\[.fp = l.fp(Ta). G1 =--.fp G2 iff ~ti,( T<; ~ ) = l fp(Ta~).</Paragraph> <Paragraph position="5"> The denotational definition is equivalent to the operational one: Theorem 1. For x E ITEMS, X E lfp(TG) iff ~-(? x.</Paragraph> <Paragraph position="6"> The proof is that \[w,i,A,j\] E Ta $ n iff F-7;,\[w, i, A, j\], by induction on n.</Paragraph> <Paragraph position="7"> Corollary 2. The relation '=fp' is correct: whenever G1 =.fp G2, also Ob(G1) = Ob(a2).</Paragraph> </Section> <Section position="4" start_page="98" end_page="98" type="sub_section"> <SectionTitle> 2.4 Compositionality </SectionTitle> <Paragraph position="0"> While the operational and the denotational semantics defined above are standard for complete grammars, they are too coarse to serve as a model when the composition of grammars is concerned. When the denotation of a grammar is taken to be ~G\]op, important characteristics of the internal structure of the grammar are lost. To demonstrate the problem, we introduce a natural composition operator on grammars, namely union of the sets of rules (and the lexicons) in the composed grammars.</Paragraph> <Paragraph position="1"> Definition 7. /f GI = <TC/1, ~1, A~) and G2 = (7-~2,E'2,A~) are two grammars over the same signature, then the union of the two grammars, denoted G1 U G2, is a new grammar G = (T~, PS, AS> such that T~ = 7~ 1 (.J 7&quot;~2, ft. = ff~l + ff~2 and A s = A~ rq A~.</Paragraph> <Paragraph position="2"> Figure 2 exemplifies grammar union. Observe that for every G, G', G O G' = G' O G.</Paragraph> <Paragraph position="3"> * Proposition 3. The equivalence relation '=op' is not compositional with respect to Ob, {U}.</Paragraph> <Paragraph position="4"> Proof. Consider the grammars in figure 2.</Paragraph> <Paragraph position="6"> compositional with respect to Ob, {tO}. \[\]</Paragraph> <Paragraph position="8"> The implication of the above proposition is that while grammar union might be a natural, well defined syntactic operation on grammars, the standard semantics of grannnars is too coarse to support it. Intuitively, this is because when a grammar G1 includes a particular rule p that is inapplicable for reduction, this rule contributes nothing to the denotation of the grammar. But when G1 is combined with some other grammar, G2, p might be used for reduction in G1 U G2, where it can interact with the rules of G2. We suggest an alternative, fixpoint based semantics for unification based grammars that naturally supports compositionality.</Paragraph> </Section> </Section> <Section position="5" start_page="98" end_page="100" type="metho"> <SectionTitle> 3 A compositional semantics </SectionTitle> <Paragraph position="0"> To overcome the problems delineated above, we follow Mancarella and Pedreschi (1988) in considering the grammar transformation operator itself (rather than its fixpoint) as the denota- null G is ffGffa I = Ta. G1 -at G2 iff Tal = TG2.</Paragraph> <Paragraph position="1"> Not only is the algebraic semantics compositionM, it is also commutative with respect to grammar union. To show that, a composition operation on denotations has to be defined, and we tbllow Mancarella and Pedreschi (1988) in its definition: Tc;~ * To;., = ),LTc, (~) u Ta2 (5 Theorem 4. The semantics '==-at ' is commutative with respect to grammar union and '*': for e, vcry two grammars G1, G2, \[alffat&quot; ~G2ffal = :G I \[-J G 2 ff (tl .</Paragraph> <Paragraph position="2"> Proof. It has to be shown that, for every set of</Paragraph> <Paragraph position="4"> either of the three clauses in the definition of Ta.</Paragraph> <Paragraph position="5"> - if x is added by the first clause then there is a rule p G 7~1 U T~2 that licenses the derivation through which z is added. Then either p E 7~1 or p G T~2, but in any case p would have licensed the same derivation, so either ~ Ta~ (I) or * ~ Ta~ (I).</Paragraph> <Paragraph position="6"> - if x is added by the second clause then there is an e-rule in G1 U G2 due to which x is added, and by the same rationale either x C TG~(I) or x E TG~(I).</Paragraph> <Paragraph position="7"> - if x is added by the third clause then there exists a lexical category in PS1 U PS2 due to which x is added, hence this category exists in either PS1 or PS2, and therefore x C TG~ (I) U TG2 (I).</Paragraph> <Paragraph position="8"> \[\] Since '==-at' is commutative, it is also compositional with respect to grammar union. Intuitively, since TG captures only one step of the computation, it cannot capture interactions among different rules in the (unioned) grammar, and hence taking To: to be the denotation of G yields a compositional semantics.</Paragraph> <Paragraph position="9"> The Ta operator reflects the structure of the grammar better than its fixpoint. In other words, the equivalence relation induced by TG is finer than the relation induced by lfp(Tc). The question is, how fine is the '-al' relation? To make sure that a semantics is not too fine, one usually checks the reverse direction.</Paragraph> <Paragraph position="10"> Definition 9. A fully-abstract equivalence relation '-' is such that G1 =- G'2 'i,.\[.-f .for all G, Ob(G1 U G) = Ob(G.e U G).</Paragraph> <Paragraph position="11"> Proposition 5. Th, e semantic equivalence relation '--at' is not fully abshuct.</Paragraph> <Paragraph position="12"> Proof. Let G1 be the grammar</Paragraph> <Paragraph position="14"> only difference between GUG1 and GUG2 is the presence of the rule (cat : up) -+ (cat : up) in the former. This rule can contribute nothing to a deduction procedure, since any item it licenses must already be deducible.</Paragraph> <Paragraph position="15"> Therefore, any item deducible with G U G1 is also deducible with G U G2 and hence</Paragraph> <Paragraph position="17"> A better attempt would have been to consider, instead of TG, the fbllowing operator as the denotation of G: \[G\]i d = AI.Ta(I) U I. In other words, the semantics is Ta + Id, where Id is the identity operator. Unfortunately, this does not solve the problem, as '~'\]id' is still not fully-abstract.</Paragraph> </Section> <Section position="6" start_page="100" end_page="101" type="metho"> <SectionTitle> 4 A fully abstract semantics </SectionTitle> <Paragraph position="0"> We have shown so far that 'Hfp' is not compositional, and that 'Hid' is compositional but not fully abstract. The &quot;right&quot; semantics, therefore, lies somewhere in between: since the choice of semantics induces a natural equivalence on grammars, we seek an equivalence that is cruder thzm 'Hid' but finer than 'H.fp'. In this section we adapt results from Lassez and Maher (1984) a.nd Maher (1988) to the domain of unificationb~Lsed linguistic formalisms.</Paragraph> <Paragraph position="1"> Consider the following semantics for logic programs: rather than taking the operator assodated with the entire program, look only at the rules (excluding the facts), and take the meaning of a program to be the function that is obtained by an infinite applications of the operator associated with the rules. In our framework, this would amount to associating the following operator with a grammar: Definition 10. Let RG : Z -~ Z be a transformation on sets o.f items, where .for every \[ C ITEMS, \[w,i,A,j\] E RG(I) iff there exist Yl,...,Yk E I such that yl = \[wz,it,Al,jd .for 1 _ < l _ < k and il+t = jl .for 1 < l < k and i, = 1 and.jk = J and (A1,...,Ak) ~ A and &quot;~1) ~ 'tl) 1 * * * ?U k.</Paragraph> <Paragraph position="2"> Th, e functional denotation of a grammar G is /\[G~.f,,, = (Re + Id) ~ = End-0 (RG + Id) n. Notice that R w is not RG &quot;\[ w: the former is a function &quot;d from sets of items to set of items; the latter is a .set of items.</Paragraph> <Paragraph position="3"> Observe that Rc is defined similarly to Ta (definition 5), ignoring the items added (by Ta) due to e-rules and lexical items. If we define the set of items I'nitc to be those items that are a.dded by TG independently of the argument it operates on, then for every grammar G and every set of items I, Ta(I) = Ra(I) U Inita. Relating the functional semantics to the fixpoint one, we tbllow Lassez and Maher (1984) in proving that the fixpoint of the grammar transformation operator can be computed by applying the fimctional semantics to the set InitG.</Paragraph> <Paragraph position="4"> Definition 11. For G = (hg,PS,A~), Initc = {\[e,i,A,i\] \[ B is an e~-rule in G and B E_A} U {\[a,i,A,i + 1J I B E PS(a) .for B E A} Theorem 6. For every grammar G, (R.c + fd.) (z',,.itcd = tb(TG) Proof. We show that tbr every 'n., (T~ + Id) n = (E~.-~ (Re + Id) ~:) (I'nit(;) by induction on Tt.</Paragraph> <Paragraph position="5"> For n = 1, (Tc + Id) ~\[ 1 = (Tc~ + Id)((Ta + Id) ~ O) = (Tc, + Id)(O). Clearly, the only items added by TG are due to the second and third clauses of definition 5, which are exactly Inita. Also, (E~=o(Ra + Id)~:)(Initc;) = (Ra + Id) deg (Initc) = I'nitc;.</Paragraph> <Paragraph position="6"> Assume that the proposition holds tbr n- 1, that is, (To + Id) &quot;\[ (',, - 1) = t~E'&quot;-2t~'a:=0 txta + The choice of 'Hfl~' as the semantics calls for a different notion of' observables. The denotation of a grammar is now a flmction which reflects an infinite number of' applications of the grammar's rules, but completely ignores the e-rules and the lexical entries. If we took the observables of a grammar G to be L(G) we could in general have ~G1\].f,. = ~G2\]fl~. but Ob(G1) 7 ~ Ob(G2) (due to different lexicons), that is, the semantics would not be correct. However, when the lexical entries in a grammar (including the erules, which can be viewed as empty categories, or the lexical entries of traces) are taken as input, a natural notion of observables preservation is obtained. To guarantee correctness, we define the observables of a grammar G with respect to a given input.</Paragraph> <Paragraph position="7"> Definition 12. Th, e observables of a grammar G = (~,/:,A s} with respect to an input set of items I are Ot, (C) = {(',,,,A) I \[w,0, d, I 1\] e Corollary 7. The semantics '~.~.f ' is correct: 'llf G1 =fn G2 then .for every I, Obl(G1) = Ol, ( a,e ).</Paragraph> <Paragraph position="8"> The above definition corresponds to the previous one in a natural way: when the input is taken to be Inita, the observables of a grammar are its language.</Paragraph> <Paragraph position="9"> .To show that the semantics 'Hfn' is compositional we must define an operator for combining denotations. Unfortunately, the simplest operator, '+', would not do. However, a different operator does the job. Define ~Gl~.f~ * \[G2~f~ to</Paragraph> <Paragraph position="11"> tive (and hence compositional) with respect to ~*' and 'U'.</Paragraph> <Paragraph position="12"> Theorem 9. fiG1 U G2~fn = ~Gl\]fn &quot; ~G2~.fn. The proof is basically similar to the case of logic programming (Lassez and Maher, 1984) and is detailed in Wintner (1999).</Paragraph> <Paragraph position="13"> Theorem 10. The semantics '~'\[fn' is fully abstract: ,for every two grammars G1 and G2, 'llf .for&quot; every grammar G and set of items I, Obr(G1 U G) = ObI(G2 U G), then G1 =fn G2.</Paragraph> <Paragraph position="14"> The proof is constructive: assuming that G t ~f;~ G2, we show a grammar G (which det)ends on G1 and G2) such that Obt(G1 U G) C/ Obr(G2 U G). For the details, see Wintner (1999).</Paragraph> </Section> class="xml-element"></Paper>