200 likes | 343 Views
Agents that use logic. Knowledge, inference and action in the environment. Logic – based agents. reason by inference on KB (search) evaluating logical expressions knowledge of environment where do goals, plans, actions fit in? in the KB or external?. Example – reasoning only.
E N D
Agents that use logic Knowledge, inference and action in the environment
Logic – based agents • reason by • inference on KB (search) • evaluating logical expressions knowledge of environment where do goals, plans, actions fit in? in the KB or external? D Goforth - COSC 4117, fall 2003
Example – reasoning only • Smith, Jones and Clark each has a distinct job • programmer, knowledge engineer, manager • Jones owes programmer $1000 • manager’s spouse doesn’t allow borrowing • Smith is not married Who has which job? D Goforth - COSC 4117, fall 2003
Knowledge • 9 propositions: • Cp, Ck, Cm • Jp, Jk, Jm • Sp, Sk, Sm • 29 = 512 rows in truth table S: Smith; J: Jones; C: Clark p: programmer; k: knowledge engineer; m: manager D Goforth - COSC 4117, fall 2003
Knowledge • general knowledge • Jp \/ Sp \/ Cp // there’s a programmer • Jp => ~Sp ^ ~Cp //just one programmer • Sp => ~Jp ^ ~Cp • Cp => ~Sp ^ ~Jp D Goforth - COSC 4117, fall 2003
Knowledge • general knowledge • Jp \/ Jm \/ Jk // Jones has a job • Jp => ~Jm ^ ~Jk //just one job • Jm => ~Jp ^ ~Jk • Jk => ~Jm ^ ~Jp D Goforth - COSC 4117, fall 2003
Knowledge • facts • ~Jp // Jones owes programmer $1000 • ~Jm // manager doesn’t borrow • ~Sm // Smith not married, not mgr Construct the truth table headings D Goforth - COSC 4117, fall 2003
Knowledge base 24 general knowledge sentences facts 9 propositions Cp Ck Cm … CpJpSp … ~Jp~Jm~Sm KB=ΛRi Reasoning Smith is not married Jones owes programmer $1000 Common Sense manager’s spouse doesn’t allow borrowing D Goforth - COSC 4117, fall 2003
Dynamic environments • Logic is based on static knowledge • If agents can act to change their environment, logical representation has problems because “facts” are changing • What happens to conclusions based on original facts? D Goforth - COSC 4117, fall 2003
Wumpus world D Goforth - COSC 4117, fall 2003
Representing the world • Wumpus world environment facts • 16 propositions for pits • 16 propositions for breeze • 16 propositions for wumpus • 16 propositions for stench • 16 propositions for gold • 16 propositions for glitter D Goforth - COSC 4117, fall 2003
Representing the world • Wumpus world general knowledge • relate pits and breezes • relate wumpus and stench • relate gold to glitter D Goforth - COSC 4117, fall 2003
Adding changing facts, plans and actions • Wumpus world agent location and orientation • proposition for location: L11 • proposition for orientation: R, U, D, L (facing Right, etc) • propositions for moving: Fwd, TL, TR • ... plus shooting, grabbing gold. • problem – information is not static • at L23 – after move: no longer true, at L22 D Goforth - COSC 4117, fall 2003
Possible agent models • implement timed logic • Facts are true at specific time • keep other changing information outside KB (e.g., position, orientation of agent) D Goforth - COSC 4117, fall 2003
Timed logic • solution: location and orientation have time also • L111, at location (1,1) at time 1 • L239 • R7, facing right at time 7 • R7 TR7 D8 • R7 L117 Fwd7 L218 D Goforth - COSC 4117, fall 2003
t=0 1 2 3 4 5 6 Dynamic problem:too many propositions KB keeps a ‘history’ of the activity as a series of snapshots D Goforth - COSC 4117, fall 2003
t=0 1 2 3 4 5 6 Dynamic problem:too many propositions • Partial solutions: • More powerful logic (next chapter) • Keep dynamic knowledge separate • static reasoning in KB • dynamic in: • algorithm in agent (p.226) • reflex wired agent (p.229) D Goforth - COSC 4117, fall 2003
2. Static reasoning onlyin reflex ‘circuit’ agent Vector of perceptions State variable Actions
2. Static reasoning onlyin reflex ‘circuit’ agent Vector of perceptions State variables Actions