Using Semantics in Non-Context-Free of Montague Grammar
Total Page:16
File Type:pdf, Size:1020Kb
Using Semantics in Non-Context-Free Parsing of Montague Grammar 1 David Scott Warren Department of Computer Science SUNY at Stony Brook Long Island, NY 11794 Joyce Friedman University of Michigan Ann Arbor, MI In natural language processing, the question of the appropriate interaction of syntax and semantics during sentence analysis has long been of interest. Montague grammar with its fully formalized syntax and semantics provides a complete, well-defined context in which these questions can be considered. This paper describes how semantics can be used during parsing to reduce the combinatorial explosion of syntactic ambiguity in Montague grammar. A parsing algorithm, called semantic equivalence parsing, is presented and examples of its operation are given. The algorithm is applicable to general non-context-free grammars that include a formal semantic component. The second portion of the paper places semantic equivalence parsing in the context of the very general definition of an interpreted language as a homomorphism between syntactic and semantic algebras (Montague 1970). Introduction nondeterministic syntactic program expressed as an The close interrelation between syntax and seman- ATN. The algorithm introduces equivalence parsing, tics in Montague grammar provides a good framework which is a general execution method for nondetermin- in which to consider the interaction of syntax and istic programs that is based on a recall table, a gener- semantics in sentence analysis. Several different ap- alization of the well-formed substring table. Semantic proaches are possible in this framework and they can equivalence, based on logical equivalence of formulas obtained as translations, is used. We discuss the con- be developed rigorously for comparison. In this paper sequences of incorporating semantic processing into we develop an approach called semantic equivalence the parser and give examples of both syntactic and parsing that introduces logical translation into the on- semantic parsing. In Part II the semantic parsing al- going parsing process. We compare this with our ear- gorithm is related to earlier tabular context-free recog- lier directed process implementation in which syntactic nition methods. Relating our algorithm to its prede- parsing is completed prior to translation to logical cessors gives a new way of viewing the technique. form. The algorithmic description is then replaced by a de- Part I of the paper gives an algorithm that parses a scription in terms of refined grammars. Finally we class of grammars that contains both essentially suggest how this notion might be generalized to the context-free rules and non-context-free rules as in full class of Montague grammars. Montague's 1973 PTQ. Underlying this algorithm is a The particular version of Montague grammar used here is that of PTQ, with which the reader is assumed 1 A preliminary version of this paper was presented at the to be conversant. The syntactic component of PTQ is symposium on Modelling Human Parsing Strategies at the Universi- ty of Texas at Austin, March 24-26, 1981. The work of the first an essentially context-free grammar, augmented by author was supported in part by NSF grant IST 80-10834. some additional rules of a different form. The non- Copyright 1982 by the Association for Computational Linguistics. Permission to copy without fee all or part of this material is granted provided that the copies are not made for direct commercial advantage and the Journal reference and this copyright notice are included on the first page. To copy otherwise, or to republish, requires a fee and/or specific permission. 0362-613X/82/030123-16503.00 American Journal of Computational Linguistics, Volume 8, Number 3-4, July-December 1982 123 David Scott Warren and Joyce Friedman Using Semantics in Non-Context-Free Parsing context-free aspects arise in the treatment of quantifi- system (Gawron et al. 1982) and by Rosenschein and er scope and pronouns and their antecedents. Syntac- Shieber 1982. Neither of those systems treats pro- tically each antecedent is regarded as substituted into nouns. In Montague's approach, which we follow a place marked by a variable. This is not unlike the here, the trees produced by the parser are expressions way fillers are inserted into gaps in Gazdar's 1979 in the disambiguated language, so scope is determined, treatment. However, Montague's use of variables pronoun antecedents are indicated, and each tree has a allows complicated interactions between different unique (unreduced) translation. The descriptions of variable-antecedent pairs. Each substitution rule sub- the systems that use Cooper's approach seem to imply stitutes a term phrase (NP) for one or more occurrenc- that they use a second pass over the syntax tree to es of a free variable in a phrase (which may be a sen- determine the actual quantifier scopes in the final logi- tence, common noun phrase, or intransitive verb cal forms. Were these systems to use a single pass to phrase). The first occurrence of the variable is re- produce the final logical forms, the results described in placed by the phrase; later occurrences are replaced by this paper would be directly applicable. appropriate pronouns. The translation of the resulting phrase expresses the coreferentiality of the noun 1. Equivalence Parsing phrase and the pronouns. With substitution, but with- Ambiguity out pronouns, the only function of substitution is to determine quantifier scope. Ambiguity in Montague grammar is measured by the number of different meanings. In this view syn- Directed Process Approach tactic structure is of no interest in its own right, but only as a vehicle for mapping semantics. Syntactic One computational approach to processing a sen- ambiguity does not directly correspond to semantic tence is the directed process approach, which is a se- ambiguity, and there may be many parses with the quential analysis that follows the three-part presenta- same semantic interpretation. Further, sentences with tion in PTQ. The three steps are as follows. A purely scope ambiguity, such as A man loves every woman, syntactic analysis of a sentence yields a set of parse require more than one parse, because the syntactic trees, each an expression in the disambiguated lan- derivation determines quantifier scope. guage. Each parse tree is then translated by In PTQ there is infinite syntactic ambiguity arising Montague's rules into a formula of intentional logic to from three sources: alphabetic variants of variables, which logical reductions are immediately applied. The variable for variable substitutions, and vacuous varia- reduced formulas can then be interpreted in a model. ble substitution. However, these semantically unnec- The directed process approach is the one taken in the essary constructs can be eliminated, so that the set of system described by Friedman, Moran, and Warren syntactic sources for any sentence is finite, and a par- 1978a,b. ser that finds the full set is possible. (This corre- Semantic equivalence parsing is motivated by the sponds to the "variable principle" enunciated by Jans- observation that the directed process approach, in sen 1980 and used by Landsbergen 1980.) This ap- which all of the syntactic processing is completed be- proach was the basis of our earlier PTQ parser fore any semantic processing begins, does not take (Friedman and Warren 1978). maximal advantage of the coupling of syntax and se- However, even with these reductions the number of mantics in Montague grammars. Compositionality and remaining parses for a sentence of reasonable com- the fact that for each syntactic rule there is a transla- plexity is still large compared to the number of non- tion rule suggest that it would be possible to do a equivalent translations. In the directed process ap- combined syntactic-semantic parse. In this approach, proach this is treated by first finding all the parses, as soon as a subphrase is parsed, its logical formula is next finding for each parse a reduced translation, and obtained and reduced to an extensionalized normal then finally obtaining the set of reduced translations. form. Two parses for the same phrase can then be Each reduced translation may, but does not necessari- regarded equivalent if they have the same formula. ly, represent a different sentence meaning. No mean- The approach to parsing suggested by Cooper's ings are lost. Further reductions of the set of transla- 1975 treatment of quantified noun phrases is like our tions would be possible, but the undecidability of logi- semantic equivalence parsing in storing translations as cal equivalence precludes algorithmic reduction to a one element of the tuple corresponding to a noun minimal set. phrase. Cooper's approach differs from the approach followed here because he has an intermediate stage The ATN Program that might be called an "autonomous syntax tree". In the underlying parser the grammar is expressed The frontier of the tree is the sentence; the scope of as an augmented transition network (ATN) (Woods the quantifier of a noun phrase is not yet indicated. 1973). Both the syntactic and the semantic parsers Cooper's approach has been followed by the GPSG use this same ATN. The main difficulty in construct- 124 American Journal of Computational Linguistics, Volume 8, Number 3-4, July-December 1982 David Scott Warren and Joyce Friedman Using Semantics in Non-Context-Free Parsing ing the ATN was, as usual, the non-context-free as- need to rewrite the grammar to eliminate left-recursive pects of the grammar, in particular the incorporation rules as is usually necessary. of a treatment of substitution rules and variables. The In a general nondeterministic program, a bucket in grammar given in PTQ generates infinitely many deriv- the recall table corresponds to a particular subroutine ations for each sentence. All but finitely many of and a set of values for the calling parameters and re- these are unnecessary variations on variables and were turn parameters.