5.3.3 A Second DCG

Our first DCG works, but it only covers a tiny fragment of English. So let's try and improve it a bit.

Our first DCG works, but it only covers a tiny fragment of English. So let's try and improve it a bit.

Now, one obvious thing we could do is to add further relative pronouns, like ``that'' and ``which'', so that we could deal with such sentences as:

But making this extension is not particularly difficult. The basic point is that ``who'' can only be be used with conscious entities (such as wizards, witches, and house-elves), while ``which'' has to be used with entities that lack consciousness (such as broomsticks), while ``that'' can be used with both. So all we'd need to do is introduce a feature which could take the values consc and unconsc, mark the nouns in the lexicon appropriately, and then extend the DCG so that this information was taken into account when forming relative clauses. It's a good exercise, but We won't discuss it further.

A far more interesting extension is to add new kinds of verbs --- that is, verbs with different subcategorization patterns. In what follows we'll discuss verbs such as ``give'' which subcategorize for an NP followed by a PP.

Consider the following sentence:

``The witch gave the house-elf to Harry''.

We can relativize the NP argument of ``give'' (that is, the NP ``the house-elf'') to form:

``the house-elf who the witch gave to Harry''.

Moreover, we can also relativize the NP that occurs in the PP ``to Harry''. That is, we can take ``Harry'' out of this position, leaving the ``to'', behind to form:

``Harry, who the witch gave the house-elf to''.

We would like our DCG to handle such examples. But note --- there are also some things that the DCG should not do, namely perform multiple extraction. There are now two possible NPs that can be moved: the first argument NP, and the NP in the PP. Can both be moved at once? In some languages, yes. In English, no. That is, in English

``who the witch gave to'',

is not a well-formed relative clause (at least not if we view it as resulting from the extraction of two NPs. It could be short for ``who the witch gave something to''. In this case, the direct object would have been dropped and not extracted). So when we write our DCG, not only do we have to make sure we generate the NPs we want, we also have to make sure that we don't build NPs using multiple extraction.

Now, we can develop our previous DCG to do this --- but the result (found in dCG4Gaps2.pl ) is not something a computational linguist should be proud of. Let's take a closer look.

As we are going to need to build prepositional phrases, we need a rule to build them:

pp(Gap) --> p,np(Gap).

This says: a prepositional phrase can be built out of a preposition followed by an NP. We have used the extra argument to pass up the value of the Gap feature from the NP to the PP. So the PP will know whether the NP is an ordinary one or a gap.

We'll also need a larger lexicon: we'll add the verb ``gave'' and the preposition ``to'':

v(2) --> [gave].

p --> [to].

Now comes the crucial part: the new VP rules. We need to allow single extractions, and to rule out double extractions. Here's how this can be done --- and this is the part linguists won't like:

vp(Gap) --> v(2), np(nogap),pp(Gap).

vp(Gap) --> v(2), np(Gap),pp(nogap).

We have added two VP rules. The first rule insists that the NP argument be gap-free, but allows the possibility of a gap in the PP. The second rule does the reverse: the NP may contain a gap, but the PP may not. Either way, at least one of the VPs two arguments must be gap-free, so multiple extractions are ruled out.

Now, this does work. For example it generates such sentences as:

 s(_,[the,witch,gave,the,house-elf,to,harry],[]). 

And we can relativize in the NP argument:

 np(_,[the,house-elf,who,the,witch,gave,to,harry],[]). 

And in the PP argument:

 np(_,[harry,who,the,witch,gave,the,house-elf,to],[]). 

Moreover, the DCG refuses to accept multiple extractions, just as we wanted:

 np(_,[the,house-elf,who,the,wizard,gave],[]). 

So why would a linguist not approve of this DCG? Because we are handling one construction --- the formation of VPs using V(2) verbs --- with two rules.

The role of syntactical rules is to make a structural claim about the combination possibilities in our language. Thus there should be one rule for building VPs out of V(2) verbs, for there is only one structural possibility: V(2) verbs take an NP and a PP argument, in that order. We used two rules not because there were two possibilities, but simply to do a bit of `feature hacking': by writing two rules, we found a cheap way to rule out multiple extractions. And this is a silly way to write a grammar. As we saw when we discussed the case example, one role of features is precisely to help us minimize the number of rules we need --- so to add extra rules to control the features is sheer craziness!

There are also practical disadvantages to the use of two rules. For a start, many unambiguous sentences now receive two analyses. For example, ``The witch gave the house-elf to Harry'' is analyzed in two distinct ways.

Such a spurious analysis is a real nuisance --- natural language is ambiguous enough anyway. We certainly don't need to add to our troubles by writing DCGs in a way that guarantees that we generate too many analyses!

Furthermore, adding extra rules is just not going to work in the long run. As we add more verb types, we are going to need more and more duplicated rules. The result will be a mess, and the grammar will be ugly and hard to maintain. We need a better solution --- and there is one.


Kristina Striegnitz, Patrick Blackburn, Katrin Erk, Stephan Walter, Aljoscha Burchardt and Dimitra Tsovaltzi
Version 1.2.5 (20030212)