Computational Semantics: Lambda Calculus Semantic Analysis Problems - - PowerPoint PPT Presentation

computational semantics lambda calculus
SMART_READER_LITE
LIVE PREVIEW

Computational Semantics: Lambda Calculus Semantic Analysis Problems - - PowerPoint PPT Presentation

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University of Washington far- rar@u.washington.edu Computational Semantics: Lambda Calculus Semantic Analysis Problems One Solution: -Calculus Scott Farrar -calculus and


slide-1
SLIDE 1

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Computational Semantics: Lambda Calculus

Scott Farrar CLMA, University of Washington farrar@u.washington.edu February 24, 2010

1/37

slide-2
SLIDE 2

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Today’s lecture

1

Semantic Analysis Problems

2

One Solution: λ-Calculus λ-calculus and FOL λ-calculus and compositionality

3

The semantics of words based on syntactic category

2/37

slide-3
SLIDE 3

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Semantic analysis

Definition

Semantic analysis is the derivation of a semantic representation from a string of words (perhaps marked up with syntactic structure). In other words, map sentences of NL onto logical formulas. Map Jim loves Betty to love(JIM, BETTY ) There are several competing approaches for doing this, as there are several competing standards for the right semantic representation (use of event vs. relations).

3/37

slide-4
SLIDE 4

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Compositionality

Definition

Recall the principle of compositionality: the meaning of a complex expression is a function of the meaning of its parts. The assumption is that we should be able to assign each “part” a meaning, then build larger structures, guided by the syntax of the language. The syntax of NL and the syntax of predicate logic are similar, but ultimately not one-to-one compatible: translation between the two is a non-trivial task.

4/37

slide-5
SLIDE 5

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Event structure

A sailboat heels.

5/37

slide-6
SLIDE 6

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Event structure

A sailboat heels. ∃e ∃b [SailBoat(b) ∧ HeelingEvent(e) ∧ actor(e, b)]

5/37

slide-7
SLIDE 7

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Event structure

A sailboat heels. ∃e ∃b [SailBoat(b) ∧ HeelingEvent(e) ∧ actor(e, b)] My sailboat is on the bottom.

5/37

slide-8
SLIDE 8

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Event structure

A sailboat heels. ∃e ∃b [SailBoat(b) ∧ HeelingEvent(e) ∧ actor(e, b)] My sailboat is on the bottom. ∃e [SpatialLocating(e) ∧ theme(e, MYSB) ∧ loc(e, SEAFLOOR)]

5/37

slide-9
SLIDE 9

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Semantic attachments

Consider the problem of two-place predicates in a non-event-style semantics: we need to map Jim loves Betty to something like: love(JIM, BETTY ) .

6/37

slide-10
SLIDE 10

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Semantic attachments

Consider the problem of two-place predicates in a non-event-style semantics: we need to map Jim loves Betty to something like: love(JIM, BETTY ) . Let’s assume strict compositionality and say that the meaning of each syntactic constituent contributes to the meaning of the parent constituent. We could come up with something like XP.sem to stand for the semantics of some constituent XP.

6/37

slide-11
SLIDE 11

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Semantic attachments

Consider the problem of two-place predicates in a non-event-style semantics: we need to map Jim loves Betty to something like: love(JIM, BETTY ) . Let’s assume strict compositionality and say that the meaning of each syntactic constituent contributes to the meaning of the parent constituent. We could come up with something like XP.sem to stand for the semantics of some constituent XP.

Definition

Semantic attachment refers to the adornment of phrase structure rules with such semantic information.

6/37

slide-12
SLIDE 12

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Semantic attachments

7/37

slide-13
SLIDE 13

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

loves(JIM, BETTY )

8/37

slide-14
SLIDE 14

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem loves(JIM, BETTY )

8/37

slide-15
SLIDE 15

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem loves(JIM, BETTY )

8/37

slide-16
SLIDE 16

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem V.sem = love.sem loves(JIM, BETTY )

8/37

slide-17
SLIDE 17

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem V.sem = love.sem love.sem = love(x, y) loves(JIM, BETTY )

8/37

slide-18
SLIDE 18

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem V.sem = love.sem love.sem = love(x, y) NP.sem = NNP.sem loves(JIM, BETTY )

8/37

slide-19
SLIDE 19

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem V.sem = love.sem love.sem = love(x, y) NP.sem = NNP.sem NNP.sem = Betty.sem or Jim.sem loves(JIM, BETTY )

8/37

slide-20
SLIDE 20

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem V.sem = love.sem love.sem = love(x, y) NP.sem = NNP.sem NNP.sem = Betty.sem or Jim.sem Betty.sem = BETTY loves(JIM, BETTY )

8/37

slide-21
SLIDE 21

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Semantic attachments

Assume that the + symbol stands for the compositionality

  • perator:

S.sem = NP.sem + VP.sem VP.sem = V.sem + NP.sem V.sem = love.sem love.sem = love(x, y) NP.sem = NNP.sem NNP.sem = Betty.sem or Jim.sem Betty.sem = BETTY Jim.sem = JIM loves(JIM, BETTY )

8/37

slide-22
SLIDE 22

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Analysis problem

But what about other examples:

9/37

slide-23
SLIDE 23

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Analysis problem

But what about other examples: Betty is loved by Jim.

9/37

slide-24
SLIDE 24

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Analysis problem

But what about other examples: Betty is loved by Jim. It’s Jim who loves Betty.

9/37

slide-25
SLIDE 25

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Analysis problem

But what about other examples: Betty is loved by Jim. It’s Jim who loves Betty. Betty is the one loved by Jim.

9/37

slide-26
SLIDE 26

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Analysis problem

But what about other examples: Betty is loved by Jim. It’s Jim who loves Betty. Betty is the one loved by Jim. All clues to how the semantic representation might look are found in the syntactic structure of NL. All this, without even considering the ambiguity problem.

9/37

slide-27
SLIDE 27

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Analysis problem

The analysis problem: there is no (elegant) way to fill in the arguments of formulas at the level of semantic representation, in a way that is consistent with the syntax. In other words, there is no formal means of combining parts into wholes in standard FOL: . Even with passive verbs for example, we need to get BETTY to fill the second argument position of the predicate love(x, y).

10/37

slide-28
SLIDE 28

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

Representation problem: no way to represent the meaning for some kinds of constituents.

11/37

slide-29
SLIDE 29

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

Representation problem: no way to represent the meaning for some kinds of constituents. We can very easily express the meaning of full sentences in plain FOL. We can say that a sentence is true given some state of the world. John kissed Mary is T just in case John really did kiss Mary.

11/37

slide-30
SLIDE 30

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

Representation problem: no way to represent the meaning for some kinds of constituents. We can very easily express the meaning of full sentences in plain FOL. We can say that a sentence is true given some state of the world. John kissed Mary is T just in case John really did kiss Mary. With standard truth-conditional semantics, where the truth of propositions can either be T or F, such logical expressions have a truth value. BUT...

11/37

slide-31
SLIDE 31

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

What about constituents like VPs: kissed Opra. The semantics would something like VP.sem, or kiss(x, OPRA)

12/37

slide-32
SLIDE 32

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

What about constituents like VPs: kissed Opra. The semantics would something like VP.sem, or kiss(x, OPRA)

12/37

slide-33
SLIDE 33

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

What about constituents like VPs: kissed Opra. The semantics would something like VP.sem, or kiss(x, OPRA) But kiss(x, OPRA) has no truth value. This is because there are unbound variables: x has no connection to the

  • UD. Such open sentences are neither T or F.

12/37

slide-34
SLIDE 34

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

What about constituents like VPs: kissed Opra. The semantics would something like VP.sem, or kiss(x, OPRA) But kiss(x, OPRA) has no truth value. This is because there are unbound variables: x has no connection to the

  • UD. Such open sentences are neither T or F.

Intuitively however, we know what a NL predicate/VP means: e.g., ... kissed Opra means something like a “ kissing Opra event”, reguardless of who does the kissing.

12/37

slide-35
SLIDE 35

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Representation problem

What about constituents like VPs: kissed Opra. The semantics would something like VP.sem, or kiss(x, OPRA) But kiss(x, OPRA) has no truth value. This is because there are unbound variables: x has no connection to the

  • UD. Such open sentences are neither T or F.

Intuitively however, we know what a NL predicate/VP means: e.g., ... kissed Opra means something like a “ kissing Opra event”, reguardless of who does the kissing. But we cannot express the meaning of this in FOL given

  • ur current machinery, since we’ll always have an

unbound variable.

12/37

slide-36
SLIDE 36

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Summary

In summary then, we have at least two problems for compositionality:

1 Analysis problem: No systematic way to use syntax to

guide the construction of a semantic representation

2 Representation problem: Unsatisfying approach to

representing the meanings of certain constituents; deriving truth values for certain kinds of constituents is ill defined.

13/37

slide-37
SLIDE 37

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Today’s lecture

1

Semantic Analysis Problems

2

One Solution: λ-Calculus λ-calculus and FOL λ-calculus and compositionality

3

The semantics of words based on syntactic category

14/37

slide-38
SLIDE 38

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

back to Church

Alonzo Church created a calculus for describing arbitrary functions, called λ-calculus. (It was developed to give a functional foundation for mathematics.) It wasn’t picked up by mathematicians, but it did become a versatile tool for computer scientists.

15/37

slide-39
SLIDE 39

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

back to Church

Alonzo Church created a calculus for describing arbitrary functions, called λ-calculus. (It was developed to give a functional foundation for mathematics.) It wasn’t picked up by mathematicians, but it did become a versatile tool for computer scientists. Remember Lisp? The second oldest high-level programming language, and still used today (invented by John McCarthy, 1958). Lisp (pure Lisp at least) deals exclusively with functions, and functions can be created on the fly and without names.

15/37

slide-40
SLIDE 40

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

back to Church

Alonzo Church created a calculus for describing arbitrary functions, called λ-calculus. (It was developed to give a functional foundation for mathematics.) It wasn’t picked up by mathematicians, but it did become a versatile tool for computer scientists. Remember Lisp? The second oldest high-level programming language, and still used today (invented by John McCarthy, 1958). Lisp (pure Lisp at least) deals exclusively with functions, and functions can be created on the fly and without names. In Lisp, this expression evaluates to an anonymous function: (lambda (x y) (+ x y)), read as “the pair x and y are mapped to x + y”.

15/37

slide-41
SLIDE 41

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

back to Church

Alonzo Church created a calculus for describing arbitrary functions, called λ-calculus. (It was developed to give a functional foundation for mathematics.) It wasn’t picked up by mathematicians, but it did become a versatile tool for computer scientists. Remember Lisp? The second oldest high-level programming language, and still used today (invented by John McCarthy, 1958). Lisp (pure Lisp at least) deals exclusively with functions, and functions can be created on the fly and without names. In Lisp, this expression evaluates to an anonymous function: (lambda (x y) (+ x y)), read as “the pair x and y are mapped to x + y”.

15/37

slide-42
SLIDE 42

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

back to Church

Alonzo Church created a calculus for describing arbitrary functions, called λ-calculus. (It was developed to give a functional foundation for mathematics.) It wasn’t picked up by mathematicians, but it did become a versatile tool for computer scientists. Remember Lisp? The second oldest high-level programming language, and still used today (invented by John McCarthy, 1958). Lisp (pure Lisp at least) deals exclusively with functions, and functions can be created on the fly and without names. In Lisp, this expression evaluates to an anonymous function: (lambda (x y) (+ x y)), read as “the pair x and y are mapped to x + y”. Otherwise, we’d have a named function, something like: add(x, y)

15/37

slide-43
SLIDE 43

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Functions and arguments

More generally, we can describe what’s going on by assuming that every expression is either a function or argument. For instance, suppose we want to create: (+ x y) :

16/37

slide-44
SLIDE 44

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Functions and arguments

More generally, we can describe what’s going on by assuming that every expression is either a function or argument. For instance, suppose we want to create: (+ x y) : Start with three symbols: +, x, and y

16/37

slide-45
SLIDE 45

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Functions and arguments

More generally, we can describe what’s going on by assuming that every expression is either a function or argument. For instance, suppose we want to create: (+ x y) : Start with three symbols: +, x, and y Treat each symbol as either a function or argument

16/37

slide-46
SLIDE 46

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Functions and arguments

More generally, we can describe what’s going on by assuming that every expression is either a function or argument. For instance, suppose we want to create: (+ x y) : Start with three symbols: +, x, and y Treat each symbol as either a function or argument + x yields (+ x)

16/37

slide-47
SLIDE 47

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Functions and arguments

More generally, we can describe what’s going on by assuming that every expression is either a function or argument. For instance, suppose we want to create: (+ x y) : Start with three symbols: +, x, and y Treat each symbol as either a function or argument + x yields (+ x) (+ x) y yields ((+x)y)

16/37

slide-48
SLIDE 48

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Functions and arguments

More generally, we can describe what’s going on by assuming that every expression is either a function or argument. For instance, suppose we want to create: (+ x y) : Start with three symbols: +, x, and y Treat each symbol as either a function or argument + x yields (+ x) (+ x) y yields ((+x)y) Thus, when an expression (function) is applied to another expression (argument), a third expression (result) is obtained.

16/37

slide-49
SLIDE 49

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

λ-calculus: Formal definition

Definition

Expressions in the language Λ are composed of: variables {a, b, c, . . . , x, y, z} abstraction symbols: λ and ., the dot parentheses: ( and ) λ-terms. T ∈ Λ iff one of the following holds:

1 T is a member of a countable set of variables 2 T is of the form (MN) where M and N are in Λ. 3 T is of the form (λX.Y ) where X is a variable and Y is

in Λ. Λ is the smallest language with this property. (MN) is called an application and λX.Y is an abstraction.

17/37

slide-50
SLIDE 50

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Examples

The following are all examples of λ expressions:

18/37

slide-51
SLIDE 51

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Examples

The following are all examples of λ expressions:

4 1 λx . x 18/37

slide-52
SLIDE 52

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Examples

The following are all examples of λ expressions:

4 1 λx . x 2 λx . y (λ x . z x) 18/37

slide-53
SLIDE 53

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Examples

The following are all examples of λ expressions:

4 1 λx . x 2 λx . y (λ x . z x) 3 λx . x (y) 18/37

slide-54
SLIDE 54

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Examples

The following are all examples of λ expressions:

4 1 λx . x 2 λx . y (λ x . z x) 3 λx . x (y) 18/37

slide-55
SLIDE 55

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

λ-calculus and FOL

Standard definitions of FOL can be augmented with λ-calculus. The point is that we can use standard FOL formulas as functions and create new FOL formulas compositionally.

19/37

slide-56
SLIDE 56

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

λ-calculus and FOL

Standard definitions of FOL can be augmented with λ-calculus. The point is that we can use standard FOL formulas as functions and create new FOL formulas compositionally.

Definition

If in some formula a variable is bound by the λ operator, the formula is called a lambda expression.

19/37

slide-57
SLIDE 57

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

λ-calculus and FOL

Standard definitions of FOL can be augmented with λ-calculus. The point is that we can use standard FOL formulas as functions and create new FOL formulas compositionally.

Definition

If in some formula a variable is bound by the λ operator, the formula is called a lambda expression. Syntactically, a λ-expression looks just like any other quantified expression: λx.red(x) ∀y.boat(y) ∃z.floats(z)

19/37

slide-58
SLIDE 58

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Application expressions

To symbolize compositionality, we can create a new formula from λx.dog(x) by treating it as a function and then applying it to an argument: λx.dog(x)(FIDO)

20/37

slide-59
SLIDE 59

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Application expressions

To symbolize compositionality, we can create a new formula from λx.dog(x) by treating it as a function and then applying it to an argument: λx.dog(x)(FIDO)

20/37

slide-60
SLIDE 60

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Application expressions

To symbolize compositionality, we can create a new formula from λx.dog(x) by treating it as a function and then applying it to an argument: λx.dog(x)(FIDO) The result is: dog(FIDO)

20/37

slide-61
SLIDE 61

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Application expressions

To symbolize compositionality, we can create a new formula from λx.dog(x) by treating it as a function and then applying it to an argument: λx.dog(x)(FIDO) The result is: dog(FIDO)

Definition

Given some application expression F A the function can be reduced by a process called β-reduction, such that the result is F with all occurrences of variables bound by λ replaced by A. (The terminology has roots in the original papers of Church and Kleene.)

20/37

slide-62
SLIDE 62

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

NLTK notes

The λ operator is represented by the single back slash \, and is indicated with a raw string:

4 \ x . dog(x) (FIDO)

The Python string is the equivalent of the following application expression: λ x.dog x (FIDO)

21/37

slide-63
SLIDE 63

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Scope of λ

In the augmented FOL, the λ operator ranges over sets and individuals, not just individuals as with ∀ and ∃.

example

(\P. P) (walk(x)) reduces to: boat(x)

22/37

slide-64
SLIDE 64

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Summary of terminology

abstraction: the process of creating a λ function from a predicate logic formula.

23/37

slide-65
SLIDE 65

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Summary of terminology

abstraction: the process of creating a λ function from a predicate logic formula. λ expression: one with variables bound by the λ

  • perator, sometimes called a λ function.

23/37

slide-66
SLIDE 66

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Summary of terminology

abstraction: the process of creating a λ function from a predicate logic formula. λ expression: one with variables bound by the λ

  • perator, sometimes called a λ function.

application expression: one with a function and an argument.

23/37

slide-67
SLIDE 67

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Summary of terminology

abstraction: the process of creating a λ function from a predicate logic formula. λ expression: one with variables bound by the λ

  • perator, sometimes called a λ function.

application expression: one with a function and an argument. β-reduction: where subparts of a function are evaluated and rewritten until the function itself is reduced to a simpler form.

23/37

slide-68
SLIDE 68

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Steps in compositionality

Steps in compositionally deriving a semantic representation:

24/37

slide-69
SLIDE 69

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Steps in compositionality

Steps in compositionally deriving a semantic representation:

1 Express the semantics of each constituent in terms of

lambda expressions;

24/37

slide-70
SLIDE 70

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Steps in compositionality

Steps in compositionally deriving a semantic representation:

1 Express the semantics of each constituent in terms of

lambda expressions;

2 Determine which expression is the function and which is

the argument;

24/37

slide-71
SLIDE 71

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Steps in compositionality

Steps in compositionally deriving a semantic representation:

1 Express the semantics of each constituent in terms of

lambda expressions;

2 Determine which expression is the function and which is

the argument;

3 Apply the function to the argument; 24/37

slide-72
SLIDE 72

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Steps in compositionality

Steps in compositionally deriving a semantic representation:

1 Express the semantics of each constituent in terms of

lambda expressions;

2 Determine which expression is the function and which is

the argument;

3 Apply the function to the argument; 4 β-reduce the conjoined elements to arrive at the final

semantic representation.

24/37

slide-73
SLIDE 73

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given:

25/37

slide-74
SLIDE 74

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given: λ-expression for Sue: \ P . P (SUE)

25/37

slide-75
SLIDE 75

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given: λ-expression for Sue: \ P . P (SUE) λ-expression for bikes: \ x. bikes(x)

25/37

slide-76
SLIDE 76

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given: λ-expression for Sue: \ P . P (SUE) λ-expression for bikes: \ x. bikes(x)

Derivation

25/37

slide-77
SLIDE 77

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given: λ-expression for Sue: \ P . P (SUE) λ-expression for bikes: \ x. bikes(x)

Derivation

An application expression: \ P . P (SUE) ( \ x . bikes(x))

25/37

slide-78
SLIDE 78

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given: λ-expression for Sue: \ P . P (SUE) λ-expression for bikes: \ x. bikes(x)

Derivation

An application expression: \ P . P (SUE) ( \ x . bikes(x)) \ x. bikes(x) (SUE) by β-reduction

25/37

slide-79
SLIDE 79

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Example: Sue bikes

Sue bikes ⇒ bikes(SUE) Given: λ-expression for Sue: \ P . P (SUE) λ-expression for bikes: \ x. bikes(x)

Derivation

An application expression: \ P . P (SUE) ( \ x . bikes(x)) \ x. bikes(x) (SUE) by β-reduction bikes(SUE) by β-reduction

25/37

slide-80
SLIDE 80

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Today’s lecture

1

Semantic Analysis Problems

2

One Solution: λ-Calculus λ-calculus and FOL λ-calculus and compositionality

3

The semantics of words based on syntactic category

26/37

slide-81
SLIDE 81

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

General strategy for using λ-calculus

The point is to enrich each lexical entry with a semantics, and then derive the semantic representation of the entire sentence or phrase. We’ll need to express the semantics of everything using λ-calculus. Namely, we’ll need to express the semantics of lexical items using the functional notation. NNP → Sue NNP[sem = \ S . S (SUE) ] → Sue

27/37

slide-82
SLIDE 82

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Intransitive verbs

Intransitive verbs, in non-event style FOL, are mapped to unary predicates. The semantic attachment for run would be λx.run(x), a predicate waiting for an argument. Bill runs:

28/37

slide-83
SLIDE 83

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Intransitive verbs

Intransitive verbs, in non-event style FOL, are mapped to unary predicates. The semantic attachment for run would be λx.run(x), a predicate waiting for an argument. Bill runs: \ x.run(x) (BILL) reduces to: run(BILL)

28/37

slide-84
SLIDE 84

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Intransitive verbs

Intransitive verbs, in non-event style FOL, are mapped to unary predicates. The semantic attachment for run would be λx.run(x), a predicate waiting for an argument. Bill runs: \ x.run(x) (BILL) reduces to: run(BILL) But, Bill comes before the verb in the syntax.

28/37

slide-85
SLIDE 85

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Proper nouns

  • Ordinarily. the semantic attachment for Bill would be a

constant like BILL, as proper nouns are (non-logical) constants, i.e., always arguments of other expressions. But in a λ system, the semantic attachment is \ P . P (BILL)

29/37

slide-86
SLIDE 86

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Proper nouns

  • Ordinarily. the semantic attachment for Bill would be a

constant like BILL, as proper nouns are (non-logical) constants, i.e., always arguments of other expressions. But in a λ system, the semantic attachment is \ P . P (BILL) Why? Because we need the semantics of a proper noun to be a function in order to get our representations to come

  • ut correctly.

29/37

slide-87
SLIDE 87

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Intransitive verbs, proper order

We need to preserve the order from the syntax. For Bill runs, we need to find a semantic representation for the word Bill and then for runs:

30/37

slide-88
SLIDE 88

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Intransitive verbs, proper order

We need to preserve the order from the syntax. For Bill runs, we need to find a semantic representation for the word Bill and then for runs: (\ P. P) (BILL) (\ x.run(x)) reduces to: \ x.run(x) (BILL) run(BILL)

30/37

slide-89
SLIDE 89

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Intransitive verbs, proper order

We need to preserve the order from the syntax. For Bill runs, we need to find a semantic representation for the word Bill and then for runs: (\ P. P) (BILL) (\ x.run(x)) reduces to: \ x.run(x) (BILL) run(BILL) Thus, order from the syntax can be used as is, which makes things much easier for compositionality.

30/37

slide-90
SLIDE 90

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs

More care has to be taken to specify the order of reduction for the semantics of transitive verbs and di-transitive verbs. These are respectively binary and ternary predicates in FOL. For a transitive verb like love:

31/37

slide-91
SLIDE 91

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs

More care has to be taken to specify the order of reduction for the semantics of transitive verbs and di-transitive verbs. These are respectively binary and ternary predicates in FOL. For a transitive verb like love: \ y. \ x. love(x,y)

31/37

slide-92
SLIDE 92

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs

More care has to be taken to specify the order of reduction for the semantics of transitive verbs and di-transitive verbs. These are respectively binary and ternary predicates in FOL. For a transitive verb like love: \ y. \ x. love(x,y) \ y. \ x. love(x,y) (BETTY)

31/37

slide-93
SLIDE 93

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs

More care has to be taken to specify the order of reduction for the semantics of transitive verbs and di-transitive verbs. These are respectively binary and ternary predicates in FOL. For a transitive verb like love: \ y. \ x. love(x,y) \ y. \ x. love(x,y) (BETTY) \ x. love(x,BETTY)

31/37

slide-94
SLIDE 94

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs

More care has to be taken to specify the order of reduction for the semantics of transitive verbs and di-transitive verbs. These are respectively binary and ternary predicates in FOL. For a transitive verb like love: \ y. \ x. love(x,y) \ y. \ x. love(x,y) (BETTY) \ x. love(x,BETTY) \ x. love(x,BETTY) (JIM)

31/37

slide-95
SLIDE 95

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs

More care has to be taken to specify the order of reduction for the semantics of transitive verbs and di-transitive verbs. These are respectively binary and ternary predicates in FOL. For a transitive verb like love: \ y. \ x. love(x,y) \ y. \ x. love(x,y) (BETTY) \ x. love(x,BETTY) \ x. love(x,BETTY) (JIM) love(JIM,BETTY)

31/37

slide-96
SLIDE 96

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function:

32/37

slide-97
SLIDE 97

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider:

32/37

slide-98
SLIDE 98

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM

32/37

slide-99
SLIDE 99

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM \ X y. X(\ x. loves(y,x))

32/37

slide-100
SLIDE 100

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM \ X y. X(\ x. loves(y,x))

32/37

slide-101
SLIDE 101

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM \ X y. X(\ x. loves(y,x)) \ X y. X (\ x. loves(y,x)) ( \ Q . Q (BETTY)) just the inner terms

32/37

slide-102
SLIDE 102

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM \ X y. X(\ x. loves(y,x)) \ X y. X (\ x. loves(y,x)) ( \ Q . Q (BETTY)) just the inner terms (\ Q . Q (BETTY)) (\ x. loves(y,x))

32/37

slide-103
SLIDE 103

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM \ X y. X(\ x. loves(y,x)) \ X y. X (\ x. loves(y,x)) ( \ Q . Q (BETTY)) just the inner terms (\ Q . Q (BETTY)) (\ x. loves(y,x)) \ x. loves(y,x) (BETTY)

32/37

slide-104
SLIDE 104

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

But, how do we deal with the linear order of the NL string? Due to subject and object order, the following will not reduce, since JIM is not a function: Consider: \ Q. Q (JIM) which is another form of simply JIM \ X y. X(\ x. loves(y,x)) \ X y. X (\ x. loves(y,x)) ( \ Q . Q (BETTY)) just the inner terms (\ Q . Q (BETTY)) (\ x. loves(y,x)) \ x. loves(y,x) (BETTY) loves(y,BETTY)

32/37

slide-105
SLIDE 105

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

33/37

slide-106
SLIDE 106

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

\ y.loves(y,BETTY)

33/37

slide-107
SLIDE 107

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

\ y.loves(y,BETTY) \ P . P (JIM) (\ y.loves(y,BETTY))

33/37

slide-108
SLIDE 108

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

\ y.loves(y,BETTY) \ P . P (JIM) (\ y.loves(y,BETTY)) \ y.loves(y,BETTY) (JIM)

33/37

slide-109
SLIDE 109

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Transitive Verbs, proper order

\ y.loves(y,BETTY) \ P . P (JIM) (\ y.loves(y,BETTY)) \ y.loves(y,BETTY) (JIM) loves(JIM,BETTY)

33/37

slide-110
SLIDE 110

Full transitive verb example

And the mostly unreadable full lambda epression for Jim loves Betty: \ P . P (JIM) (\ X y. X(\ x. loves(y,x)) ( \ Q . Q (BETTY)))

slide-111
SLIDE 111

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Nouns

Common nouns work just like intransitive verbs, i.e., the semantic attachment is a unary predicate.

35/37

slide-112
SLIDE 112

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Nouns

Common nouns work just like intransitive verbs, i.e., the semantic attachment is a unary predicate. For example, the semantic attachment for dog would be: \ x.dog(x) in λ-calculus.

35/37

slide-113
SLIDE 113

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Copulas

The copula (am, is, are, etc.) is a special kind of transitive verb, as it equates the subject and object. We introduce a special binary predicate eq for the semantics of the copula: \ X y. X(\ x. eq(y,x))

36/37

slide-114
SLIDE 114

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Copulas

The copula (am, is, are, etc.) is a special kind of transitive verb, as it equates the subject and object. We introduce a special binary predicate eq for the semantics of the copula: \ X y. X(\ x. eq(y,x)) The semantics of the copula looks just like the sematnics of any transitive verb (see previous).

36/37

slide-115
SLIDE 115

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Copulas

The copula (am, is, are, etc.) is a special kind of transitive verb, as it equates the subject and object. We introduce a special binary predicate eq for the semantics of the copula: \ X y. X(\ x. eq(y,x)) The semantics of the copula looks just like the sematnics of any transitive verb (see previous). For the negative copula (ain’t, isn’t, etc.) we have a slightly different formula: \ X y. X (\ x.-eq(y,x))

36/37

slide-116
SLIDE 116

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Auxiliaries

An auxiliary verb such as does is transparent at the level of semantic representation, at least concerning propositional

  • content. Thus, does go would simply be:

\ z. go(z).

37/37

slide-117
SLIDE 117

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Auxiliaries

An auxiliary verb such as does is transparent at the level of semantic representation, at least concerning propositional

  • content. Thus, does go would simply be:

\ z. go(z). If we want to specify a semantics for does that will turn out to contribute nothing to higher constituents, this will suffice: The lambda expression for the semantics of an auxiliary contributing nothing would be: \ P x. P(x) (\ z. go(z))

37/37

slide-118
SLIDE 118

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Auxiliaries

An auxiliary verb such as does is transparent at the level of semantic representation, at least concerning propositional

  • content. Thus, does go would simply be:

\ z. go(z). If we want to specify a semantics for does that will turn out to contribute nothing to higher constituents, this will suffice: The lambda expression for the semantics of an auxiliary contributing nothing would be: \ P x. P(x) (\ z. go(z)) does go

37/37

slide-119
SLIDE 119

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Auxiliaries

An auxiliary verb such as does is transparent at the level of semantic representation, at least concerning propositional

  • content. Thus, does go would simply be:

\ z. go(z). If we want to specify a semantics for does that will turn out to contribute nothing to higher constituents, this will suffice: The lambda expression for the semantics of an auxiliary contributing nothing would be: \ P x. P(x) (\ z. go(z)) does go \ P x. P(x) (\ z. go(z))

37/37

slide-120
SLIDE 120

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Auxiliaries

An auxiliary verb such as does is transparent at the level of semantic representation, at least concerning propositional

  • content. Thus, does go would simply be:

\ z. go(z). If we want to specify a semantics for does that will turn out to contribute nothing to higher constituents, this will suffice: The lambda expression for the semantics of an auxiliary contributing nothing would be: \ P x. P(x) (\ z. go(z)) does go \ P x. P(x) (\ z. go(z)) \ x . (\ z. go(z)) (x)

37/37

slide-121
SLIDE 121

Computational Semantics: Lambda Calculus Scott Farrar CLMA, University

  • f Washington far-

rar@u.washington.edu Semantic Analysis

Problems

One Solution: λ-Calculus

λ-calculus and FOL λ-calculus and compositionality

The semantics of words based on syntactic category

Auxiliaries

An auxiliary verb such as does is transparent at the level of semantic representation, at least concerning propositional

  • content. Thus, does go would simply be:

\ z. go(z). If we want to specify a semantics for does that will turn out to contribute nothing to higher constituents, this will suffice: The lambda expression for the semantics of an auxiliary contributing nothing would be: \ P x. P(x) (\ z. go(z)) does go \ P x. P(x) (\ z. go(z)) \ x . (\ z. go(z)) (x) \ z. go(z) (same as we started with; does is transparent)

37/37