Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 4 Predicate Logics. 344-471 AI & ESChapter 4 2 Representing simple facts in logic  It is raining. RAINING  If it is raining then it is not.

Similar presentations


Presentation on theme: "1 Chapter 4 Predicate Logics. 344-471 AI & ESChapter 4 2 Representing simple facts in logic  It is raining. RAINING  If it is raining then it is not."— Presentation transcript:

1 1 Chapter 4 Predicate Logics

2 AI & ESChapter 4 2 Representing simple facts in logic  It is raining. RAINING  If it is raining then it is not sunny. RAINING  ~ SUNNY  All men are motal. MORTALMAN man(mortal)  X : man(X)  mortal(X) 1. Change sentences 1 – 8 on page 134 to predicate logic. 2. prove ~loyalto(Marcus,Caesar) on page 136 Fig. 5.2

3 AI & ESChapter 4 3 Representing Instance and Isa Figure 5.3 page 138. : representing class membership

4 AI & ESChapter 4 4 Computable functions and predicate Figure 5.4 page 142. :a set of facts about Marcus

5 AI & ESChapter 4 5 Computable functions and predicate Figure 5.5 page 143. : Prove Marcus is dead

6 AI & ESChapter 4 6 Propositional Logic Given Axioms Converted to Clause FormP (P Q)  R~P v ~Q v R (S v T)  Q~S v Q ~T v QT

7 AI & ESChapter 4 7 predicates type(symbol, symbol) is_a(symbol, symbol) lives(symbol, symbol) can_swim(symbol) goal can_swim(What), write("A ", What, " can swim."). clauses type(ungulate, animal). type(fish, animal). is_a(zebra, ungulate). is_a(herring, fish). is_a(shark, fish). lives(zebra, on_land). lives(frog, on_land). lives(frog, in_water). lives(shark, in_water). can_swim(Y) :- type(X, animal), is_a(Y, X), lives(Y, in_water). EX05EX05 can_swim

8 AI & ESChapter 4 8 Z X Y parent sister For any X and Y, X is a sister of Y if 1. Both X and Y have the same parent, and 2. X is a female. Sister(X,Y) :- parent(Z,X), parent(Z,Y), female(X). predecessor

9 AI & ESChapter 4 9 A B C E D parent predecessor

10 AI & ESChapter 4 10 A B C E D predecessor(X,Z) :- parent(X,Y), parent(Y,Z). parent predecessor(X,Z) :- parent(X,Y1), parent(Y1,Y2), parent(Y2,Z). predecessor(X,Z) :- parent(X,Y1), parent(Y1,Y2), parent(Y2,Y3), parent(Y3,Z). predecessor

11 AI & ESChapter 4 11 predicates parent(symbol,symbol) predecessor(symbol,symbol) clauses parent(pam,bob). parent(tom,bob). parent(bob,ann). parent(ann,jim). parent(jim,joe). parent(joe,john). parent(john,jack). parent(tom,liz). predecessor(X,Z) :- parent(X,Z). predecessor(X,Z) :- parent(X,Y), parent(Y,Z). predecessor(X,Z) :- parent(X,Y1),parent(Y1,Y2),parent(Y2,Z). predecessor(X,Z) :- parent(X,Y1),parent(Y1,Y2),parent(Y2,Y3) parent(Y3,Z). annbobpam jim john joe jack Parent1.Pro

12 AI & ESChapter 4 12 A B C E D parent For all X and Z, X is a predecessor of Z if there is a Y such that 1. X is a parent of Y and 2. Y is a predecessor of Z. predecessor

13 AI & ESChapter 4 13 predecessor(X,Z) :- parent(X,Z). predecessor(X,Z) :- parent(X,Y), predecessor(Y,Z). predicates parent(symbol,symbol) predecessor(symbol,symbol) clauses parent(pam,bob). parent(tom,bob). parent(bob,ann). parent(ann,jim). parent(jim,joe). parent(joe,john). parent(john,jack). parent(tom,liz). Parent2.Pro

14 AI & ESChapter 4 14 Animal kingdom Plant kingdom AnimalHuman DogCat Toop Suwit Mew Sunee plant Flower RoseCarnation isa ISA Relationship

15 AI & ESChapter 4 15 is(X,Z) :- isa(X,Z). is(X,Z) :- isa(X,Y), is(Y,Z). predicates isa(symbol,symbol) is(symbol,symbol) clauses isa(human,animal_kingdom). isa(plant,plant_kingdon). isa(flower,plant). isa(rose,flower). isa(carnation,flower). isa(suwit,human). isa(sunee,human). isa(dog,animal). isa(animal,animal_kingdom). isa(cat,animal). isa(toop,dog). isa(mew,cat). isa(white,cat). isa1.Pro

16 AI & ESChapter 4 16 predicates big(symbol) small(symbol) brown(symbol) black(symbol) gray(symbol) dark(symbol) clauses big(bear). big(elephant). small(cat). brown(bear). black(cat). gray(elephant). dark(Z) :- black(Z). dark(Z) :- brown(Z). ?black(X),big(X) ?brown(X),big(X) ?big(X),black(X) ?black(X), big(X) No solution ?brown(X),big(X) X=bear ?big(X),black(X) No solution bear.Pro

17 17


Download ppt "1 Chapter 4 Predicate Logics. 344-471 AI & ESChapter 4 2 Representing simple facts in logic  It is raining. RAINING  If it is raining then it is not."

Similar presentations


Ads by Google