Compositional Semantics

These are lecture notes from my Computer Science course.

Sort of recap:

S -> NP VP
S' -> VP'(NP')

Today looking at quantified expressions; expressions with quantifiers such as ‘Everyone’.

‘Everyone sleeps’, where ‘everyone’ is the set of people, you would represent it as:

S' = forall x (person'(x) -> sleeps'(x))

So the VP' here is:

VP' = λy sleeps(y)

And the NP' (the ‘everyone’):

NP' = λP forall x (person(x) -> P(x))

Some other quantifying NPs:

nothing moved = forall x (¬move'(x))
something moved = exists x (move'(x))

Semantics of quantifying determiners

What about ‘every’ in ‘every bird flies’?

every = λP λQ  forall x (P(x) -> Q(x))

An aside:

In the lecture he applied λv λu likes(u,v) to λQ λz forall x (bird(x) -> Q(x)(z)) by applying the likes bit to the λQ, which gives you:

λz forall x (bird(x) -> (λv λu likes(u,v))(x)(z))

which then becomes:

λz forall x (bird(x) -> likes(x, z))

Semantics of sentences involving multiple quantifiers

It should still work. However the problem is that sentences involving multiple quantifiers are always ambiguous, so although it will work you might not get it right – depending on whether yo have a wide scope for ‘forall’ or a wide scope for ‘exists’.

You could solve this by having 2 different rules for different scopes, but this gets really stupid.

Encoding into a DCG

We’ve already done how to encode these semantics into a DCG in Prolog. But what about quantifiers? It doesn’t work how you might expect, you have to do it differently, but I’m not sure what.

This entry was posted in lecture, nlp. Bookmark the permalink.