Presentation is loading. Please wait.

Presentation is loading. Please wait.

Supplemental slides for CSE 327 Prof. Jeff Heflin

Similar presentations


Presentation on theme: "Supplemental slides for CSE 327 Prof. Jeff Heflin"— Presentation transcript:

1 Supplemental slides for CSE 327 Prof. Jeff Heflin
Ch. 8 – First Order Logic Supplemental slides for CSE 327 Prof. Jeff Heflin

2 Goal-Based Agent Environment Agent sensors State
What the world is like now How the world evolves Environment What it will be like if I do action A What my actions do What action I should do now Goals actuators Agent From Fig. 2.13, p. 52

3 Knowledge-Based Agent
function KB-Agent(percept) returns an action persistent: KB, a knowledge base t, a counter, initially 0 indicating time Tell(KB, Make-Percept-Sentence(percept, t)) action  ASK(KB, Make-Action-Query(t)) Tell(KB, Make-Action-Sentence(action, t)) t  t + 1 return action From Figure 7.1, p. 236

4 Example KB Sentences For an adventure game AI, specified informally:
State of the world I am healthy A wall is in front of me Effects of actions If I fall in a pit, I will die If I shoot something, I will injure it Changing goals If I see an enemy, then attack If I am injured, then retreat

5 Syntax of First-Order Logic
Sentence  AtomicSentence | ComplexSentence AtomicSentence  Predicate(Term,…) | Term = Term ComplexSentence  (Sentence) |  Sentence | Sentence  Sentence | Sentence  Sentence | Sentence  Sentence | Sentence  Sentence | Quantifier Variable,… Sentence Term  Function(Term,…) | Constant | Variable Quantifier   |  From Figure 8.3, p. 293

6 Semantics of Complex Sentences
s1  s2 s1  s2 s1  s2 s1  s2 F T If s1 and s2 are sentences (atomic or complex) whose truth with respect to an interpretation are given by the first two columns, the truth of complex sentences formed from these sentences is given by the appropriate column.

7 Kinship Domain A1: x Male(x)  Female(x)
A2: x,y Husband(x,y)  Male(x)  Spouse(x,y) A3: x,y Spouse(x,y)  Spouse(y,x) A4: p,c Parent(p,c)  Child(c,p) A5:  x,y Sibling(x,y)  xy  p Parent(p,x)  Parent(p,y) A6:  x,y Ancestor(x,y)  Parent(x,y)  (z Parent(x,z)  Ancestor(z,y))

8 Minesweeper PEAS Description
Performance Measure percentage of mines found Environment NxM grid with random placement of mines Actuators choose a square Sensors chosen square has x adjacent mines or uncover mine and lose game

9 Minesweeper Predicates
Environment Mine(s) square s has a mine in it Sensing NearbyMines(s,k) square s has k adjacent mines Cleared(s) square s is safe (didn’t uncover a mine)

10 Minesweeper Axioms s Cleared(s)  Mine(s)
s,r NearbyMines(s,0)  Adjacent(s,r)  Mine(r) s NearbyMines(s,1)  r Adjacent(s,r)  Mine(r)  (t Adjacent(s,t)  Mine(t)  r=t) also need 6 other rules for 1<k<8 s,r NearbyMines(s,8)  Adjacent(s,r)  Mine(r) x,y,a,b Adjacent([x,y],[a,b])  (a=x+1  a=x  a=x-1)  (b=y  b=y+1  b=y-1)  (a=x  a=y)  Legal([x,y])  Legal([a,b]) x,y Legal([x,y])  x > 0  y > 0  x  N  y  M


Download ppt "Supplemental slides for CSE 327 Prof. Jeff Heflin"

Similar presentations


Ads by Google