1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to...

Post on 04-Jan-2016

219 views 0 download

Tags:

Transcript of 1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to...

1

Predicate (Relational) Logic

1

Introduction

The propositional logic is not powerful enough to express certain

types of relationship between propositions such as equivalence. 

Can not tell whether it is true or false unless you know the value of X

powerful logic to deal with these problems. PREDICATE LOGIC

2

X is greater than 1

3

Introduction

Usefulness of Predicate Logic for Natural Language Semantics

While in propositional logic, we can only talk about sentences as a whole, predicate logic allows us to decompose simple sentences into smaller parts: predicates and individuals. John is tall. T(j)

Predicate logic provides a tool to handle expressions of generalization: i.e., quantificational expressions. Every cat is sleeping. Some girl likes David. No one is happy.

Predicate logic allows us to talk about variables (pronouns). The value for the pronoun is some individual in the domain of universe that is contextually determined. It is sleeping. She likes David. He is happy.

Predicate

4

A predicate is a verb phrase template that describes a property of objects, or a relationship among objects represented by the variables.

 

"is blue“ or “B” is a predicate and it describes the property of being blue

 

The car Tom is driving is blueThe sky is blue

The cover of this book is blue

"B(x)"B(x) reads as "x is blue"

Predicate…

... gives ... to ... is a predicate describes a relationship among three objects

Give( x, y, z ) or G( x, y, z ) 

“gives a book to" B( x, y )5

John gives the book to MaryJim gives a bread to Tom

Jane gives a lecture to Mary

X gives Y to Z

Predicate…Exercise• Let G(x,y) represent the predicate x > y

G(6,13) means 13 is greater than 6

NO

G(2,0) is true

Yes

G(7,1) means 7 is greater than 1

Yes

“4 is less than 5” can be represented by G(5,4)

Yes

6

Predicate…Exercise• Let E(x,y) represent “x sent an e-mail to y”

~E(A,B) means A didn’t sent e-mail to B

Yes

E(A,B) is equivalent to E(B,A)

No

“B sent an e-mail to A” is represented by E(B,A)

Yes

E(x,y) can also be represented by a 3 variable predicate

Yes

7

Quantification Forming Propositions from Predicates

universe

universal quantifier

existential quantifier

free variable

bound variable

scope of quantifier

order of quantifiers

8

Quantification

A predicate with variables is not a proposition

x > 1 

It can be true or false depending on the value of x. A predicate with variables can be made a proposition by applying

assign a value to the variable quantify the variable using a quantifier.

 If 3 is assigned to x becomes 3 > 1, and it becomes a true statement, hence a proposition.

A quantification is performed on formulas of predicate logic ( wff ), such as x > 1 or P (x), by using quantifiers on variables.

There are two types of quantifiers: universal quantifier and existential quantifier.

9

Quantification

Universe of Discourse (universe)

“the set of objects of interest”

“the domain of the (individual) variables”

set of real numbers, the set of integers, the set of all cars on a parking lot, the set of all students in a classroom 

10

Quantification

Universal quantifier: turns the statement x > 1 to

"for every object x in the universe, x > 1", which is expressed as

“x, x > 1”

x, P(x) "For all x, P(x) holds", "for each x, P(x) holds" , P(x) is true for every

object x in the universe.

Ex. "All cars have wheels"  x, P(x), • P(x) is the predicate denoting: x has wheels• and the universe of discourse is only populated by cars.

11

Quantification

 

12

Examples

13

 

Bound & Free variables

bound variable: if either a specific value is assigned to it or it is quantified

Free variable:. If an appearance of a variable is not bound

Scope of the quantifier: The scope of a quantifier is the portion of a formula where it binds its variables, is indicated by square brackets [ ]

14

Examples

15

 

 t: The scope of the second existential quantifier.

How to read quantified formulas

16

 

Order of Application of Quantifiers

 

17

Well-Formed Formula WFF

18

Examples

19

Examples

 

20

One way to check whether or not an expression is a wff is to try to state it in English. If you can translate it into a correct

English sentence, then it is a wff. 

Reasoning with Predicate Logic

Inference rules of predicate logic Universal instantiation Universal generalization Existential instantiation Existential generalization Negation of quantified statement

Predicate logic is more powerful than propositional logic. It allows one to reason about properties and relationships of individual objects.

21

22

Quantified inference rules

Universal instantiation x P(x) P(A)

Universal generalization P(A) P(B) … x P(x)

Existential instantiation x P(x) P(F) skolem constant F

Existential generalization P(A) x P(x)

23

Universal instantiation

If (x) P(x) is true, then P(C) is true, where C is any constant in the domain of x

Example: (x) eats(Ziggy, x) eats(Ziggy, IceCream)

The variable symbol can be replaced by any ground term, i.e., any constant symbol or function symbol applied to ground terms only

24

Universal generalization

If P(c) is true, then ( x) P(x) is inferred.

Exampleeats(Ziggy, IceCream) ( x) eats(Ziggy, x)

All instances of the given constant symbol are replaced by the new variable symbol

Note that the variable symbol cannot already exist anywhere in the expression

25

Existential instantiation

From (x) P(x) infer P(c)

Example: (x) eats(Ziggy, x) eats(Ziggy, Stuff)

Note that the variable is replaced by a brand-new constant not occurring in this or any other sentence in the KB

Also known as skolemization; constant is a skolem constant

In other words, we don’t want to accidentally draw other inferences about it by introducing the constant

Convenient to use this to reason about the unknown object, rather than constantly manipulating the existential quantifier

26

Existential generalization

If P(c) is true, then (x) P(x) is inferred.

Exampleeats(Ziggy, IceCream) (x) eats(Ziggy, x)

All instances of the given constant symbol are replaced by the new variable symbol

Note that the variable symbol cannot already exist anywhere in the expression

27

Connections between All and Exists

We can relate sentences involving and using De Morgan’s laws:

(x) P(x) ↔ (x) P(x)

(x) P(x) ↔ (x) P(x)

(x) P(x) ↔ (x) P(x)

(x) P(x) ↔ (x) P(x)

Homework 2

28

29

Thank You!