Title: Finite Model Building and Computational Semantics
1Finite Model Building and Computational Semantics
.
...
...
...
- Johan Bos
- University of Rome "La Sapienza
- Dipartimento di Informatica
2Aim of this talk
- Give an introduction to model building
- Show how model building can be used in
computational semantics - Convince you that model building is a very
interesting deduction technique
3Models
4Models
MltD,Fgt Dd1,d2 F(mia)d2 F(man)d1 F(woman)
d2 F(love)(d2,d1)
5Models
MltD,Fgt Dd5
6Models
MltD,Fgt Dd1,d2,d3,d4,d5, .. F(man)d1,d4,
d12 F(woman)d2,d3 F(car)d14,d13
F(love)(d2,d1), (d4,d4), . F(hate)(d5,d1)
, (d1,d4), .
7Model Building
- The task of constructing a model that satisfies a
particular first-order theory
8Model Building
- Also known as
- Model Generation
- Model Finding
- Model Searching
- Model Construction
- Do not confuse with
- Model Checking
9Inference Tools (FOL)
- Model Building
- Useful for checking consistency and building a
discourse model - Model Checking
- Useful for querying properties of the constructed
discourse model - Theorem Proving
- Useful for drawing inferences, such as checking
for inconsistencies or uninformativity
10Mathematicians vs. Linguists
- Suppose we got a theory ?
11Mathematicians vs. Linguists
- Suppose we got a theory ?
12Mathematicians vs. Linguists
- Suppose we got a theory ?
13Mathematicians vs. Linguists
- Suppose we got a theory ?
14Mathematicians vs. Linguists
- Suppose we got a theory ?
15Mathematicians vs. Linguists
- Suppose we got a theory ?
16Mathematicians vs. Linguists
- Summing up
- The mathematician thinks in terms of proofs and
counter-models - The linguist thinks in terms of models and
counter-proofs
17Talk Outline
- More about models and model building
- Why models are useful in semantic interpretation
- 1 Linguistic interpretation
- 2 interface to application
- 3 robust inference
- Limitations, Future, Conclusion
18Finite Model Building
- Model builders construct finite models for
logical theories - Minimal (no redundant information)
- Flat (no recursion)
- Deal naturally with quantification, disjunction,
conditionals, negation - Practical benefits
- There are powerful off-the-shelf model builders
available - Model Checking tools available for complex queries
19Off-the-shelf model builders
- Model builders for First-order Logic
- Finfimo Bry Torge
- Finder Slaney
- Sem Zhang
- Kimba Konrad
- Mace2 and Mace4 McCune
- Paradox Claessen
20Non-finite models
- The following theory doesnt have a finite
modelperson(butch)?x(person(x) ? ?y(person(y)
parent(x,y)))?x?y?z(parent(x,y)parent(y,z)?par
ent(x,z))?x parent(x,x) - Everyone has a parent
21Minimal Models
- Models that only contain what is required to make
? true - The smallest models that satisfy ?
- Small with respect to individuals
- Small with respect to predicates
22Domain-minimal model
- Let M be a model (M ltD,Fgt) for a set of
first-order formulas ? - DefinitionM is an domain-minimal model for ?
if no model with a smaller domain exists that
satisfy ?
23Example domain minimal
- ? ?x woman(x)
- Example Models
- Model 1 Model 2 Model
3 - Model 3 is domain-minimal wrt ?,Models 2 and 3
are not
MltD,Fgt Dd1,d2F(woman)d1,d2
MltD,Fgt Dd1,d2F(woman)d2
MltD,Fgt Dd1F(woman)d1
24Predicate-minimal model
- Let M be a model (M ltD,Fgt) for a set of
first-order formulas ?, and P a predicate symbol - DefinitionM is a P-minimal model for ? if no
model exists that only differs from M in the
assignment of a smaller extension F(P) satisfying
M
25Example predicate minimal
- ? ?x woman(x), Pwoman
- Example Models
- Model 1 Dd1,d2
F(woman)d1,d2 - Model 2 Dd1,d2 F(woman)d2
- Model 3 Dd1 F(woman)d1
- Models 2 and 3 are P-minimal wrt ?, Model 1 is not
26Example predicate minimal
- ? ?x woman(x), Pwoman
- Example Models
- Model 1 Model 2 Model
3 - Models 2 and 3 are P-minimal wrt ?, Model 1 is not
MltD,Fgt Dd1,d2F(woman)d1,d2
MltD,Fgt Dd1,d2F(woman)d2
MltD,Fgt Dd1F(woman)d1
27Local minimal models
- Given a set of domain-minimal models satisfying a
theory ?, MltD,Fgt is locally minimal if there is
no other model M'ltD',F'gt such that F' ? F - See Gardent Konrad 2000
28Minimal models in practice
- Model builders normally generate models by
iteration over the domain size - As a side-effect, the output is a model with a
minimal domain size - Not always predicate minimal
29Herbrand Models
- Individual constants have a unique interpretation
- Claimed to be more suitable for natural language
interpretion - E.g. Konrad, Gardent, Webber, Kohlhase
- Not sure this is necessarily the case nicknames,
aliases, pseudonyms, etc. - However, might be more efficient
30Mental Models
- Cognitive Psychology
- Human beings construct a model in the process of
interpreting language - Very similar to theorem proving vs. model
building - But incremental, non-monotonic
- Johnson-Laird
31Why models are good
- Flat structures
- No recursion
- No implicit quantification
- Easy and efficient to process
- Something abstract made concrete
- Able to quantify over objects
32Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
33Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
34Linguistic Interpretation
- When ambiguities arise, there are often clearly
preferred interpretations - Minimal models often correspond to preferred
interpretation - Type Coercion
- Noun-noun compounds
- Reciprocals
- Definite descriptions
- Accommodation
35Type Coercion Gardent Webber 2001
- Example 1
- Mary enjoyed California.
- Model
MltD,Fgt Dm,c,e1,e2F(enjoy) (e1,m,e2)
F(visit) (e2,m,c)
36Type Coercion Gardent Webber 2001
- Example 2
- Mary read books about all Western states. She
enjoyed California. - Model 1
- Model 2
MltD,Fgt Dm,c,e1,e2,e3, .F(visit)
(e2,m,c) F(enjoy) (e1,m,e2) F(read)
(e3,m,c)
MltD,Fgt Dm,c,e1,e2, .F(enjoy) (e1,m,e2)
F(read) (e2,m,c)
37Type Coercion Gardent Webber 2001
- Example 2
- Mary read books about all Western states. She
enjoyed California. - Model 1
- Model 2
MltD,Fgt Dm,c,e1,e2,e3, .F(visit)
(e2,m,c) F(enjoy) (e1,m,e2) F(read)
(e3,m,c)
MltD,Fgt Dm,c,e1,e2, .F(enjoy) (e1,m,e2)
F(read) (e2,m,c)
38Noun-Noun Compounds Gardent Webber 2001
- Example 1
- The California student produced an excellent
report. - ?x(Sx ?x(Cy FROMxy
39Noun-Noun Compounds Gardent Webber 2001
- Example 1
- The California student produced an excellent
report. - ?x(Sx ?x(Cy FROMxy
- Example 2
- Each student was assigned a state to study. The
California student produced an excellent report. - ?x(Sx ?x(Cy ASSIGNEDxy
40Reciprocals Gardent Konrad 2000
- Examples
- The students infected each other. ?x(Sx??y(Sy
x?y (Ixy ? Iyx))) - The students stared at each other. ?x(Sx??y(Sy
x?y Sxy)) - The students like each other. ?x(Sx??y((Sy
x?y) ? Lxy))
41Reciprocals Gardent Konrad 2000
- Examples
- The students infected each other. ?x(Sx??y((Sy
x?y) ? Lxy ? Lyx)) - The students stared at each other. ?x(Sx??y((Sy
x?y) ? Lxy)) - The students like each other. ?x(Sx??y((Sy
x?y) ? Lxy)) - Introduce costs
- ?x(Sx??y((Sy x?y ? Lxy) ? Lxy))
42Definite Descriptions
- Van der Sandt binding preferred to accommodation
- Binding leads to smaller models
- Gardent Webber bridging preferred to
accommodation - Bridging leads to smaller models
43Accommodation
- Van der Sandt global accommodation is preferred
to local accommodation - However, local accommodation yields smaller models
44Accommodation
- Van der Sandt global accommodation is preferred
to local accommodation - However, local accommodation yields smaller
models - Example The king of France is not bald.
- Global ?x (Kx ? Bx)
- Local ? ?x (Kx Bx)
45Accommodation
- Van der Sandt global accommodation is preferred
to local accommodation - However, local accommodation yields smaller
models - Example The king of France is not bald.
- Global ?x (Kx ? Bx)
- Local ? ?x (Kx Bx)
- Take world knowledge into account
46Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
47Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
48Human-Computer Dialogue
- Focus on small domains
- Grammatical coverage ensured
- Background knowledge already encoded
- Spoken dialogue system
- Godot the robot
- Speech recognition and synthesis
- People could give Godot directions, ask it
questions, tell it new information - Godot was a REAL robot
49Godot the Robot
Godot with Tetsushi Oka
50Spoken Dialogue System Architecture
Automatic Speech Recognition
Semantic Interpretation
Dialogue Manager
Inference
Speech Synthesis
Generation
Application Interface
Home Automation
Service Robots
51Typical conversation with Godot
- Simple dialogues in beginning
- Human Robot?
- Robot Yes?
- Human Where are you?
- Robot I am in the hallway.
- Human OK. Go to the rest room!
52Adding inference to Godot
- We added semantics and inference
- Using DRT
- Inference tasks
- Consistency checking
- Informativity checking
- Using FOL theorem provers and finite model
builders - Mace, Spass
53Advanced conversation with Godot
- Dealing with inconsistency and informativity
- Human Robot, where are you?
- Robot I am in the hallway.
- Human You are in my office.
- Robot No, that is not true.
- Human You are in the hallway.
- Robot Yes I know!
54The Yin and Yang of Inference
- Theorem Proving and Model Building function as
opposite forces - Assume ?, a logical formula, representing a
certain discourse ? - If a theorem prover succeeds in finding a proof
for ??, then ? is inconsistent - If a model builder succeeds to construct a model
for ?, then ? is consistent
55Using minimal models
- ExamplesTurn on a light.Turn on every
light.Turn on everything except the radio. Turn
off the red light or the blue light.Turn on
another light.
56Using minimal models
- Three Steps
- Construct First-Order Theory
- Build Model
- Get relevant information from model
57Step 1 Create First-Order Theory
- Translate instruction into FOL
- ?w?s?k(possible-world(w) system(w,s)
kitchen(w,k) ?v?a(action(w,a,v)
?x(light(a,x) in(a,x,k) ? ?e(switch(a,e,s,x)
on(v,x))))) - Background Knowledge
- ?w?x(light(w,x) ? device(w,x))
- ?w?x(kitchen(w,x) ? ?device(w,x))
- ?w?v?x?y?z(switch(w,x,y,z)on(v,z)?poweron(w,z))
- ...
- Situational Knowledge
- ?w(actual-world(w) light(w,c1) on(w,c1)
light(w,c2) off(w,c2) ...)
58Step 2 Build First-Order Model
- Give First-Order Theory to Model Builder
- Model Builder will return minimal finite model
Dd1,d2,d3,d4,d5,d6,d7,d8 F(c1)d7 F(c2)d6 F(ac
tual_world)d1 F(possible_world)d1,d2,d3 F(sy
stem)(d1,d4),(d2,d4),(d3,d4) F(kitchen)(d1,d5
),(d2,d5),(d3,d5) F(action)(d1,d2,d3) F(light)
(d1,d6),(d2,d6),(d3,d6),(d1,d7),(d2,d7),(d3,d7)
F(in)(d1,d6,d5),(d2,d6,d5),(d3,d6,d5),(d1,d7,d5
),(d2,d7,d5),(d3,d7,d5) F(poweron)(d2,d6),(d2,d
7) F(poweroff) F(off)(d1,d6),(d1,d7) F(on)
(d3,d6),(d3,d7)
59Step 3 Extract Information
- Example switch every light in the kitchen on
- Use model checker
- Get application primitives poweron(c1),poweron(c
2)
Dd1,d2,d3,d4,d5,d6,d7,d8 F(c1)d7 F(c2)d6 F(ac
tual_world)d1 F(possible_world)d1,d2,d3 F(sy
stem)(d1,d4),(d2,d4),(d3,d4) F(kitchen)(d1,d5
),(d2,d5),(d3,d5) F(action)(d1,d2,d3) F(light)
(d1,d6),(d2,d6),(d3,d6),(d1,d7),(d2,d7),(d3,d7)
F(in)(d1,d6,d5),(d2,d6,d5),(d3,d6,d5),(d1,d7,d5
),(d2,d7,d5),(d3,d7,d5) F(poweron)(d2,d6),(d2,d
7) F(poweroff) F(off)(d1,d6),(d1,d7) F(on)
(d3,d6),(d3,d7)
60ASR
??
?
SEM
Theorem Prover
Model Builder
If proof found, discourse is inconsistent If
model found, use it for further actions
Model Checker
query
61Videos of Godot
Video 1 Godot in the basement of Bucceuch Place
Video 2 Screenshot of dialogue manager with
DRSs and camera view of Godot
62What can we say about
- Demonstrated that FOL can play an interesting
role in dialogue systems - Also showed a new application of finite model
building - Limitations
- Scalability, only small dialogues
- Lack of incremental inference
- Minimal models required
63Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
64Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
65Robust Inference
- We got excellent theorem provers at our disposal
- But we need robust inference
- Why theorem proving is bad for robust inference
- How model building can help us to approximate
inferences
66Theorem Provers
- Theorem provers for first-order logic
- developed over the last four decades
- witnessed tremendous progress
- We got at our disposal very efficient theorem
provers such as - OTTER
- SPASS
- BLIKSEM
- VAMPIRE
67We need robust inference for real applications
- Even if are linguistic processing tools are
perfect, inferences are often made on the basis
of background knowledge - Appropriate background knowledge is notoriously
hard to compute - An example of a real application is the RTE
exercise - Recognising Textual Entailment
68Example (Vampire proof)
RTE-2 489 (TRUE)
Initially, the Bundesbank opposed the
introduction of the euro but was compelled to
accept it in light of the political pressure of
the capitalist politicians who supportedits
introduction. ------------------------------------
----------------- The introduction of the euro
has been opposed.
?
69Trouble with theorem proving
- Theorem provers are extremely precise.
- They wont tell you when there is almost a
proof. - Even if there is a little background knowledge
missing, even Vampire must give in and admit - dont know
70Vampire no proof
RTE 1049 (TRUE)
Four Venezuelan firefighters who were traveling
to a training course in Texas were killed when
their sport utility vehicle drifted onto the
shoulder of a highway and struck a parked
truck. -------------------------------------------
--------------------- Four firefighters were
killed in a car accident.
?
71Using Model Building
- Basic Idea
- Build models of T and TH
- If the models are similar, then it is likely
that T entails H - Measure similarity between models
- Define a threshold using machine learning
techniques
72Model Similarity
- When are two models similar?
- Small difference in domain size
- Small difference in predicate extensions
- Quantify model similarity
- Entailment Distance, ?
73Semantic Distance 1/2
- Suppose we want to measure the semantic distance
between p and q. - What do we do?
- Give p to a model builder
- Give pq to a model builder
- Give ?q to a model builder
- Give ?(qp) to a model builder
- Assume that gives us four minimal models Mp,
Mpq, M?q, and M?(qp)
74Semantic Distance 2/2
- The Semantic Distance ? is computed as
follows ? (Mpq - Mp) (M?(qp) -
M?q) - The closer ? is to 0, the closer p and q are in
an entailment relation - ? measures the amount of new information
introduced by q wrt p
75Example 1
- p John met Mary in Romeq John met Mary
- Model p 3 entitiesModel pq
3 entitiesModel ?q 1 entityModel
?(qp) 1 entity - ? (3-3)(1-1) 0
- Prediction entailment
76Example 2
- p John met Mary q John met Mary in Rome
- Model p 2 entitiesModel pq
3 entitiesModel ?q 1 entityModel
?(qp) 1 entity - ? (3-2)(1-1) 1
- Prediction almost entailment
77Example 3
- p John has no bike q John has no blue bike
- Model p 1 predicateModel pq
1 predicate Model ?q 2
predicatesModel ?(qp) 2 predicates - ? (1-1)(2-2) 0
- Prediction entailment
78Example 4
- p John has no blue bike q John has no bike
- Model p 1 predicateModel pq
1 predicate Model ?q 1
predicateModel ?(qp) 2 predicates - ? (1-1)(2-1) 1
- Prediction almost entailment
79Model size differences
- Of course this is a very rough approximation
- But it turns out to be a useful one
- Gives us a notion of robustness
- Successfully applied to NLP benchmarking
evaluations - Recognising Textual Entailment, RTE
- See Bos Markert 2005
80Model Building in Semantics
- Three main uses 1 Linguistic Interpretation
- 2 Interface to Applications
- 3 Robust Inference
81Conclusion
- If you want to use first-order inference in
linguistic applications, then - use both a theorem prover and a model builder
- where the theorem prover is used to filter out
uninteresting interpretations - The model builder can be used to
- rank the remaining interpretations
- provide a simple interface to the real world
- approximate robust inference
82Limitations
- Only finite domains
- Only small domains
- Non-incremental
- Background knowledge required
83Future
- Work on the mechanics of model building
- Tailor to linguistic applications
- Link up with knowledge representation work