ANLP Tutorial Worksheet for Week 9 (v1.2) WITH SOLUTIONS

Sharon Goldwater (School of Informatics, University of Edinburgh)

Exercise 1

Consider the following “world” (knowledge base):

\(cat(Zoot)\) \(owns(Mary, Zoot)\) \(walks(Spot)\)
\(cat(Whiskers)\) \(owns(Mary, Spot)\) \(walks(Whiskers)\)
\(dog(Spot)\) \(owns(Li, Whiskers)\) \(walks(Mary, Zoot)\)
\(brown(Spot)\) \(walks(Li, Spot)\)
\(brown(Zoot)\)

Give the denotation of each of the following FOL expressions with respect to this world.

  1. owns(Li, Zoot)

  2. owns(Mary, x)

  3. walks/2

  4. dog/1

  5. dog(Zoot) \(\Rightarrow\) walks(Zoot)

  6. \(\forall x.\) cat(x) \(\Rightarrow\) walks(x)

  7. \(\forall x. \forall y.\) walks(x, y) \(\Rightarrow\) walks(y)

  8. \(\exists x. \forall y.\) walks(x, y) \(\Rightarrow\) walks(y)

Solutions

  1. False

  2. \(\{Zoot, Spot\}\)

  3. \(\{(Mary, Zoot), (Li, Spot)\}\)

  4. \(\{Spot\}\) (note this is a set, not just an entity)

  5. True (because the antecedent is false)

  6. False

  7. False

  8. True

Exercise 2

Convert the following FOL expressions into natural language sentences.

  1. \(\forall x. rabbit(x) \Rightarrow furry(x)\)

  2. \(\exists e. help(e) \wedge helper(e, Franz) \wedge helpee(e, Marie)\)

  3. \(\exists e. x. eating(e) \wedge sandwich(x) \wedge eater(e, Liang) \wedge eaten(e, x)\)

  4. \(\exists e. x. y. eating(e) \wedge sandwich(x) \wedge fork(y) \wedge eater(e, Liang) \wedge eaten(e, x) \wedge instrument(e, y)\)

For the next two, try to come up with relatively natural-sounding English sentences that unambiguously express the meaning of each expression. First consider what the difference is between the two!

  1. \(\forall x. student(x) \Rightarrow \exists e. lifting(e) \wedge lifter(e, x) \wedge liftee(e, Marie)\)

  2. \(\exists e. lifting(e) \wedge \forall x. student(x) \Rightarrow lifter(e, x) \wedge liftee(e, Marie)\)

Solutions

  1. All rabbits are furry

  2. Franz helps Marie

  3. Liang eats a sandwich

  4. Liang eats a sandwich with a fork

  5. Each student lifts Marie. [Notice there is a separate lifting event for each student. So it could also be stated as “All the students (separately) lift Marie”. But simply saying “All the students lift Marie” is ambiguous because that sentence could also have the MR in (f).]

  6. The students all lift Marie together. [Notice that here there is a single lifting event for all students.]

Exercise 3

Convert the following natural language sentences into FOL expressions. Use reified event semantics. If a sentence is ambiguous, list all possible interpretations and give paraphrases of the different meanings.

  1. Fiona hates Ewan

  2. Partha eats pizza

  3. Every student likes Juan

  4. Some student likes every class

  5. Ella sees herself

  6. Ella dances every Tuesday

Solutions

  1. \(\exists e. hating(e) \wedge hater(e, Fiona) \wedge hatee(e, Ewan)\)

  2. There are two meanings, though not due to any form of ambiguity we’ve discussed before. The ambiguity here is caused by the verb. (a) Partha is currently eating a pizza: \(\exists e. eating(e) \wedge eater(e, Partha) \wedge \exists x. pizza(x) \wedge eaten(e, x)\) (or perhaps we might want to think of “pizza” as a mass noun and treat it as an entity, yielding \(\exists e. eating(e) \wedge eater(e, Partha) \wedge eaten(e, pizza)\)). OR (b) Partha habitually or in principle eats pizza: It is much less clear how to translate this sentence into FOL, since our usual event semantics assume the existence of a single event with particular properties. In this case there are potentially many (or no) actual pizza-eating events. (I don’t know how a semanticist would deal with this case, but to me it seems to share some of the same problems as so-called generic statements like “birds can fly” or “cats are furry”, whose semantics are very much a subject of research.)

  3. \(\forall x. student(x) \Rightarrow \exists e. liking(e) \wedge liker(e, x) \wedge likee(e, Juan)\) (Note that placing the \(\exists e\) outside the \(\forall x\) would be a bit weird: it suggests that all students participate in a single collective liking event.

  4. Quantifier scope ambiguity leads to two meanings. (a) There is a single student who likes all classes: \(\exists x. student(x) \wedge \forall y. class(y) \Rightarrow \exists e. liking(e) \wedge liker(e, x) \wedge likee(e, y)\) OR (b) Each class is liked by at least one student: \(\forall x. class(x) \Rightarrow \exists y. student(y) \wedge \exists e. liking(e) \wedge liker(e, y) \wedge likee(e, x)\)

  5. \(\exists e. seeing(e) \wedge seer(e, Ella) \wedge seen(e, Ella)\)

  6. \(\forall x. Tuesday(x) \Rightarrow \exists e. dancing(e) \wedge dancer(e, Ella) \wedge time(e,x)\) (or perhaps replace the final conjunct with something like \(during(e,x)\)).

Exercise 4

Suppose we have the following grammar fragment with semantic attachments. Grammar rules are numbered to help you refer to them in discussion.

# Syntactic Rule Semantic attachment
1. Det \(\rightarrow\) a \(\lambda P. \lambda Q. \exists x. P(x) \wedge Q(x)\)
2. Det \(\rightarrow\) the \(\lambda P. \lambda Q. \exists! x. P(x) \wedge Q(x)\)
3. N\(\rightarrow\)dog \(\lambda x. dog(x)\)
4. N\(\rightarrow\)park \(\lambda x. park(x)\)
5. NP\(\rightarrow\)Sam \(\lambda P. P(Sam)\)
6. NP\(\rightarrow\)Spot \(\lambda P. P(Spot)\)
7. P\(\rightarrow\)in \(\lambda P. \lambda Q \lambda x. P(\lambda y. in(x,y)) \wedge Q(x)\)
8. Vi\(\rightarrow\)walks \(\lambda x. \exists e. walking(e) \wedge walker(e, x)\)
9. Vi\(\rightarrow\)sees \(\lambda x. \exists e. seeing(e) \wedge seer(e, x)\)
10. Vt\(\rightarrow\)walks \(\lambda P \lambda x. P(\lambda y. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, y))\)
11. Vt\(\rightarrow\)sees \(\lambda P \lambda x. P(\lambda y. \exists e. seeing(e) \wedge seer(e, x) \wedge seen(e, y))\)
12. Nom \(\rightarrow\) N N.sem
13. Nom \(\rightarrow\) Nom PP PP.sem(Nom.sem)
14. NP \(\rightarrow\) Det Nom Det.sem(Nom.sem)
15. PP \(\rightarrow\) P NP P.sem(NP.sem)
16. VP \(\rightarrow\) Vi Vi.sem
17. VP \(\rightarrow\) Vt NP Vt.sem(NP.sem)
18. VP \(\rightarrow\) VP PP PP.sem(VP.sem)
19. S \(\rightarrow\) NP VP NP.sem(VP.sem)
  1. Show how the meanings of Sam sees and The dog walks are built up using this grammar. (Note: the \(\exists!\) symbol in the MR for the means “there exists a unique”—where the uniqueness is normally assumed to be determined by context. In other words, “the dog walks” would be true if there is a dog that walks, and it is the only dog currently salient to the speaker. One could argue whether this is a good enough semantics, but it will do for us here.)

  2. Why are the transitive verb meanings so much more complicated than their intransitive counterparts? That is, why didn’t we define the meaning of walks to be just \[\lambda y. \lambda x. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, y)?\] (Hint: what happens when you combine the Vt with the object NP?)

  3. Consider the following pairs of sentences:

    1. “Sam walks Spot”, “Sam walks”
    2. “Sam sees Spot”, “Sam sees”

    Hint: If you are having trouble deriving the MRs for these sentences using the grammar, can you see what they are supposed to be? If so, you may be still able to answer this question, although computing the MRs will give you practice with complicated lambda reductions.

  4. (Optional challenge question) Compute the meanings of the two different syntactic parses of the sentence “Sam sees a dog in the park”. There is a problem with one of the meanings (that is, it isn’t really correct). Identify the problem and say what the correct meaning should be. You don’t need to fix the grammar to make that meaning come out, but you may want to think about why it’s difficult to do so.

Solutions

  1. The syntactic trees are:

    In the first tree, the meanings attached to each tree node are as follows:

    In the second tree, the meanings attached to each tree node are as follows:

  2. The problem is that the semantic attachment for VP says that the Vt takes the NP as its argument. But all our NPs have meanings like \(\lambda P. (\ldots\)). If we apply the proposed simple (base-form) MR for see to something like that, we substitute the complex NP MR for \(y\) and end up with an invalid FOL expression. The solution is to type-raise the MRs for transitive verbs, just as we saw type-raising for NPs in lecture. This allows the Vt to take its NP argument and apply that NP to the base meaning of the Vt. For example, the MR for walks Spot is derived as follows. \[\begin{aligned} & (\lambda P \lambda x. P(\lambda y. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, y))[\lambda P. P(Spot)] \\ &=(\lambda P \lambda x. P(\lambda y. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, y))[\lambda Q. Q(Spot)]) \\ &= \lambda x. (\lambda Q. Q(Spot))[\lambda y. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, y)] \\ &= \lambda x. (\lambda y. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, y))[Spot] \\ &= \lambda x. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, Spot) \\ \end{aligned}\]

  3. We just showed how to compute the meaning of the VP in ``Sam walks Spot’’. We can combine it with the subject NP using the NP.sem(VP.sem) attachment as follows: \[\begin{aligned} & (\lambda P. P(Sam))[\lambda x. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, Spot)]\\ &= (\lambda x. \exists e. walking(e) \wedge walker(e, x) \wedge walkee(e, Spot))[Sam]\\ &= \exists e. walking(e) \wedge walker(e, Sam) \wedge walkee(e, Spot) \end{aligned}\]

    To compute the MR for ``Sam walks’’ we have: \[\begin{aligned} (\lambda P. P(Sam))[\lambda x. \exists e. walking(e) \wedge walker(e, x)]\\ &= (\lambda x. \exists e. walking(e) \wedge walker(e, x))[Sam]\\ &= \exists e. walking(e) \wedge walker(e, Sam) \end{aligned}\]

    So, according to the meaning representations, “Sam walks” is entailed by “Sam walks Spot”: in every case where the latter is true, the former will also be true. However, in common usage, this entailment does not hold. For example, I might walk a dog by standing with a leash and letting the dog run around, or by riding a bicycle with the dog on a leash. This is different from the pair “Sam sees Spot”/“Sam sees” because in this case, the second sentence really is entailed by the first one.

    The issue with “walk” is that the transitive form actually has a slightly different meaning from the intransitive form. It means something like “make someone/something walk”: the object of “walk” is the walker, not the subject. So we might consider changing the MR to something like the following, where \(y\) (which will be the object of the sentence) is now the walker instead of the walkee.

\[\begin{aligned} \lambda P \lambda x. P(\lambda y. \exists e. walking(e) \wedge walker(e, y) \wedge instigator(e, x)) \end{aligned}\]

  1. First, the analysis where PP attaches inside NP. I use subscripts so I can refer to the nodes when there are multiple ones with the same phrasal category.

    The MRs derived at each node are as follows:

    The derivation is tedious, but it is nice to see that the resulting MR is what we’d expect: the dog is in the park, and Sam sees the dog.

    I will not go through the whole derivation for the second tree, where PP attaches to VP:

    Suffice to say that it derives the following MR: \[\exists! z. park(z) \wedge in(Sam,z) \wedge \exists w. dog(w) \wedge \exists e. seeing(e) \wedge seer(e, Sam) \wedge seen(e, w)\] This is not too bad for the current sentence: Sam is in the park and sees the dog. However, it’s only accidentally right: technically the seeing event is the thing that should be in the park, not Sam. For “see” it’s hard to separate the two, but consider the syntactically identical sentence “Sam cooks a potato in the oven”. In this case it’s clear that the cooking, not Sam, is the thing “in the oven”.

    So the correct meaning should really be: \[\exists! z. park(z) \wedge \exists w. dog(w) \wedge \exists e. seeing(e) \wedge seer(e, Sam) \wedge seen(e, w) \wedge in(e,z)\]