1 / 17

Chapter 4 Predicate Logics

Chapter 4 Predicate Logics. Representing simple facts in logic. The End. 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)

kristy
Download Presentation

Chapter 4 Predicate Logics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 4Predicate Logics

  2. Representing simple facts in logic The End • 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 Chapter 4

  3. Representing Instance and Isa Figure 5.3 page 138. : representing class membership Chapter 4

  4. Computable functions and predicate The End Figure 5.4 page 142. :a set of facts about Marcus Chapter 4

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

  6. Propositional Logic Given Axioms Converted to Clause Form P P (P Q) R ~P v ~Q v R (S v T)  Q ~S v Q ~T v Q T T Chapter 4

  7. EX05EX05 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). predicates type(symbol, symbol) is_a(symbol, symbol) lives(symbol, symbol) can_swim(symbol) goal can_swim(What) , write("A ", What, " can swim."). Chapter 4

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

  9. A B C E D predecessor parent parent parent parent Chapter 4

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

  11. ann bob pam jim john joe jack Parent1.Pro • 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). Chapter 4

  12. A B C E D predecessor 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. parent parent parent parent Chapter 4

  13. Parent2.Pro • 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), predecessor(Y,Z). Chapter 4

  14. ISA Relationship Animal kingdom Plant kingdom isa isa isa Animal Human plant isa isa isa isa Dog Cat Suwit Sunee Flower isa isa isa isa Toop Mew Rose Carnation Chapter 4

  15. isa1.Pro • 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). • is(X,Z) :- isa(X,Z). • is(X,Z) :- isa(X,Y), is(Y,Z). Chapter 4

  16. bear.Pro • 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 Chapter 4

  17. One that would have the fruit must climb the tree

More Related