first-order logic (and beyond) johan bos

30
First-Order Logic (and beyond) Johan Bos

Upload: katy

Post on 14-Jan-2016

87 views

Category:

Documents


0 download

DESCRIPTION

First-Order Logic (and beyond) Johan Bos. Overview of this lecture. Introduction to first-order logic Discourse Representation Theory Using the Lambda-Calculus. Logical languages. propositional logic modal logic description logic first-order logic ( predicate logic) second-order logic - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: First-Order Logic (and beyond) Johan Bos

First-Order Logic

(and beyond)

Johan Bos

Page 2: First-Order Logic (and beyond) Johan Bos

Overview of this lecture

• Introduction to first-order logic

• Discourse Representation Theory

• Using the Lambda-Calculus

Page 3: First-Order Logic (and beyond) Johan Bos

Logical languages

• propositional logic

• modal logic

• description logic

• first-order logic (predicate logic)

• second-order logic

• higher-order logic

expressive power

Page 4: First-Order Logic (and beyond) Johan Bos

This lecture

• In this lecture we will try to map English to First-Order Logic

• First-order logic extends propositional logic with variables and quantifiers

• As we will see it is capable for modelling sub-sentential semantics

Page 5: First-Order Logic (and beyond) Johan Bos

First-order logic

• First-order logic is a language

• So we will look at its ingredients

• We will define the syntax, or in other words, the “grammar”

• We will look at the semantics only from an informal point of view

Page 6: First-Order Logic (and beyond) Johan Bos

Ingredients of first-order logic

• Terms (variables or contants)– Variables: x, y, z, …– Constants: m’, j’, …

• Predicate Symbols– One-place predicate symbols: walk, smoke, …– Two-place predicate symbols: see, love, …

• Connectives: , ,, , • Punctuation: brackets ( ) and the comma ,• The quantifiers

– Universal quantifier: – Existential quantifier:

Page 7: First-Order Logic (and beyond) Johan Bos

Syntax of first-order logic

• If P is a one-place relation symbol, and t a term, then P(t) is a first-order formula

• If R is a two-place relation symbol, and t1 and t2 are terms, then R(t1,t2) is a first-order formula

• If is a first-order formula, then so is • If and are first-order formulas, then so are

(), (), () and ()• If is a first-order formula, and x a variable,

then x and x are first-order formulas• Nothing else is a first-order formula

Page 8: First-Order Logic (and beyond) Johan Bos

Examples of first-order formulas

• Mia walks. walk(mia’)

• A dog barks. x(dog(x) bark(x))

• Vincent likes every dog. x(dog(x) like(vincent’,x))

Page 9: First-Order Logic (and beyond) Johan Bos

Semantics of the quantifiers

x true if and only if there is an x such that is true

x true if and only if for all x it is the case that is true

Page 10: First-Order Logic (and beyond) Johan Bos

Truth and Models

• Truth in first-order logic is often defined with the help of models

• A model M is usually taken to consist of two parts (M = <D,F>): (1) a domain of entities (D)(2) an interpretation function (F) for all non-logical symbols

• The truth-definition with models was introduced by the famous logician Alfred Tarski

Page 11: First-Order Logic (and beyond) Johan Bos

Example model

• M = <D,F>• D = {d1,d2,d3}• F(mia’) = d1

F(vincent’) = d2F(person) = {d1,d2}F(dog) = {d3}F(love) = {(d1,d2),(d2,d2),(d2,d1),(d2,d3)}F(hate) = {(d1,d3)}

Page 12: First-Order Logic (and beyond) Johan Bos

Semantics of the quantifiers

x true in M if and only if we can map x to at least one member of D such that is true in M

x true if and only if for all members of D, if we map x it, it is the case that is true in M

Page 13: First-Order Logic (and beyond) Johan Bos

Free variables

• The quantifiers bind variables• For instance, x binds all

occurrences of x in the formula • Variables that are not bound are

called free• For instance, the following two formulas

contain free variables:– walk(x)– smoke(y) y person(y)

Page 14: First-Order Logic (and beyond) Johan Bos

Closed formulas

• Formulas that have no free variables are called closed

• Usually we’re only interested in closed formulas --- translating a natural language sentence to first-order logic should produce a closed formula

• Free variables can be thought of as “pronouns”.

Page 15: First-Order Logic (and beyond) Johan Bos

What’s wrong with these translations?

• A dog barks. (x dog(x) bark(x))

• A dog barks. x(dog(x) bark(x))

• Every dog barks. x(dog(x) bark(x))

Page 16: First-Order Logic (and beyond) Johan Bos

Lambdas and Higher-order Logic

• Fine, we have seen how we can represent English (or Italian) sentences into logic, but what about – noun phrases, – verb phrases, – nouns, – determiners, – adjectives, – prepositions, and so on?

Page 17: First-Order Logic (and beyond) Johan Bos

Montague Grammar

• Richard Montague usedhigher order logic to translatesub-sentence fragments intologic

• Basically we add to two new constructs to first-order logic:– the lambda operator λ – function application ()

Page 18: First-Order Logic (and beyond) Johan Bos

Examples with lambdas

• The lambda binds variables and can be seen as a “place-holder” for missing information

• Examples:

Mia mia’

man λz.man(z)

love λx. λy. love(y,x)

every λp. λq. x(p(x) q(x))

Page 19: First-Order Logic (and beyond) Johan Bos

Example derivation

loves Mia λx. λy. love(y,x) (mia’) = λy. love(y,mia’)

Every man λp. λq. x(p(x) q(x))(λz.man(z)) = λq. x(λz.man(z)(x) q(x)) = λq. x(man(x) q(x))

Every man loves Mia λq. x(man(x) q(x)) (λy. love(y,mia’)) = x(man(x) λy. love(y,mia’)(x)) = x(man(x) love(x,mia’))

Page 20: First-Order Logic (and beyond) Johan Bos

Discourse Representation Theory

• Nice so far, but what about translating pronouns that have antecedents across sentences?– Mia dances. She is happy.– A man smokes. He likes Mia.

• Hans Kamp introduced DRT(Discourse Representation Theory) to deal with a lotof anaphoric phenomena.

Page 21: First-Order Logic (and beyond) Johan Bos

Problematic cases for FOL

• A woman dances. She is happy. x(woman(x) dance(x)) happy(x)

• Every farmer who owns a donkey beats it.x((farmer(x) y(donkey(y) own(x,y))) beat(x,y))

Page 22: First-Order Logic (and beyond) Johan Bos

Problematic cases for FOL

• A woman dances. She is happy. x(woman(x) dance(x)) happy(x) x(woman(x) dance(x) happy(x))

• Every farmer who owns a donkey beats it.x((farmer(x) y(donkey(y) own(x,y))) beat(x,y))xy((farmer(x) donkey(y) own(x,y)) beat(x,y))

Page 23: First-Order Logic (and beyond) Johan Bos

Discourse Representation Theory

• DRT is a theory of natural language semantics using DRSs to represent texts (discourse)

• A DRS encapsulates both content and context– Content: the meaning of the text so far– Context: information to interpret anaphoric

expressions in subsequent sentences

Page 24: First-Order Logic (and beyond) Johan Bos

DRT examples

• Discourse Representation Structures (DRS)– Discourse referents (first-order variables)– Structure plays role in pronoun resolution

A dog barked.

x

dog(x)

bark(x)

Page 25: First-Order Logic (and beyond) Johan Bos

DRT examples

• Discourse Representation Structures (DRS)– Discourse referents (first-order variables)– Structure plays role in pronoun resolution

A dog barked.

x

dog(x)

bark(x)

Every dog barked.

x

dog(x) bark(x)

Page 26: First-Order Logic (and beyond) Johan Bos

Accessibility (1)

• Discourse referents are accessible if they are in the same DRS

A dog barked. It was happy.

x y

dog(x)

bark(x)

happy(y)y = ???

Page 27: First-Order Logic (and beyond) Johan Bos

Accessibility (1)

• Discourse referents are accessible if they are in the same DRS

A dog barked. It was happy.

x y

dog(x)

bark(x)

happy(y)y = x

Discourse referent x is accessible

Page 28: First-Order Logic (and beyond) Johan Bos

Accessibility (2)

• Discourse referents are not accessible if they are part of a nested DRS

Every dog barked. ?It was happy.

y

happy(y)

y = ??

x

dog(x) bark(x)

Discourse referent x is not accessible

Page 29: First-Order Logic (and beyond) Johan Bos

Donkey Sentences

• DRT solves the donkey sentence problem

Every farmer that owns a donkey beats it.

x y

farmer(x)

donkey(y)

own(x,y)

beat(x,y)

Page 30: First-Order Logic (and beyond) Johan Bos

Further Reading

• Gamut, Volume 2(Montague Grammar)

• Kamp & Reyle (Discourse Representation Theory)