artificial intelligence
play

ARTIFICIAL INTELLIGENCE Russell & Norvig Chapter 8. - PowerPoint PPT Presentation

ARTIFICIAL INTELLIGENCE Russell & Norvig Chapter 8. First-Order Logic, part 2 Interacting with FOL KBs Tell the system assertions Facts : Tell (KB, person (John) ) Rules: Tell (KB, x, person(x) likes(x,


  1. ARTIFICIAL INTELLIGENCE Russell & Norvig Chapter 8. First-Order Logic, part 2

  2. Interacting with FOL KBs • Tell the system assertions • Facts : • Tell (KB, person (John) ) • Rules: • Tell (KB, ∀ x, person(x) ⇒ likes(x, McDonalds)) • Ask questions • Ask (KB, person(John)) • Ask (KB, likes(John, McDonalds)) • Ask (KB, likes(x, McDonalds))

  3. Types of Answers • Fact is in the KB • Yes. • Fact is not in the KB • Yes (if it can be proven from the KB) • No (otherwise) • Text uses • AskVars (KB, Person(x)) • Expects a list of bindings for which the fact can be proven, e.g. ((x Fred) (x Mary) … )

  4. Kinship Axioms in Prolog father(X,Y) :- � parent(X,Y), � male(X). � brother(X,Y) :- � male(X), � mother(M,X), � mother(M,Y), � father(F,X), � father(F,Y), � not(X=Y). �

  5. More kinship examples daughter(D,P) :- � female(D), � parent(P,D). � � grandchild(Z,X) :- � parent(X,Y), � parent(Y,Z). � � greatgrandparent(GGP, C) :- � parent(GGP,P), � grandchild(C,P). � � �

  6. Kinship Example • From exercise 8.14

  7. Kinship Facts married(george,mum). � parent(george,elizabeth). � married(spencer,kydd). � parent(mum,elizabeth). � married(philip,elizabeth). � parent(spencer,diana). � married(charles,diana). � parent(kydd,diana). � … � parent(elizabeth,charles). � male(andrew). � parent(philip,charles). � male(edward). � parent(elizabeth,anne). � male(william). � parent(philip,anne). � male(harry). � parent(elizabeth,andrew). � … � parent(philip,andrew). � female(elizabeth). � parent(diana,william). � female(margaret). � parent(charles,william). � female(diana). � parent(diana,harry). � female(anne). � parent(charles,harry). � female(sarah). � … � … �

  8. Wumpus World Examples • Percept[Stench, Breeze, Glitter, Bump, Scream] • Suppose a wumpus-world agent is using a FOL KB and perceives a smell and breeze (but no glitter) at t=5 • TELL(KB, Percept([Stench, Breeze, None, None, None],5)) • ASK(KB, ∃ a Action(a, 5)) • i.e. does the KB entail any particular action at t=5? • Answer: Yes, {a/Shoot} <- substitution (binding list)

  9. Knowledge Base for Wumpus World • “ Perception ” ∀ s, g, m, c, t Percept([s, Breeze, g, m, c], t) ⇒ Breeze(t) ∀ s, b, m, c, t Percept([s, b, Glitter, m, c], t) ⇒ Glitter(t) • “ Reflex ” • ∀ t Glitter(t) ⇒ BestAction(Grab, t) Big advantage for FOL: ∀ x, y, a, b Adjacent([x,y], [a,b]) ó (x=a ∧(y=b-1 !∨ !y=b+1)) !∨ !(y=b !∧ !(x=a-1 !∨ !x=a+1))

  10. Inferring properties of squares If agent is at square s at time t and there is a Breeze percept at time t, then square s is Breezy. ∀ s,t At(Agent, s, t) ∧ Breeze(t) ⇒ Breezy(s) Then in FOL, locating Pits is summarized in one axiom: ∀ s Breezy(s) ó ∃ r Adjacent(r,s) ∧ Pit(r) Can also quantify over time: ∀ t HaveArrow(t+1) ó HaveArrow(t) ∧ ¬ Action(Shoot, t))

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend