<<

Ling 130 Notes: Predicate Logic and English

Sophia A. Malamud February 15, 2011

1 Characteristic functions

The characteristic function of a set: (1) Let A be a set. The, charA, the characteristic function of A, is the function F such that, for any x∈ A, F(x)=1, and for any x ∉ A, F(x)=0.

Schönfinkelization: (2) U = {a,b,c}

(3) The relation "fond of": Rfond-of = {, , }

(4) The characteristic function of Rfond-of (takes all combinations of two elements, gives 0/1): → 0 → 1 → 0 → 0

CharRfond-of = → 0 → 1 → 0 → 0 → 1

(5) Turning n-ary functions into multiple embedded 1-ary functions: Schönfinkelization. a → 0 left-to-right schönfinkelization a → b → 1 c → 0 a → 0 b → b → 0 c → 1 a → 0 c → b → 0 c → 1

EXERCISE 1: Given the following Universe, spell out the characteristic function of the set in (6) and schönfinkelize it left-to-right.

1 (6) U = {d, e} (7) R = { , , , , }

2 Syntactic composition

A formal language is a set of strings - finite sequences of minimal units (words/morphemes, for natural languages) - with meaning. The "machine" that generates those strings and their corresponding meanings is its grammar. A grammar must specify the following three components: • A lexicon which contains every minimal unit with meaning (= every word, for this course) and its grammatical category; • a syntax, that is, a set of rules that tells you how the minimal units combine to form longer units, how this longer units combine to form yet longer units, and so forth until we form full complex sentences; and • a semantics, which determines what semantic operation or function corresponds to each syntactic rule and combines the “atomic” word meanings to build the meaning of the complete sentence.

Montague’s thesis: Natural languages can be treated as interpreted formal languages. The language of Predicate Logic has lexicon, syntax, and semantics.

• Lexicon for (a fragment of) English (note – I omit the ):

Grammatical Category Lexical Units Proper Names Joan, Pat, Waltham he, she, it, they, him Common dog, chair, table, water Intransitive sleep, snore, swim, jump Transitive Verbs see, find, kiss, hug Ditransitive Verbs give, put, send Propositional/Clausal Verbs know, claim, believe Auxiliary Verbs will, would, could, must, might the, a, some, every, each, most, my, their Prepositions with, without, in, on, to, after, before Predicative sad, happy, tall, green, vegetarian, former Manner quickly, carefully, curiously, willingly when, if, whether, although, that Conjunctions and, or, but

2 • Syntax. Syntax gives rules governing how to build sentences1. E.g., it contains rules similar to (8) and (9), abbreviated in (8’) and (9’) respectively.

(8) If φ is a proper and ψ is an intransitive , then the sequence φψ (disregarding inflection) is a sentence.

(8’) S → Npr Vintr (9) If ω is a proper noun, φ is an and ψ is an intransitive verb, then the sequence ωφψ (disregarding inflection) is a sentence.

(9’) S → Npr AUX Vintr (10) a. Bill walks. b. Bill will walk. c. * Bill walk will. (11) Grammatical sentences of English? a. The cat the nice is saw. b. Who do you wonder whether Mary arrived? c. Who do you think that saw Joanne? d. Who do you think that Joanne saw? e. Do you wanna come for lunch? f. Pat didn't see nobody. g. The child played with Sam and I yesterday. h. Colorless green ideas sleep furiously. i. The building is nice. j. The building the guy built is nice. k. The building the guy the woman hired built is nice. l. The building the guy the woman John met hired built is nice.

• Semantics: Semantics specifies a semantic operation for each syntactic rule. The notation [[.]] which we have been using stands for “the meaning of” or “the denotation of”. That is, semantics is built in tandem with syntax (we will run into problems later).

(12) If φ is a proper noun and ψ is an intransitive verb, then [[φψ ]] is true if and only if (iff) [[φ]]… [[ψ]]…

1 Descriptive vs. prescriptive grammar. Note that we are using the notion of (in particular, English syntax) in a descriptive and not in a prescriptive way. The job of a linguist is to construct a grammar that generates all and only the utterances that a given group of speakers consider well formed in their dialect. This grammar may coincide or not with prescriptive grammaticality. Also, grammaticality has to be distinguished from mere semantic anomaly (the form of the sentence is fine, though the meaning is strange) and processing difficulty.

3 3 Syntax

Sentences are not just bags of words – it matters how they are put together. Here's a structurally ambiguous example from Groucho Marx in Animal Crackers: (13) a. One morning I shot an elephant in my pajamas. How he got into my pajamas I dunno.

Syntactico-semantic units = constituents. We can express these meanings by grouping the words together in a particular way: (13) b. One morning I (shot (an elephant in my pajamas)). => the elephant was in my pajamas c. One morning I (shot (an elephant) in my pajamas). => I shot while wearing my pajamas

This grouping reflects how the pieces of the sentence were put together by syntactic rules.

• The following is the set of syntactic rules we start with. During the semester, some modifications will be made as we cover more types of sentences. (14) S → NP VP S → S Conj S

NP → Npr NP → Det N' N' → Adj N' N' → N' PP N' → N' Conj N' N' → N VP → Adv VP VP → VP PP

VP → Vtrans NP VP → Vintrans VP → V' to NP VP → Vclaus that S

V' → Vditrans NP PP → P NP

Npr → John, Bill, Brandeis University, he, she, it… N → cat, dog, boy, pig, table, binoculars… Det → a, the, some, my, all … Adj → tall, nice, green, … P → on, from, with, …

Vtrans → see, like, help, kiss …

Vclaus → know, claim, believe …

Vditrans → give, assign, introduce …

Vintr → run, sleep … Adv → quickly, soon … Conj → and, or, but …

4 • Running an example sentence: (15) The girl kissed the boy. S / \ NP VP / \ / \ Det N’ V NP / | | / \ The N kissed Det N’ | | | girl the N | boy • Trees and syntactico-semantic units: ◦ Every lexical item or word is a syntactico-semantic unit (minimal units). ◦ Every complete sentence is a syntactico-semantic unit (maximal unit). ◦ The tree structure of a sentence specifies all its intermediate units.

(16) Every mother node α in a tree is a syntactico-semantic unit. In other words, for any node α, all the lexical material under its daughter branches forms a syntactico-semantic unit that excludes material under other non-daughter branches.

The tree structure in (15) makes the following claims wrt the sentence The girl kissed the boy: the girl kissed the boy is a unit (in particular, a S). the girl is a unit (a NP). the boy is a unit (a NP). kiss(ed) the boy is a unit (a VP). the girl kiss(ed) is NOT a unit in this sentence. girl kiss(ed) the is NOT a unit in this sentence. etc. QUESTION 1: Draw the syntactic tree for the following sentence according to our grammar. Discuss what strings form a syntactico-semantic unit and what strings do not. (17) The tall man from Waltham helped the small boy.

QUESTION 2: For each of the following sentences, our grammar allows us to generate more than one tree. For each sentence, draw all the possible trees and explain in your own words the meaning that each tree attributes to the sentence. (13) I shot an elephant in my pajamas. (18) John called a woman from my favourite country in Europe. (19) Some curious men and women from Waltham attended the meeting.

5 For the sentence (20), draw a tree that corresponds to each picture, below the picture: (20) I saw an owl with a telescope

• Other ambiguities: (21) Only John likes his teacher. (22) Mary defended herself, and Sue did ▲ too. (23) Mary defended herself better than Sue did ▲ .

4 Lambdas and types 4.1 Motivation: Set theory and thus, the semantics of Predicate Logic has problems:

Problem 1: Russel’s paradox

• There are several ways to define a set: ◦ list all its members {2,4,6,8} ◦ define via a property {x | x is an even positive number less than 10} • This last version is very convenient (powerful): ◦ {x | x is in this room now} ◦ {x | x is red in w100} ◦ {x | ∈ [[kiss]] w17}

But it can lead to problems, e.g. A={x | x ∉ x } QUESTION 3: is A ∈ A ?

Problem 2: Verbs, prepositions, etc. not corresponding to the same sort of semantic thing What is the nature of syntactic categories, like verb, noun? • We cannot say “V always combines with one NP to make S”. Instead, we must define further categories: ◦ Vintransitive combines with one NP to make S, ◦ Vtransitive combines with two NPs to make S ◦ Vditransitive combines with three NPs to make S • Similarly, count and mass nouns behave differently:

6 ◦ Nmass is an NP ◦ Ncount combines with Det to make NP • Yet, there are syntactic reasons to call all verbs, “verbs” and all nouns, “nouns” ◦ All phrases built around a verb are VPs, all phrases built around nouns are NPs etc. ◦ All verbs inflect for the same things in the same language: e.g. loves, runs, gives etc.

Problem 3: too many semantic rules, or not enough! • Combining a NP with the VP: (24) For any arbitrary NP, VP and model M [[S]]M = 1 iff [[NP]]M ∈ [[VP]]M / \ NP VP

QUESTION 4: Take the denotation of kiss in M1 to be the set of pairs in (25). What is the denotation of VP in (26)? And what is the semantic contribution of the rule merging the V and the NPob into the VP? (25) [[kiss]]M1 = {, , } (26) S / \

NPsu VP / / \

Betty V NPob / \ kisses Connor

(27) For any arbitrary Vtrans, NP and model M [[VP]]M = need a set, to make sure rule (24) works! / \

Vtrans NP

• With the 3-place predicate assign, we have three levels of NP embedding: least embedded (=NP subject), middle embedded (= NP indirect ), and most embedded (= NP direct object). For the least embedded, we can use the rule in (24). For the middle embedded, we can use the rule we gave in (27). But we need a new rule combining the most embedded NP (=the NP direct object) with the assign.

QUESTION 5: What is this rule? And what is the resulting denotation of V’?

7 (28) S / \

NPsu VP / / \

Ann V' to NPIO / \ \

V NPDO Connor / \ assigned Ann

(29) For any arbitrary Vditrans, NP and model M [[V']]M = / \

Vditrans NP

Problem 4: No way to make complicated kinds of predicates in Predicate Logic boy can translate to B (a one-place predicate), love can translate to L (a two-place predicate), but what about boy who loves Mary? or who loves Mary, just the by itself?

4.2 The solution: type theory and lambda calculus Step 1: Type theory

Individuals – type e John, the red apple, water, the saber-tooth tiger Truth values – type t The morning star is the evening star, Every boy runs

Sets vs. characteristic functions of sets • What is the type of sets? red, runs ◦ The meaning of John runs is a truth value, while John denotes an individual ◦ We can think of runs as a function that takes an individual to give a truth-value:

Sets can be thought of in terms of their characteristic functions fA(a)=1 iff a∈A

The type of any function that takes arguments of type i to yield a result of type j is i→ j

So, the type of runs is e → t. What about the type of kiss or like?

This creates a system of types: De – subsets of it are all sets containing individuals

“D” stands for “domain” Dt = {0,1}

8 De→ t – set containing all the functions from De to Dt

Det→ et – set containing all the functions from sets to sets QUESTION 6: what English words could have this last type?

Benefits: side-steps Russel’s paradox neat assignment of semantic categories

Step two: Lambdas

The lambda notation • Instead of saying, run is a function looking for individuals of type e to make a sentence (of type t) saying that this individual runs, • we can write it down: (30) run ~> λxe. run(x)

Translating lambdas into English: λXj . blah translates into “Give me something of type j, and I’ll give you blah”

This is just building Type theory into Predicate Logic.

QUESTION 7: (31) Give lambda-terms corresponding to the verbs kiss, give, red.

(32) What about quantifiers like some and every?

With this, we can extend Predicate Logic to Typed Lambda Calculus.

Reducing semantic rules to functional application (and maybe some others) • The basic vocabulary is very similar Predicate Logic, but has an extra symbol λ: 1. The lambda operator λ 2. Any number of variables for each type 3. A (possibly empty) set of constants for each type 4. The logical connectives ¬ , Λ, v , → 5. The quntifiers ∀ and ∃ 6. The equality symbol = 7. parenthesis

9 The formal lambda-calculus system is based on two operations: lambda-abstraction, and function application.

• Lambda abstraction

(33) Given any lambda-term M of type j, λXi.M is a lambda term of type i→ j.

In our system, we will use mostly this subcase: if φ is a well-formed formula, and x a variable of type i, λx.φ is a lambda-term of type i→ t.

• Function application

(34) Given a lambda term M of type j and a term N of type i, λXi.M (N) is a term of type j In other words, if φ is a term of type i→ j and N of type I, then φ(N) is of type j

Just writing the N next to the function M doesn't make the formula simpler. So, function application comes with this helpful simplification rule, β-conversion: • Definition of β-conversion

(35) λXi.M (N) = M’ which is M, but with every occurrence of X replaced by N.

Example: λx.run(x) (j) = β-conversion = run(j)

• Important points: ◦ Applying β-conversion blindly may lead to trouble: (36) λx.λy.love(x, y) (y) => β-conversion => λy.love (y,y) - wrong result!

(37) Even worse: [[λx∃y(x≠y) ]] w,g = property of being non-unique. (function which will give

1 (True) for every individual as long as De has more than one individual in it) [[λx∃y(x≠y)(y)]] w,g = the value assigned by this function to g(y), so 1 as long

as De has more than one individual in it [[∃y(y≠y) ]] w,g = 0, since it asserts that there is a thing not equal to itself !!!

◦ To avoid that, when we’re substituting N in λXi.M (N), we have to check that all free variables in the expression we’re plugging in (here, N) are free for X in M – that is, for every free Y in N, no free occurrence of X in M is in the scope of ∃Y, ∀Y or λY.

When this condition is violated (as in examples above), replace a formula with its alphabetic variant (α-conversion). • Definition of α-conversion: (38) If Y is free for X in M, and is NOT free in M, then λX.M = λY. [Y/X] M

10 λx.λy.love(x,y) (y) =α-conversion= λx.λz.love(x,z) (y) =β-conversion= λz.love (y,z)

• Since all the lambda-terms are either complete formulas or functions, all the semantic rules we saw so far could be stated in just one rule: Function application (for semantics of natural language) (39) If α is an expression of type i, β is an expression of type i→ j, then [[γ]] = [[β]] ([[α]]), / \ β α which is an expression of type j resulting from applying the function β to the argument α.

Examples: (40) a. John runs b. Ann assigns Betty to Connor c. Everyone runs

11