first order logic in knowledge representation

14
FIRST ORDER LOGIC IN KNOWLEDGE REPRESENTATION Ishara Athukorala EP 1310 04/24/22 1

Upload: sabaragamuwa-university

Post on 14-Jan-2017

196 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: First order logic in knowledge representation

FIRST ORDER LOGIC IN KNOWLEDGE

REPRESENTATION Ishara AthukoralaEP 1310

05/01/23

1

Page 2: First order logic in knowledge representation

Why First Order Logic

Propositional logic has limited expressive power.

• Propositional logic assumes that the world contains facts. • First-order logic assumes the world contains,

• Objects: people, houses, numbers, colors, baseball games, wars, …

• Relations: red, round, prime, brother of, bigger than, part of, comes between, …

• Functions: father of, best friend, one more than, …05/01/23

2

Page 3: First order logic in knowledge representation

Syntax of First Order Logic

• Constants: john,apples• Predicates: likes(john, apples)• Functions: likes(john, fruit_of(apple_tree))• Variables: likes(X, apples) • Connectives:, , , , • Equality:=• Quantifiers: True for all objects (Universal)

Exists at least one object (Existential)05/01/23

3

Page 4: First order logic in knowledge representation

Relations

• Some relations are properties: they state some fact about a single object: Round(ball), Prime(7).

• n-ary relations state facts about two or more objects: Married(John,Mary), LargerThan(3,2).

• Some relations are functions: their value is another object: Plus(2,3), Father(Dan).

05/01/23

4

Page 5: First order logic in knowledge representation

Models for FOL: Graphical Example

05/01/23

5

Page 6: First order logic in knowledge representation

Terms

• A logical expression that refers to an object.• Two types of terms,

1. Constant symbols2. Function symbols

05/01/23

6

Page 7: First order logic in knowledge representation

Atomic Sentences

• Atomic sentences state facts using terms and predicate symbols

P(x,y) interpreted as “x is P of y”.Examples:• Brother_of(Mary,Pete) is false• Brother_of(Pete,Brother(Pete)) is True.

Binary relation Function

05/01/23

7

Page 8: First order logic in knowledge representation

Complex Sentences

• Complex sentences with connectives ( ( ), ) ( ( ))Brother Lef tLeg Richard J ohn Democrat Bush

objects

connectives

Binary relation

function

properties

05/01/23

8

Page 9: First order logic in knowledge representation

Universal Quantification

05/01/23

9

Page 10: First order logic in knowledge representation

Existential Quantification

05/01/23

10

Page 11: First order logic in knowledge representation

Some Examples…

• All purple mushrooms are poisonous.x (mushroom(x) purple(x)) poisonous(x)

• Every gardener likes the sun.x gardener(x) likes(x,Sun)

• Clinton is not tall.tall(Clinton)

05/01/23

11

Page 12: First order logic in knowledge representation

Some Examples…

• “On Mondays and Wednesdays I go to John’s house for dinner”

X.((is_mon(X) V is_wed(X)) -> eat_meal(me,houseOf(John),X))

• “Every rose has a thorn” X(rose(X) -> EY.(has(X,Y) thorn(Y)))

05/01/23

12

Page 13: First order logic in knowledge representation

References

• Benson Mates, Elementary Logic, OUP, New York 1972 (Library of Congress Catalog Card no.74-166004)• Elliot Mendelson, Introduction to Mathematical Logic, Van

Nostran Reinholds Company, New York 1964

05/01/23

13

Page 14: First order logic in knowledge representation

THANK YOU

05/01/23

14