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

artificial intelligence
SMART_READER_LITE
LIVE PREVIEW

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,


slide-1
SLIDE 1

ARTIFICIAL INTELLIGENCE

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

slide-2
SLIDE 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))
slide-3
SLIDE 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) … )

slide-4
SLIDE 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).

slide-5
SLIDE 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).

slide-6
SLIDE 6

Kinship Example

  • From exercise 8.14
slide-7
SLIDE 7

Kinship Facts

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

slide-8
SLIDE 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)

slide-9
SLIDE 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))

slide-10
SLIDE 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))