Formal Semantics - PowerPoint PPT Presentation

1 / 112
About This Presentation
Title:

Formal Semantics

Description:

9. First-order predicate logic x (man(x) mortal(x)) man(socrates) mortal(socrates) ... The function that maps men to 'true' and non-men to 'false' x (man(x)) (john) ... – PowerPoint PPT presentation

Number of Views:120
Avg rating:3.0/5.0
Slides: 113
Provided by: cisU
Category:
Tags: formal | man | semantics

less

Transcript and Presenter's Notes

Title: Formal Semantics


1
Formal Semantics
  • Slides by Lucas Champollion
  • Based on Heim Kratzer (1998)

2
The MURI pipeline
3
The big picture, more generally
Somebody sleeps
Tokenization
POS Tagging
Syntax
Semantics
(Pragmatics)
?x sleeps(x)
4
From trees to logic
compositional semantics
?xthink(bill,likes(harry,x))
or some other suitable representation
5
Examples of representation languages
Other candidates Modal logics, higher-order
predicate logics, description logics etc.
6
First-order predicate logic
  • ?x (man(x))
  • Everybody is a man
  • ?x (man(x))
  • Somebody is a man

7
First-order predicate logic
  • ?x (man(x))
  • Everybody is a man
  • ?x (man(x))
  • Somebody is a man
  • ?x (rich(x) ? popular(x))
  • Everybody is rich or popular
  • ?x (rich(x) ? popular(x))
  • Everybody is rich and popular
  • ?x (rich(x) ? popular(x))
  • Everybody who is rich is popular

8
First-order predicate logic
  • ?x (man(x))
  • Everybody is a man
  • ?x (man(x))
  • Somebody is a man
  • ?x (rich(x) ? popular(x))
  • ?x (rich(x) ? popular(x))
  • ?x (rich(x) ? popular(x))

9
First-order predicate logic
  • ?x (man(x) ? mortal(x))
  • man(socrates)
  • ____________________
  • mortal(socrates)

?x ?y loves(x,y) ________________ ??y ?x
loves(x,y)
10
First-order predicate logic with lambdas
  • ?x (man(x))
  • Everybody is a man
  • ?x (man(x))
  • Somebody is a man
  • ?x (man(x))
  • The function that maps men to true and non-men
    to false

11
First-order predicate logic with lambdas
  • ?x (man(x))
  • Everybody is a man
  • ?x (man(x))
  • Somebody is a man
  • ?x (man(x))
  • The function that maps men to true and non-men
    to false
  • ?x (man(x)) (john)
  • The function that maps men to true and non-men
    to false applied to john
  • Reduces to man(john) in one step
  • This step is called function application or beta
    reduction or lambda conversion

12
The Algorithm (simplest case)
  • Assume all nodes are at most binary branching
  • Every word is mapped to a formula/fragment
  • This information is looked up in the lexicon
  • Ambiguous words have multiple entries -- use WSD
  • Non-branching nodes inherit meaning from their
    daughter nodes
  • Branching nodes Functional Application
  • If one child denotes a function and the other
    child denotes an argument, apply function to
    argument
  • Apply recursively until root is reached

13
Simple Lexical Semantics
  • Each proper noun is mapped to a constant
  • John john
  • America america

14
Simple Lexical Semantics
  • Each proper noun is mapped to a constant
  • John john
  • America america
  • Adjectives, nouns, and intransitive verbs are
    mapped to one-place predicates
  • A predicate is a function that returns a boolean
    value (true, false)
  • sleeps ?x if x sleeps then return true
    else return false
  • man ?x if x is a man then return true
    else return false
  • red ?x if x is red then return true else
    return false

15
Simple Lexical Semantics
  • Each proper noun is mapped to a constant
  • John john
  • America america
  • Adjectives, nouns, and intransitive verbs are
    mapped to one-place predicates
  • A predicate is a function that returns a boolean
    value (true, false)
  • sleeps ?x if x sleeps then return true
    else return false
  • man ?x if x is a man then return true
    else return false
  • red ?x if x is red then return true else
    return false

Can be simplified
16
Simple Lexical Semantics
  • Each proper noun is mapped to a constant
  • John john
  • America america
  • Adjectives, nouns, and intransitive verbs are
    mapped to one-place predicates
  • A predicate is a function that returns a boolean
    value (true, false)
  • sleeps ?x sleeps(x)
  • man ?x man(x)
  • red ?x red(x)

17
Simple Lexical Semantics
  • Each proper noun is mapped to a constant
  • John john
  • America america
  • Adjectives, nouns, and intransitive verbs are
    mapped to one-place predicates
  • A predicate is a function that returns a boolean
    value (true, false)
  • sleeps ?x sleeps(x)
  • man ?x man(x)
  • red ?x red(x)
  • Transitive verbs are mapped to two-place
    predicates
  • loves ?y ?x loves(x,y)

18
Simple Lexical Semantics
  • Each proper noun is mapped to a constant
  • John john
  • America america
  • Adjectives, nouns, and intransitive verbs are
    mapped to one-place predicates
  • A predicate is a function that returns a boolean
    value (true, false)
  • sleeps ?x sleeps(x)
  • man ?x man(x)
  • red ?x red(x)
  • Transitive verbs are mapped to two-place
    predicates
  • loves ?y ?x loves(x,y)
  • Auxiliaries are mapped to the identity function
  • is does ?x x

19
Example
S
NP
VP
NP
N
V
N
John
loves
Mary
John loves Mary
20
Example
S
NP
VP
NP
N
V
N
john
?y ?x loves(x,y)
mary
John loves Mary
21
Example
S
NP
VP
NP
john
V
N
?y ?x loves(x,y)
mary
John loves Mary
22
Example
S
john
VP
NP
V
N
?y ?x loves(x,y)
mary
John loves Mary
23
Example
S
john
VP
NP
?y ?x loves(x,y)
N
mary
John loves Mary
24
Example
S
john
VP
NP
?y ?x loves(x,y)
mary
John loves Mary
25
Example
S
john
VP
mary
?y ?x loves(x,y)
John loves Mary
26
Example
S
john
?y ?x loves(x,y) (mary)
John loves Mary
27
Example
S
john
?x loves(x,mary)
John loves Mary
28
Example
?x loves(x,mary) (john)
John loves Mary
29
Example
loves(john,mary)
John loves Mary
30
A more involved example
S
NP
VP
NP
N
V
N
Somebody
loves
Mary
Somebody loves Mary
31
The meaning of quantifier NPs
  • A first try
  • somebody somebody
  • everybody everybody
  • Somebody loves Mary. loves(somebody, mary)
  • ???

32
Quantifier noun phrases have a special status
  • They are functions from VP meanings to booleans
  • So, they are functions from one-place predicates
    to booleans
  • Higher-order function a function that takes
    another function as an argument
  • Examples
  • everybody ?P ?z P(z)
  • nobody ?P ??z P(z)
  • Building quantifier NPs from quantifiers
  • every ?P ?Q ?z P(z) ? Q(z)
  • Question words as quantifiers
  • who ?P ?z P(z)
  • where ? is a query operator

33
A more involved example
S
NP
VP
NP
N
V
N
?P ?z P(z)
?y ?x loves(x,y)
mary
Somebody loves Mary
34
A more involved example
S
?P ?z P(z)
VP
NP
V
N
?y ?x loves(x,y)
mary
Somebody loves Mary
35
A more involved example
S
?P ?z P(z)
VP
NP
?y ?x loves(x,y)
N
mary
Somebody loves Mary
36
A more involved example
S
?P ?z P(z)
VP
NP
?y ?x loves(x,y)
mary
Somebody loves Mary
37
A more involved example
S
?P ?z P(z)
VP
mary
?y ?x loves(x,y)
Somebody loves Mary
38
A more involved example
S
?P ?z P(z)
?y ?x loves(x,y) (mary)
Somebody loves Mary
39
A more involved example
S
?P ?z P(z)
?x loves(x,mary)
Somebody loves Mary
40
A more involved example
?P ?z P(z) ?x loves(x,mary)
Somebody loves Mary
41
A more involved example
?P ?z P(z) ?x loves(x,mary)
?P ?z P (z)
?x loves(x,mary)
Somebody loves Mary
42
A more involved example
?P ?z P(z) ?x loves(x,mary)
?P ?z P (z)
?x loves(x,mary)
?z ?x loves(x,mary)(z)
Somebody loves Mary
43
A more involved example
?P ?z P(z) ?x loves(x,mary)
?P ?z P (z)
?x loves(x,mary)
?z ?x loves(x,mary)(z)
?z loves(z,mary)
Somebody loves Mary
44
Pronouns are mapped to variables
  • Can be bound by any noun phrase (both proper
    nouns and quantifier NPs)
  • Are sometimes pronounced as reflexives (himself)
  • Binder-bindee relation indicated by an integer
    index
  • John1 likes himself1.
  • Every man1 likes a woman who hates him1.
  • John1 thinks that he1 likes Mary and that Mary
    likes him1.
  • Often, several ways of binding them are possible
    (anaphora resolution)
  • John1 likes Bill2 because he2 pays him1.
  • John1 likes Bill2 because he1 pays him2.
  • John1 likes Bill2 because he1 pays himself1.
  • John1 likes Bill2 because he2 pays himself2.
  • Can be bound across sentences
  • John1 sleeps. He1 is tired.
  • though some quantifiers cause problems there
  • Every man1 sleeps. He1 is tired.

45
The pronoun mechanism
  • Pronoun interpretation is delegated to a special
    function g
  • Any noun phrase that carries a binder index
    extends g (writes information into g)
  • A pronouns meaning is given by g, applied to the
    pronouns index. (The pronoun reads information
    from g)
  • he1 g(1)
  • he2 g(2)
  • him2 g(2) etc.
  • The following is a simplified illustration

46
Example Proper noun binds pronoun
S
NP
VP
NP
N
V
N
John1
loves
himself1
John loves himself
47
Example Proper noun binds pronoun
S
NP
VP
NP
N
V
N
john1
?y ?x loves(x,y)
g(1)
John loves himself
48
Example Proper noun binds pronoun
S
john1
VP
NP
V
N
?y ?x loves(x,y)
g(1)
John loves himself
49
Example Proper noun binds pronoun
S
john1
VP
NP
?y ?x loves(x,y)
N
g(1)
John loves himself
50
Example Proper noun binds pronoun
S
john1
VP
g(1)
?y ?x loves(x,y)
John loves himself
51
Example Proper noun binds pronoun
S
john1
?y ?x loves(x,y) g(1)
John loves himself
52
Example Proper noun binds pronoun
S
john1
?x loves(x,g(1))
John loves himself
53
Example Proper noun binds pronoun
S
john1
?x loves(x,g(1))
g(1) picks up its meaning as the coindexed NP
(john) at the moment of combining
John loves himself
54
Example Proper noun binds pronoun
S
john1
?x loves(x, g(1))
g(1) picks up its meaning as the coindexed NP
(john) at the moment of combining
John loves himself
55
Example Proper noun binds pronoun
?x loves(x, g(1)) john
John loves himself
56
Example Proper noun binds pronoun
loves(g(1), john)
John loves himself
57
Example Proper noun binds pronoun
loves(g(1), john)
We now resolve g(1), which yields john
John loves himself
58
Example Proper noun binds pronoun
loves(john, john)
We now resolve g(1), which yields john
John loves himself
59
Example Quantifier NP binds pronoun
S
NP
VP
NP
N
V
N
Everybody1
loves
himself1
Everybody loves himself
60
Example Quantifier NP binds pronoun
S
NP
VP
NP
N
V
N
?P ?z P(z)1
?y ?x loves(x,y)
g(1)
Everybody loves himself
61
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
VP
NP
V
N
?y ?x loves(x,y)
g(1)
Everybody loves himself
62
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
VP
NP
?y ?x loves(x,y)
N
g(1)
Everybody loves himself
63
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
VP
g(1)
?y ?x loves(x,y)
Everybody loves himself
64
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
?y ?x loves(x,y) g(1)
Everybody loves himself
65
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
?x loves(x,g(1))
Everybody loves himself
66
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
?x loves(x,g(1))
Replace pronoun by QNP variable at the moment of
combining
Everybody loves himself
67
Example Quantifier NP binds pronoun
S
?P ?z P(z)1
?x loves(x,g(1))
g(1) picks up its meaning as the QNP variable
(z) at the moment of combining
Everybody loves himself
68
Example Quantifier NP binds pronoun
?z P(z) ?x loves(x,g(1))
Everybody loves himself
69
Example Quantifier NP binds pronoun
?z ?x loves(x,g(1)) (z)
Everybody loves himself
70
Example Quantifier NP binds pronoun
?z loves(z,g(1))
Everybody loves himself
71
Example Quantifier NP binds pronoun
?z loves(z,g(1))
We now resolve g(1), which yields z
Everybody loves himself
72
Example Quantifier NP binds pronoun
?z loves(z,z)
We now resolve g(1), which yields z
Everybody loves himself
73
Traces
  • Can be bound by any noun phrase (both proper
    nouns and quantifier NPs)
  • Are almost never pronounced (by definition, in
    some sense)
  • Sometimes pronounced anyway (resumptive
    pronouns)
  • This is the man1 that Mary doesnt know what he1
    is eating.
  • Binder-bindee relation indicated by an integer
    index
  • Who1 does John like t1?
  • Who1 does Bill think Harry likes t1?
  • Beans1, John likes t1.
  • John knows the man1 that Mary likes t1.
  • Can only be bound by a noun phrase that has moved
  • Who1 does John2 like t2?

74
The trace mechanism
  • Trace interpretation is delegated to the special
    function g
  • Any noun phrase that carries a binder index
    extends g (writes information into g)
  • A traces meaning is given by g, applied to the
    traces index. (The trace reads information from
    g)
  • t1 g(1)
  • t2 g(2) etc.
  • Exactly the same as pronouns

75
Example Question word binds trace
S
S
NP
S
Aux
N
NP
VP
does
Who1
N
V
NP
Who does Harry like?
like
t1
Harry
76
Example Question word binds trace
S
S
NP
S
Aux
N
NP
VP
?x x
?P ?x P(x)1
N
V
NP
Who does Harry like?
?y?xlike(x,y)
g(1)
harry
77
Example Question word binds trace
S
S
NP
S
Aux
N
NP
VP
?x x
?P ?x P(x)1
N
?y?xlike(x,y)
g(1)
Who does Harry like?
harry
78
Example Question word binds trace
S
S
NP
S
Aux
N
NP
?xlike(x,g(1))
?x x
?P ?x P(x)1
N
Who does Harry like?
harry
79
Example Question word binds trace
S
S
NP
S
Aux
N
NP
?xlike(x,g(1))
?x x
?P ?x P(x)1
harry
Who does Harry like?
80
Example Question word binds trace
S
S
NP
S
Aux
N
harry
?xlike(x,g(1))
?x x
?P ?x P(x)1
Who does Harry like?
81
Example Question word binds trace
S
S
NP
like(harry,g(1))
Aux
N
?x x
?P ?x P(x)1
Who does Harry like?
82
Example Question word binds trace
S
S
NP
like(harry,g(1))
?x x
N
?P ?x P(x)1
Who does Harry like?
83
Example Question word binds trace
S
?x x like(harry,g(1))
NP
N
?P ?x P(x)1
Who does Harry like?
84
Example Question word binds trace
S
like(harry,g(1))
NP
N
?P ?x P(x)1
Who does Harry like?
85
Example Question word binds trace
S
like(harry,g(1))
NP
?P ?x P(x)1
Who does Harry like?
86
Example Question word binds trace
S
like(harry,g(1))
?P ?x P(x)1
Who does Harry like?
87
Example Question word binds trace
?P ?x P(x) like(harry,g(1))
Who does Harry like?
88
Example Question word binds trace
?x like(harry,x)
Who does Harry like?
89
Problem Quantifiers in object position
S
NP
VP
NP
N
V
N
Mary
loves
somebody
Mary loves somebody.
90
Problem Quantifiers in object position
S
NP
VP
NP
N
V
N
mary
?y ?x loves(x,y)
?P ?z P(z)
Mary loves somebody.
91
Problem Quantifiers in object position
S
NP
VP
?P ?z P(z)
N
?y ?x loves(x,y)
mary
Mary loves somebody.
92
Problem Quantifiers in object position
S
NP
?P ?z P(z) ?y ?x loves(x,y)
N
mary
Mary loves somebody.
93
Problem Quantifiers in object position
S
NP
?z ?y ?x loves(x,y) (z)
N
mary
Mary loves somebody.
94
Problem Quantifiers in object position
S
NP
?z ?y ?x loves(x,y) (z)
A two-place function is fed only one argument
N
mary
Mary loves somebody.
95
Problem Quantifiers in object position
S
NP
?z ?x loves(x,z)
A two-place function is fed only one argument
N
mary
Mary loves somebody.
96
Problem Quantifiers in object position
S
NP
?z ?x loves(x,z)
A two-place function is fed only one argument
N
Whatever this is, its not a function, so we
cant apply it to mary
mary
Mary loves somebody.
97
Proposed Solutions
  • Quantifier NPs are ambiguous
  • somebody1 ?P ?z P(z)
  • subject position only
  • somebody2 ?P ?x ?z P(x,z)
  • object position only
  • Quantifier NPs can act on their context
  • Intuition somebody ?Context ?z
    Context(z)
  • What does context mean?
  • The continuation of the current computation
    (Barker, Shan)
  • The surrounding tree, accessible after movement
    (May, much of GB)
  • Quantifier scope is resolved in a separate step
  • Use a representation language that leaves
    quantifier scope underspecified (most of
    computational semantics)

98
Example Quantifier Raising
  • Quantifier NPs move out of object position
  • They move above the clause so they have access to
    the whole context
  • Similar mechanism to wh-movement, topicalization
    etc. -- except that we dont hear it
  • A separate step before interpretation starts

99
Example Quantifier Raising
S
S
NP
N
NP
VP
N
V
NP
Somebody1
loves
t1
Mary
Mary loves somebody.
100
Example Quantifier Raising
S
S
NP
N
NP
VP
N
V
NP
?P ?z P(z)1
?y?xloves(x,y)
g(1)
mary
Mary loves somebody.
101
Example Quantifier Raising
S
S
NP
N
NP
VP
?y?xloves(x,y)
g(1)
N
?P ?z P(z)1
mary
Mary loves somebody.
102
Example Quantifier Raising
S
S
NP
N
NP
?xloves(x,g(1))
N
?P ?z P(z)1
mary
Mary loves somebody.
103
Example Quantifier Raising
S
S
NP
N
mary
?xloves(x,g(1))
?P ?z P(z)1
Mary loves somebody.
104
Example Quantifier Raising
S
?xloves(x,g(1)) mary
NP
N
?P ?z P(z)1
Mary loves somebody.
105
Example Quantifier Raising
S
loves(mary,g(1))
NP
N
?P ?z P(z)1
Mary loves somebody.
106
Example Quantifier Raising
S
loves(mary,g(1))
?P ?z P(z)1
Mary loves somebody.
107
Example Quantifier Raising
?z loves(mary,g(1))
Mary loves somebody.
108
Example Quantifier Raising
?z loves(mary,z)
Mary loves somebody.
109
Quantifier scope ambiguities
  • Somebody loves everybody.
  • In this country a woman gives birth every 15
    min. Our job is to find that woman and stop her.
    (Groucho Marx)
  • In Quantifier Raising approach
  • Which quantifier raises highest?
  • see blackboard
  • In continuations approach
  • In which order are the quantifiers evaluated?
  • In underspecification approach
  • Collect quantifiers, delay decision to a later
    stage

110
Scopal ambiguity is pervasive
  • Most politicians can fool most voters most of the
    time, but no politician can fool all voters all
    of the time.
  • A participant of every course gave two
    presentations.

111
Constraints on quantifier scope
  • Similar to islands
  • Some man loves every woman
  • (?? and ?? are both OK)
  • Some man thinks that he loves every woman
  • (?? is OK, ?? is not possible)
  • Polarity items are sensitive to negation
  • We did not see any man
  • (?? is OK, ?? is not possible)
  • We did not see some man
  • (?? is OK, ?? is not possible)
  • We did not see a man
  • (?? and ?? are both OK)

112
Appendix Type theory in a nutshell
  • Types help us determine which way function
    application applies
  • In more refined versions of the theory, when we
    have more operations than just function
    application, types tell us which operations to
    apply
  • We start with just two basic types
  • t - a truth value (boolean type)
  • e - an entity (individual type)
  • The set of types is the smallest set such that
  • All basic types are types
  • If ?and ? are types then lt?,?gt is a type
    (complex type)
  • Complex types are used to specify the types of
    input and output values to functions
  • A function from entities (e) to booleans (t) will
    have the type lte,tgt (one-place predicate type)
  • A function from one-place predicates (lte,tgt) to
    booleans (t) will have the type
Write a Comment
User Comments (0)
About PowerShow.com