{ "paper_id": "P95-1014", "header": { "generated_with": "S2ORC 1.0.0", "date_generated": "2023-01-19T08:34:03.307622Z" }, "title": "", "authors": [ { "first": "Mark", "middle": [], "last": "Johnson", "suffix": "", "affiliation": {}, "email": "" }, { "first": "Mark_Johnson~brown", "middle": [], "last": "Edu", "suffix": "", "affiliation": {}, "email": "" }, { "first": "Jochen", "middle": [], "last": "Dsrre", "suffix": "", "affiliation": {}, "email": "" } ], "year": "", "venue": null, "identifiers": {}, "abstract": "Some linguistic constraints cannot be effectively resolved during parsing at the location in which they are most naturally introduced. This paper shows how constraints can be propagated in a memoizing parser (such as a chart parser) in much the same way that variable bindings are, providing a general treatment of constraint coroutining in memoization. Prolog code for a simple application of our technique to Bouma and van Noord's (1994) categorial grammar analysis of Dutch is provided.", "pdf_parse": { "paper_id": "P95-1014", "_pdf_hash": "", "abstract": [ { "text": "Some linguistic constraints cannot be effectively resolved during parsing at the location in which they are most naturally introduced. This paper shows how constraints can be propagated in a memoizing parser (such as a chart parser) in much the same way that variable bindings are, providing a general treatment of constraint coroutining in memoization. Prolog code for a simple application of our technique to Bouma and van Noord's (1994) categorial grammar analysis of Dutch is provided.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Abstract", "sec_num": null } ], "body_text": [ { "text": "As the examples discussed below show, some linguistic constraints cannot be effectively resolved during parsing at the location in which they are most naturally introduced. In a backtracking parser, a natural way of dealing with such constraints is to coroutine them with the other parsing processes, reducing them only when the parse tree is sufficiently instantiated so that they can be deterministically resolved. Such parsers are particularly easy to implement in extended versions of Prolog (such as Pro-loglI, SICStus Prolog and Eclipse) which have such coroutining facilities built-in. Like all backtracking parsers, they can exhibit non-termination and exponential parse times in situations where memoizing parsers (such as chart parsers) can terminate in polynomial time. Unfortunately, the coroutining approach, which requires that constraints share variables in order to communicate, seems to be incompatible with standard memoization techniques, which *This research was largely conducted at the Institut ffir maschinelle Sprachverarbeitung in Stuttgart. We would like to thank Andreas Eisele, Pascal van Hentenryck, Martin Kay, Fernando Pereira, Edward Stabler and our colleagues at the Institut ffir maschinelle Sprachverarbeitung for helpful comments and suggestions. All remaining errors are our own. The Prolog code presented in this paper is available via anonymous ftp from Ix.cog.brown.edu as/pub/lernrna.tar.Z require systematic variable-renaming (i.e., copying) in order to avoid spurious variable binding.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Introduction", "sec_num": "1" }, { "text": "For generality, conciseness and precision, we formalize our approach to memoization and constraints within H6hfeld and Smolka's (1988) general theory of Constraint Logic Programming (CLP), but we discuss how our method can be applied to mote standard chart parsing as well. This paper extends our previous work reported in DSrre (1993) and Johnson (1993) by generalizing those methods to arbitrary constraint systems (including feature-structure constraints), even though for reasons of space such systems are not discussed here.", "cite_spans": [ { "start": 107, "end": 134, "text": "H6hfeld and Smolka's (1988)", "ref_id": null }, { "start": 323, "end": 335, "text": "DSrre (1993)", "ref_id": "BIBREF2" }, { "start": 340, "end": 354, "text": "Johnson (1993)", "ref_id": "BIBREF5" } ], "ref_spans": [], "eq_spans": [], "section": "Introduction", "sec_num": "1" }, { "text": "This section reviews Bouma and van Noord's (1994) (BN henceforth) constraint-based categorial grammar analysis of modification in Dutch, which we use as our primary example in this paper. However, the memoizing CLP interpreter presented below has also been applied to GB and HPSG parsing, both of which benefit from constraint coroutining in parsing. BN can explain a number of puzzling scope phenomena by proposing that heads (specifically, verbs) subcategorize for adjuncts as well as arguments (rather than allowing adjuncts to subcategorize for the arguments they modify, as is standard in Categorial Grammar). For example, the first reading of the Dutch sentence", "cite_spans": [ { "start": 21, "end": 49, "text": "Bouma and van Noord's (1994)", "ref_id": "BIBREF0" } ], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "(1) Frits opzettelijk Marie lijkt te ontwijken deliberately seems avoid 'Fritz deliberately seems to avoid Marie' 'Fritz seems to deliberately avoid Marie' is obtained by the analysis depicted in Figure 1 . The other reading of this sentence is produced by a derivation in which the adjunct addition rule 'A' adds an adjunct to lijkt re, and applies vacuously to ontwijken.", "cite_spans": [], "ref_spans": [ { "start": 196, "end": 204, "text": "Figure 1", "ref_id": null } ], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "It is easy to formalize this kind of grammar in pure Prolog. In order to simplify the presentation of the proof procedure interpreter below, we write clauses Marie opzettelijk NP2 VPI\\ADV\\NP2", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "lijkt te VPt / VP. ___. __. ___~I A ontwijken", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "(VPI\\ADV\\ VPI\"/yP1pI\\ADV\\NP2)NP2)/D(V D v(V~NP2)VP'\\NP2 A Frits ADV VPt\\ADV NP1 VP1", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "Figure 1: The BN analysis of (1). In this derivation 'VPI' abbreviates 'S\\NPI', 'A' is a lexieal rule which adds adjuncts to verbs, 'D' is a lexical 'division' rule which enables a control or raising verb to combine with arguments of higher arity, and 'D' is a unary modal operator which diacritically marks infinitival verbs.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "as 'H : :-B' where H is an atom (the head) and B is a list of atoms (the negative literals).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "The atom x (Cat, Left, Right) is true iff the substring between the two string positions Left and Right can be analyzed as belonging to category Cat.", "cite_spans": [ { "start": 11, "end": 29, "text": "(Cat, Left, Right)", "ref_id": null } ], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "(As is standard, we use suffixes of the input string for string positions).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "The modal operator '~' is used to diacritically mark untensed verbs (e.g., ontwijken), and prevent them from combining with their arguments. Thus untensed verbs must combine with other verbs which subcategorize for them (e.g., lijkt re), forcing all verbs to appear in a 'verb cluster' at the end of a clause. For simplicity we have not provided a semantics here, but it is easy to add a 'semantic interpretation' as a fourth argument in the usual manner. The forward and backward application rules are specified as clauses of x/3. Note that the application rules are left-recursive, so a top-down parser will in general fail to terminate with such a grammar.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": ":-op(990, xfx, ::-). :-op(400, yfx, \\ ). :-op(300, fy, # ).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Lexical rules in Categorial Grammar", "sec_num": "2" }, { "text": "X Modal operator b' x(X, Left, Right) ::-[ ~ Forward application x(X/Y, Left, Mid), x(Y, Mid, Right) ]. x(X, Left, Right) ::-[ ~ Backward application x(Y, Left, Mid), x(X\\Y, Mid, Right) ]. x(I, [Word[Words], Words) ::-[ lex(Word, X) ].", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "X Clause operator X Backward combinator", "sec_num": null }, { "text": "Lexical entries are formalized using a two place relation lex(W0rd, Cat), which is true if Cat is a category that the lexicon assigns to Word. Note that the definitions of add_adjuncSs/2 and division/2 are recursive, and have an infinite number of solutions when only their first arguments are instantiated. This is necessary because the number of adjuncts that can be associated with any given verb is unbounded. Thus it is infeasible to enumerate all of the categories that could be associated with a verb when it is retrieved from the lexicon, so following BN, we treat the predicates add_adjlmcts/2 and division/2 as coroutined constraints which are only resolved when their second arguments become sufficiently instantiated. As noted above, this kind of constraint coroutining is built-in to a number of Prolog implementations. Unfortunately, the left recursion inherent in the combinatory rules mentioned earlier dooms any standard backtracking top-down parser to nontermination, no matter how coroutining is applied to the lexical constraints. As is well-known, memoizing parsers do not suffer from this deficiency, and we present a memoizing interpreter below which does terminate.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "X Clause operator X Backward combinator", "sec_num": null }, { "text": "The Lemma Table proof procedure This section presents a coroutining, memoizing CLP proof procedure. The basic intuition behind our approach is quite natural in a CLP setting like the one of HShfeld and Smolka, which we sketch now. A program is a set of definite clauses of the form", "cite_spans": [], "ref_spans": [ { "start": 10, "end": 31, "text": "Table proof procedure", "ref_id": null } ], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "p(x) ql(Xl) ^... ^ q.(X.) ^ \u00a2", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "where the Xi are vectors of variables, p(X) and qi(Xi) are relational atoms and \u00a2 is a basic constraint coming from a basic constraint language C. \u00a2~ will typically refer to some (or all) of the variables mentioned. The language of basic constraints is closed under conjunction and comes with (computable) notions of consistency (of a constraint) and entailment (\u00a21 ~c \u00a22) which have to be invariant under variable renaming} Given a program P and a goal G, which is a conjunction of relational atoms and constraints, a P-answer of G is defined as a consistent basic constraint \u00a2 such that \u00a2 --+ G is valid in every model of P. SLD-resolution is generalized in this setting by performing resolution only on relational atoms and simplifying (conjunctions of) basic constraints thus collected in the goal list. When finally only a consistent basic constraint remains, this is an answer constraint \u00a2. Observe that this use of basic constraints generalizes the use of substitutions in ordinary logic programming and the (simplification of a) conjunction of constraints generalizes unification. Actually, pure Prolog can be viewed as a syntactically sugared variant of such a CLP language with equality constraints as basic constraints, where a standard Prolog clause", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "p(T) ~-ql (T,),..., qn (T,)", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "is seen as an abbreviation for a clause in which the equality constraints have been made explicit by means of new variables and new equalities", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "p(X) ,---X=T, XI--T,,...,Xn=T,, q,(x,,).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "Here the Xl are vectors of variables and the T/ are vectors of terms. Now consider a standard memoizing proof procedure such as Earley Deduction (Pereira and Warren 1983) or the memoizing procedures described by Tamaki and Sato (1986) , Vieille (1989) or Warren (1992) from this perspective. Each memoized goal is associated with a set of bindings for its arguments; so in CLP terms each memoized goal is a 1This essentially means that basic constraints can be recast as first-order predicates. conjunction of a single relational atom and zero or more equality constraints. A completed (i.e., atomic) clause p(T) with an instantiated argument T abbreviates the non-atomic clause p(X) ~ X -T, where the equality constraint makes the instantiation specific. Such equality constraints are 'inherited' via resolution by any clause that resolves with the completed clause.", "cite_spans": [ { "start": 145, "end": 170, "text": "(Pereira and Warren 1983)", "ref_id": "BIBREF6" }, { "start": 212, "end": 234, "text": "Tamaki and Sato (1986)", "ref_id": "BIBREF8" }, { "start": 237, "end": 251, "text": "Vieille (1989)", "ref_id": "BIBREF9" } ], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "In the CLP perspective, variable-binding or equality constraints have no special status; informally, all constraints can be treated in the same way that pure Prolog treats equality constraints. This is the central insight behind the Lemma Table proof procedure: general constraints are permitted to propagate into and out of subcomputations in the same way that Earley Deduction propagates variable bindings. Thus the Lemma Table proof procedure generalizes Earley Deduction in the following ways:", "cite_spans": [], "ref_spans": [ { "start": 424, "end": 435, "text": "Table proof", "ref_id": null } ], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "1. Memoized goals are in general conjunctions of relational atoms and constraints. This allows constraints to be passed into a memoized subcomputation.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "We do not use this capability in the categorial grammar example (except to pass in variable bindings), but it is important in GB and HPSG parsing applications. For example, memoized goals in our GB parser consist of conjunctions of X' and ECP constraints. Because the X' phrase-structure rules freely permit empty categories every string has infinitely many wellformed analyses that satisfy the X' constraints, but the conjoined ECP constraint rules out all but a very few of these empty nodes. 2. Completed clauses can contain arbitrary negative literals (rather than just equality constraints, as in Earley Deduction). This allows constraints to be passed out ofa memoized subcomputation.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "In the categorial grammar example, the add_adjuncts/2 and division/2 associated with a lexical entry cannot be finitely resolved, as noted above, so e.g., a clause . is classified as a completed clause; the add_adjuncts/2 constraint in its body is inherited by any clause which uses this lemma. Subgoals can be selected in any order (Earley Deduction always selects goals in left-to-right order). This allows constraint eoroutining within a memoized subcomputation. In the categorial grammar example, a category becomes more instantiated when it combines with arguments, allowing eventually the add_adjuncts/2 and division/2 to be deterministically resolved. Thus we use the flexibility in the selection of goals to run constraints whenever their arguments are sufficiently instantiated, and delay them otherwise.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "4. Memoization can be selectively applied (Earley Deduction memoizes every computational step). This can significantly improve overall efficiency. In the categorial grammar example only x/3 goals are memoized (and thus only these goals incur the cost of table management).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "The 'abstraction' step, which is used in most memoizing systems (including complex feature grammar chart parsers where it is somewhat confusingly called 'restriction', as in Shieber 1985) , receives an elegant treatment in a CLP approach; an 'abstracted' goal is merely one in which not all of the equality constraints associated with the variables appearing in the goal are selected with that goal. 2 For example, because of the backward application rule and the left-to-right evaluation our parser uses, eventually it will search at every left string position for an uninstantiated category (the variable Y in the clause), we might as well abstract all memoized goals of the form x(C, L, R) to x(_, L, _), i.e., goals in which the category and right string position are uninstantinted. Making the equality constraints explicit, we see that the abstracted goal is obtained by merely selecting the underlined subset of these below:", "cite_spans": [ { "start": 174, "end": 187, "text": "Shieber 1985)", "ref_id": "BIBREF7" } ], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "x(Xl,X2, X3),Xl = C, X2 = L, Xa = R.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "While our formal presentation does not discuss abstraction (since it can be implemented in terms of constraint selection as just described), because our implementation uses the underlying Prolog's unification mechanism to solve equality constraints over terms, it provides an explicit abstraction operation.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "Now we turn to the specification of the algorithm itself, beginning with the basic computational entities it uses.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "Definition 1 A (generalized) goal is a multiset of relational atoms and constraints. A (generalized) clause Ho 4--Bo is an ordered pair of generalized goals, where /fro contains at least one relational atom. A relational interpretation .4 (see HShfeld and Smolka 1988 for definition) satisfies a goal G iff .A satisfies each element of G, and it satisfies a clause H0 *---B0 iff either .A fails to satisfy some element of B0 or .A satisfies each element of H0.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "2After this paper was accepted, we discovered that a more general formulation of abstraction is required for systems using a hierarchy of types, such as typed feature structure constraints (Carpenter 1992) . In applications of the Lemma Table Proof Procedure to such systems it may be desirable to abstract from a 'strong' type constralnt in the body of a clause to a logically 'weaker' type constraint in the memoized goal. Such a form of abstraction cannot be implemented using the selection rule alone.", "cite_spans": [ { "start": 189, "end": 205, "text": "(Carpenter 1992)", "ref_id": "BIBREF1" } ], "ref_spans": [ { "start": 237, "end": 248, "text": "Table Proof", "ref_id": null } ], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "This generalizes the standard notion of clause by allowing the head H0 to consist of more than one atom. The head H0 is interpreted conjunctively; i.e., if each element of B0 is true, then so is each element of H0. The standard definition of resolution extends unproblematically to such clauses.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "Definition 2 We say that a clause co -H0 ~ B0 resolves with a clause cl = Ht ~--BI on a non-empty set ofliterals C C_ Bo iff there is a variant Cl ~ of el of the form C *---BI' such that V(co)NV(Bx') C V(C) (i.e., the variables common to e0 and BI ~ also appear in C, so there is no accidental variable sharing).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "If Co resolves with Cl on C, then the clause H0 ~ (B0 -C) U Bx' is called a resolvent of co with C 1 On C. Now we define items, which are the basic computational units that appear on the agenda and in the lemma tables, which record memoized subcomputations. item is a pair (t, c) where c is a clause and t is a tag, i.e., one of program, solution or table(B) for some goal B. A lemma table for a goal G is a pair (G, La) where La is a finite list of items.", "cite_spans": [], "ref_spans": [ { "start": 258, "end": 279, "text": "item is a pair (t, c)", "ref_id": null } ], "eq_spans": [], "section": "3", "sec_num": null }, { "text": "The algorithm manipulates a set T of lemma tables which has the property that the first components of any two distinct members of T are distinct. This justifies speaking of the (unique) lemma table in T for a goal G.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 3 An", "sec_num": null }, { "text": "Tags are associated with clauses by a userspecified control rule, as described below. The tag associated with a clause in an item identifies the operation that should be performed on that clause. The solution tag labels 'completed' clauses, the program tag directs the proof procedure to perform a nonmemoizing resolution of one of the clanse's negative literals with program clauses (the particular negative literal is chosen by a user-specified selection rule, as in standard SLD resolution), and the table(B) tag indicates that a subcomputation with root goal B (which is always a subset of the clause's negative literals) should be started.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 3 An", "sec_num": null }, { "text": "Definition 4 A control rule is a function from clauses G *--B to one of program, solution or table(C) for some goal C C B. A selection rule is a function from clauses G *--B where B contains at least one relational atom to relational atoms a, where a appears in B.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 3 An", "sec_num": null }, { "text": "Because program steps do not require memoization and given the constraints on the control rule just mentioned, the list LG associated with a lemma table (G, LG) will only contain items of the form (t, G ,--B) where t is either solution or table(C) for some goal C C_ B.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 3 An", "sec_num": null }, { "text": "Input A non-empty goal G, a program P, a selection rule S, and a control rule R.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 5 To add an item an item e = (t, H ~ B) to its table means to replace the table (H, L) in T with (H, JelL]).", "sec_num": null }, { "text": "Output A set of goals G' for which RiG' ) = solution and P ~ G *--G'.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 5 To add an item an item e = (t, H ~ B) to its table means to replace the table (H, L) in T with (H, JelL]).", "sec_num": null }, { "text": "Global Data Structures A set T of lemma tables and a set A of items called the agenda.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "Definition 5 To add an item an item e = (t, H ~ B) to its table means to replace the table (H, L) in T with (H, JelL]).", "sec_num": null }, { "text": "Until A is empty, do: Remove an item e = it, c) from A. Case t of program For each clause p E P such that c resolves with p on S(c), choose a corresponding resolvent e' and add iRic'), c') to A. Table algorithm The formal description of the Lemma Table proof procedure is given in Figure 2 . We prove the soundness and completeness of the proof procedure in DSrre and Johnson (in preparation). In fact, soundness is easy to show, since all of the operations are resolution steps. Completeness follows from the fact that Lemma Table proofs can be 'unfolded' into standard SLD search trees (this unfolding is wellfounded because the first step of every table-initiated subcomputation is required to be a program resolution), so completeness follows from HShfeld and Smolka's completeness theorem for SLD resolution in CLP.", "cite_spans": [], "ref_spans": [ { "start": 195, "end": 210, "text": "Table algorithm", "ref_id": null }, { "start": 247, "end": 258, "text": "Table proof", "ref_id": null }, { "start": 281, "end": 289, "text": "Figure 2", "ref_id": "FIGREF3" } ], "eq_spans": [], "section": "Algorithm Set T := {(G, 0)} and A := ((program, G *--G)}.", "sec_num": null }, { "text": "Returning to the categorial grammar example above, the control rule and selection rule are specified by the Prolog code below, which can be informally described as follows. All x/3 literals are classified as 'memo' literals, and add_adjuncts/2 and division/2 whose second arguments are not sufficiently instantiated are classified as 'delay' literals.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "If the clause contains a memo literal G, then the control rule returns tablei [G] ). Otherwise, if the clause contains any non-delay literals, then the control rule 3In order to handle the more general form of abstraction discussed in footnote 2 which may be useful with typed feature structure constraints, replace B with a(B) in this step, where a(B) is the result of applying the abstraction operation to B.", "cite_spans": [ { "start": 78, "end": 81, "text": "[G]", "ref_id": null } ], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "The abstraction operation should have the property that a(B) is exactly the same as B, except that zero or more constraints in B are replaced with logically weaker constraints.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "returns program and the selection rule chooses the left-most such literal. If none of the above apply, the control rule returns solution. To simplify the interpreter code, the Prolog code for the selection rule and tableiG ) output of the control rule also return the remaining literals along with chosen goal.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": ":-ensure_loaded(library(lists)).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": ": -op(990, fx, [delay, memo] x(A, [l_t, o], B) ~--x(A, [l_t, o] x(A, [o], B) ~ x(A, [o], S) . x(A, [o], B) *--x(A/C, [o], D), x(C, D, B) . x(A, [o], B) ~--x(C, [o], D), x(A\\C, D, S) . x(A, [o], 4) ~-lex(o, A) . x(#A, [o], ~) ~-add(s\\np\\np, A) . x(A, [l_t, o], 0) ~'-add(s\\np\\np, S), add(s\\np/(s\\np), C), div(C, A/B) .", "cite_spans": [], "ref_spans": [ { "start": 2, "end": 28, "text": "-op(990, fx, [delay, memo]", "ref_id": null }, { "start": 29, "end": 63, "text": "x(A, [l_t, o], B) ~--x(A, [l_t, o]", "ref_id": null }, { "start": 64, "end": 91, "text": "x(A, [o], B) ~ x(A, [o], S)", "ref_id": null }, { "start": 94, "end": 136, "text": "x(A, [o], B) *--x(A/C, [o], D), x(C, D, B)", "ref_id": null }, { "start": 139, "end": 181, "text": "x(A, [o], B) ~--x(C, [o], D), x(A\\C, D, S)", "ref_id": null }, { "start": 184, "end": 208, "text": "x(A, [o], 4) ~-lex(o, A)", "ref_id": null }, { "start": 211, "end": 242, "text": "x(#A, [o], ~) ~-add(s\\np\\np, A)", "ref_id": null }, { "start": 245, "end": 315, "text": "x(A, [l_t, o], 0) ~'-add(s\\np\\np, S), add(s\\np/(s\\np), C), div(C, A/B)", "ref_id": null } ], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "x(A, [Lt, o], B) *--add(s\\np\\np, C), add(s\\np/(s\\np), D), div(D, A/E/C), x(E, Q, B). x(A, 0, B) ~-x(A, 0, B). x(A, 0, B) ~-x(A/C, Q, D), x(C, D, B). x(h, 4, B) +--x(C, 4, D), x(A\\C, D, B). x(A, [l_t, o], B) ~--add(s\\np\\np, C), add(s\\np/(s\\np), D), div(D, E/C), x(A\\E, ~, B). x(A, [o], B) ~--add(s\\np\\np, C), x(A\\#C, ~, B). x(A, [l_t, o], B) ~ add(s\\np/(s\\np), C), div(C, D/E), x(A\\(D/#E), [o], B).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "Figure 3: The items produced during the proof of x(\u00a2, [lijkLte,on~wijkenJ ,=) using the control and selection rules specified in the text. The prefix t.n[a] T identifies the table t to which this item belongs, assigns this item a unique identifying number n, provides the number(s) of the item(s) a which caused this item to be created, and displays its tag T (P for 'program', T for 'table' and S for 'solution'). The selected literal(s) are shown underlined. To save space, 'add_adjuncts' is abbreviated by 'add', 'division' by 'div', 'lijkt_te' by 'It', and 'ontwijken' by 'o'. Figure 3 depicts the proof of a parse of the verb cluster in (1). Item 1 is generated by the initial goal; its sole negative literal is selected for program resolution, producing items 2-4 corresponding to three program clauses for x/3. Because items 2 and 3 contain 'memo' literals, the control rule tags them table; there already is a table for a variant of these goals (after abstraction). Item 4 is tagged program because it contains a negative literal that is not 'memo' or 'delay'; the resolution of this literal with the program clauses for lex/3 produces item 5 containing the constraint literals associated with lijkt re. Both of these are classified as 'delay' literals, so item 5 is tagged solution, and both are 'inherited' when item 5 resolves with the table-tagged items 2 and 3, producing items 6 (corresponding to a right application analysis with lijkt te as functor) and item 19 (corresponding to a left application analysis with ont. wijken as functor) respectively. Item 6 is tagged table, since it contains a x/3 literal; because this goal's second argument (i.e., the left string position) differs from that of the goal associated with table 0, a new table (table 1) is constructed, with item 7 as its first item.", "cite_spans": [], "ref_spans": [ { "start": 581, "end": 589, "text": "Figure 3", "ref_id": null }, { "start": 1718, "end": 1770, "text": "goal associated with table 0, a new table (table 1)", "ref_id": "TABREF0" } ], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "The three program clauses for x/3 are used to resolve the selected literal in item 7, just as in item 1, yielding items 8-10. The lex/3 literal in item 10 is resolved with the appropriate program clause, pro-ducing item 11. Just as in item 5, the second argument of the single literal in item 11 is not sufficiently instantiated, so item 11 is tagged solution, and the unresolved literal is 'inherited' by item 12. Item 12 contains the partially resolved analysis of the verb complex. Items 13-16 analyze the empty string; notice that there are no solution items for table 2. Items 17-19 represent partial alternative analyses of the verb cluster where the two verbs combine using other rules than forward application; again, these yield no solution items, so item 12 is the sole analysis of the verb cluster.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A worked example", "sec_num": "4" }, { "text": "This section describes an implementation of the Lemma Table proof procedure in Prolog, designed for simplicity rather than efficiency. Tables are stored in the Prolog database, and no explicit agenda is used. The dynamic predicate goal_Cable(G, I) records the initial goals G for each table subcomputation and that table's identifying index I (a number assigned to each table when it is created). The dynamic predicate table_solution(I, S) records all of the solution items generated for table I so far, and table_paxent(I, T) records the table items T, called 'parent items' below, which are 'waiting' for additional solution items from table I.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "The 'top level' goal is prove(G, Cs), where G is a single atom (the goal to be proven), and Cs is a list of (unresolved) solution constraints (different solutions are enumerated through backtracking). prove/2 starts by retracting the tables associated with previous computations, asserting the table entry associated with the initial goal, and then calls take_action/2 to perform a program resolution on the initial goal. After all succeeding steps are complete, prove/2 returns the solutions associated with table 0. The predicate take_action(L, C, I) processes items. L is the item's label, C its clause and I is the index of the table it belongs to. The first clause calls complete/2 to resolve the solution clause with any parent items the table may have, and the third clause constructs a parent item term (which encodes both the clause, the tabled goal, and the index of the table the item belongs to) and calls insert_into_table/2 to insert it into the appropriate table.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "take_action(solution, Clause, Index) :assert (Cable_solution(Index, Clause)), findall(P, gable_parent (Index, P), Paren\u00a2Items), member (ParentIgem, ParenCItems), complete (ParentItem, Clause). take_acCion(proEram , Head: :-Goal, Index) :selection(Goal, Selected, Bodyl), Selected : :-HodyO, append(BodyO, Bodyl, Body), control(Body, Action), take_action(Action, Head: :-Body, Index). take_action(table(Goal, Other), Head : : -_Body, Index) :ins err_into_table (Goal, \u00a2ableItem(Head, Goal, Other, Index)).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "complete/2 takes an item labeled table and a clause, resolves the head of the clause with the item, and calls control/2 and take_action/3 to process the resulting item.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "complete(tableItem(Head, Goal, Body1, Index), Goal: :-BodyO) :append(BodyO, Bodyl, Body), control (Body, Action), take_action(Action, Head: :-Body, Index).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "The first clause insert_into_table/2 checks to see if a table for the goal to be tabled has already been constructed (numbervars/3 is used to ground a copy of the term). If an appropriate table does not exist, the second clause calls create_table/3 to construct one.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "insert_into_table(Goal, ParentItem) :-copy_term(Goal, GoalCopy), numbervars (GoalCopy, O, _), goal_table (GoalCopy, Index), !, assert (table_parent (Index, ParentIgem) ), findall(Sol, table_solution(Index, Sol), Solutions), !, member(Solutlon, Solutions), complege(ParengItem, SQlugion). insert_into_table (GoalO, ParentICem) :absgraction(GoalO, Goal), !, create_gable(Goal, ParengItem, Index), \u00a2ake_action(proEram, Goal: :-Goal, Index).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "create_table/3 performs the necessary database manipulations to construct a new table for the goal, assigning a new index for the table, and adding appropriate entries to the indices.", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "create_table(Goal, ParentI\u00a2~, Index) :-(retract(councer(IndexO)) -> true ; IndexO=O), Index is IndexO+l, assert (counter (Index)), assert(goal_table(Goal , Index)), as sert (table_parent (Index, ParentItem) ).", "cite_spans": [], "ref_spans": [], "eq_spans": [], "section": "A simple interpreter", "sec_num": "5" }, { "text": "This paper has presented a general framework which allows both constraint coroutining and memoizstion. To achieve maximum generality we stated the Lemma Table proof procedure in HShfeld and Smolka's (1988) CLP framework, but the basic idea--that arbitrary constraints can be allowed to propagate in essentially the same way that variable bindings do--can be applied in most approaches to complex feature based parsing. For example, the technique can be used in chart parsing: in such a system an edge consists not only of a dotted rule and associated variable bindings (i.e., instantiated feature terms), but also contains zero or more as yet unresolved constraints that are propagated (and simplified if sufficiently instantiated) during application of the fundamental rule. At a more abstract level, the identical propagation of both variable bindings and more general constraints leads us to question whether there is any principled difference between them. While still preliminary, our research suggests that it is often possible to reexpress complex feature based grammars more succinctly by using more general constraints.", "cite_spans": [ { "start": 186, "end": 205, "text": "and Smolka's (1988)", "ref_id": "BIBREF4" } ], "ref_spans": [ { "start": 153, "end": 185, "text": "Table proof procedure in HShfeld", "ref_id": null } ], "eq_spans": [], "section": "Conclusion", "sec_num": "6" } ], "back_matter": [], "bib_entries": { "BIBREF0": { "ref_id": "b0", "title": "Constraint-Based Categorial Grammar", "authors": [ { "first": "G", "middle": [], "last": "Bouma", "suffix": "" }, { "first": "G", "middle": [], "last": "Van Noord", "suffix": "" } ], "year": 1994, "venue": "Proceedings of the 3Pnd Annual Meeting of the ACL, New Mexico State University", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "G. Bouma and G. van Noord. Constraint-Based Ca- tegorial Grammar. In Proceedings of the 3Pnd An- nual Meeting of the ACL, New Mexico State Uni- versity, Las Cruces, New Mexico, 1994.", "links": null }, "BIBREF1": { "ref_id": "b1", "title": "The Logic of Typed Feature Structures. Cambridge Tracts in Theoretical Computer Science 32", "authors": [ { "first": "B", "middle": [], "last": "Carpenter", "suffix": "" } ], "year": 1992, "venue": "", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "B. Carpenter. The Logic of Typed Feature Structu- res. Cambridge Tracts in Theoretical Computer Science 32. Cambridge University Press. 1992.", "links": null }, "BIBREF2": { "ref_id": "b2", "title": "Computational Aspects of Constraint-Based Linguistic Description I, DYANA-2 deliverable RI.~.A. ESPRIT, Basic Research Project 6852", "authors": [ { "first": "J", "middle": [], "last": "Dsrre", "suffix": "" } ], "year": 1993, "venue": "", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "J. DSrre. Generalizing Earley deduction for constraint-based grammars. In J. D6rre (ed.), Computational Aspects of Constraint-Based Linguistic Description I, DYANA-2 deliverable RI.~.A. ESPRIT, Basic Research Project 6852, July 1993.", "links": null }, "BIBREF3": { "ref_id": "b3", "title": "Memoization and coroutined constraints, ms. Institut fiir maschinelle Sprachverarbeitung", "authors": [ { "first": "J", "middle": [], "last": "Dsrre", "suffix": "" }, { "first": "M", "middle": [], "last": "Johnson", "suffix": "" } ], "year": null, "venue": "", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "J. DSrre and M. Johnson. Memoization and co- routined constraints, ms. Institut fiir maschinelle Sprachverarbeitung, Universit~it Stuttgart.", "links": null }, "BIBREF4": { "ref_id": "b4", "title": "Definite Relations over Constraint Languages", "authors": [ { "first": "M", "middle": [], "last": "Hshfeld", "suffix": "" }, { "first": "G", "middle": [], "last": "Smolka", "suffix": "" }, { "first": ";", "middle": [], "last": "Iwbs", "suffix": "" }, { "first": "", "middle": [], "last": "Deutschland", "suffix": "" } ], "year": 1988, "venue": "LILOG Report", "volume": "53", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "M. HShfeld and G. Smolka. Definite Relations over Constraint Languages. LILOG Report 53, IWBS, IBM Deutschland, Postfach 80 08 80, 7000 Stutt- gart 80, W. Germany, October 1988. (available on-line by anonymous ftp from /duck.dfki.uni- sb.de:/pub/papers)", "links": null }, "BIBREF5": { "ref_id": "b5", "title": "Presented at First Workshop on Principles and Practice of Constraint Programming", "authors": [ { "first": "M", "middle": [], "last": "Johnson", "suffix": "" } ], "year": 1993, "venue": "", "volume": "", "issue": "", "pages": "", "other_ids": {}, "num": null, "urls": [], "raw_text": "M. Johnson. Memoization in Constraint Logic Programming. Presented at First Workshop on Principles and Practice of Constraint Program- ming, April P8-30 1993, Newport, Rhode Island.", "links": null }, "BIBREF6": { "ref_id": "b6", "title": "Parsing as Deduction", "authors": [ { "first": "F", "middle": [ "C" ], "last": "Pereira", "suffix": "" }, { "first": "D", "middle": [ "H" ], "last": "Warren", "suffix": "" } ], "year": 1983, "venue": "Proceedings of the Plst Annual Meeting of the ACL, Massachusetts Institute of Technology", "volume": "", "issue": "", "pages": "137--144", "other_ids": {}, "num": null, "urls": [], "raw_text": "F. C. Pereira and D. H. Warren. Parsing as Deduc- tion. In Proceedings of the Plst Annual Meeting of the ACL, Massachusetts Institute of Technology, pp. 137-144, Cambridge, Mass., 1983.", "links": null }, "BIBREF7": { "ref_id": "b7", "title": "Using Restriction to Extend Parsing Algorithms for Complex-Feature-Based Formalisms", "authors": [ { "first": "M", "middle": [], "last": "Shieber", "suffix": "" } ], "year": 1985, "venue": "Proceedings of the 23rd Annual Meeting of the Association for Computational Linguistics", "volume": "", "issue": "", "pages": "145--152", "other_ids": {}, "num": null, "urls": [], "raw_text": "M. Shieber. Using Restriction to Extend Par- sing Algorithms for Complex-Feature-Based For- malisms. In Proceedings of the 23rd Annual Mee- ting of the Association for Computational Lingui- stics, pp. 145-152, 1985.", "links": null }, "BIBREF8": { "ref_id": "b8", "title": "OLDT resolution with tabulation", "authors": [ { "first": "H", "middle": [], "last": "Tamaki", "suffix": "" }, { "first": "T", "middle": [], "last": "Sato", "suffix": "" } ], "year": 1986, "venue": "Proceedings of Third International Conference on Logic Programming", "volume": "", "issue": "", "pages": "84--98", "other_ids": {}, "num": null, "urls": [], "raw_text": "Tamaki, H. and T. Sato. \"OLDT resolution with tabulation\", in Proceedings of Third Internatio- nal Conference on Logic Programming, Springer- Verlag, Berlin, pages 84-98. 1986.", "links": null }, "BIBREF9": { "ref_id": "b9", "title": "Recursive query processing: the power of logic", "authors": [ { "first": "L", "middle": [], "last": "Vieille", "suffix": "" } ], "year": 1989, "venue": "Theoretical Computer Science", "volume": "69", "issue": "", "pages": "1--53", "other_ids": {}, "num": null, "urls": [], "raw_text": "Vieille, L. \"Recursive query processing: the power of logic\", Theoretical Computer Science 69, pages 1- 53. 1989.", "links": null }, "BIBREF10": { "ref_id": "b10", "title": "Memoing for logic programs", "authors": [ { "first": "D", "middle": [ "S" ], "last": "Warren", "suffix": "" } ], "year": 1992, "venue": "Communications of the ACM", "volume": "35", "issue": "3", "pages": "94--111", "other_ids": {}, "num": null, "urls": [], "raw_text": "Warren, D. S. \"Memoing for logic programs\", in Communications of the ACM 35:3, pages 94-111. 1992.", "links": null } }, "ref_entries": { "FIGREF0": { "type_str": "figure", "uris": null, "text": "lex('Frits', np) ::-~. lex('Marie', np) ::-[]. lex(opzettelijk, adv) ::-D. lex(ont2ijken, #I ) ::-[ add_adjunots(s~np~np, I ) ]. lex(lijkt_te, I / #Y ) ::-[ add_adjuncts((s\\np)/(s\\np), IO), division(IO, I/Y ) ]. The add_adjuncts/2 and division/2 predicates formalize the lexical rules 'A' (which adds adjuncts to verbs) and 'D' (the division rule). division(XO/YO, (I\\Z)/(Y\\Z)) ::-[ division(IO/YO, I/Y) ].", "num": null }, "FIGREF1": { "type_str": "figure", "uris": null, "text": "x(#X, [onl:wijken], r-I) ::-[ add_adjuncl;s(s\\np\\np, Z ) ].", "num": null }, "FIGREF2": { "type_str": "figure", "uris": null, "text": "variant of H and c' resolves with c on H', choose a corresponding resolvent d' and add (R(d'), d') to A. Set r := {B: (solution, G *--B) E L,/G, L) E T}.", "num": null }, "FIGREF3": { "type_str": "figure", "uris": null, "text": "The Lemma", "num": null }, "FIGREF4": { "type_str": "figure", "uris": null, "text": "Because we do not represent variable binding as explicit constraints, we cannot implement 'abstraction' by means of the control rule and require an explicit abstraction operation. The abstraction operation here unbinds the first and third arguments of x/3 goals, as discussed above.abetraction([x(_,Left,_)], [x(_,Left,_)]).", "num": null }, "FIGREF5": { "type_str": "figure", "uris": null, "text": ", B).x(A, [l_t, o], B) ~--x(A/C, [l_t, o], D), x(C, D, B). x(A, [l_t, o], B) ~ x(C, [l_t, o], D), x(A\\C, D, B).", "num": null }, "FIGREF6": { "type_str": "figure", "uris": null, "text": ", Constraints) :-table_solution(O, [Goal] : :-Constraints).", "num": null }, "TABREF0": { "content": "
B) Add e to its table, s
If T contains a table (B', L) where B' is a variant of B then for each item (solution, d) E L such
that c resolves with d on B choose a corresponding resolvent d' and add iR(c\"), d') to A.
Otherwise, add a new table i B, \u00a2) to T, and add (program, B ~--B) to the agenda.
solution Add e to its table.
Let e = H ~ B. Then for each item of the form (tabh(H'), d) in any table in T where H' is a
", "num": null, "type_str": "table", "text": "", "html": null } } } }