logical agents
play

Logical agents Chapter 7, Sections 15 of; based on AIMA Slides c - PowerPoint PPT Presentation

Logical agents Chapter 7, Sections 15 of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 15 1 Outline Knowledge-based agents Example: The


  1. Logical agents Chapter 7, Sections 1–5 of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 1

  2. Outline ♦ Knowledge-based agents ♦ Example: The wumpus world ♦ Logic in general—models and entailment ♦ Propositional (Boolean) logic ♦ Equivalence, validity, satisfiability ♦ Inference rules and theorem proving – forward chaining – backward chaining – resolution of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 2

  3. Knowledge bases domain−independent algorithms Inference engine Knowledge base domain−specific content Knowledge base = set of sentences in a formal language Declarative approach to building an agent (or other system): Tell it what it needs to know Then it can Ask itself what to do—answers should follow from the KB Agents can be viewed at the knowledge level i.e., what they know , regardless of how implemented Or at the implementation level i.e., data structures in KB and algorithms that manipulate them of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 3

  4. Wumpus world: PEAS description Performance measure gold +1000 , death − 1000 − 1 per step, − 10 for using the arrow Breeze Environment Stench 4 PIT Squares adjacent to wumpus are smelly Breeze Breeze 3 Squares adjacent to pit are breezy PIT Stench Gold Glitter iff gold is in the same square Breeze Stench 2 Shooting kills wumpus if you are facing it Shooting uses up the only arrow Breeze Breeze 1 PIT Grabbing picks up gold if in same square START Releasing drops the gold in same square 1 2 3 4 Actuators Left turn, Right turn, Forward, Grab, Release, Shoot Sensors Breeze, Glitter, Smell of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 4

  5. Wumpus world characterization Observable?? No—only local perception Deterministic?? Yes—outcomes exactly specified Episodic?? No—sequential at the level of actions Static?? Yes—Wumpus and Pits do not move Discrete?? Yes Single-agent?? Yes—Wumpus is essentially a natural feature of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 5

  6. Exploring a wumpus world OK OK OK A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 6

  7. Exploring a wumpus world OK S A OK OK A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 7

  8. Exploring a wumpus world W? OK W? S A OK OK A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 8

  9. Exploring a wumpus world W? OK W? S A OK OK B P A A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 9

  10. Exploring a wumpus world W? W OK W? S OK A OK OK B P A A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 10

  11. Exploring a wumpus world W? W OK W? S OK A A OK OK B P A A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 11

  12. Exploring a wumpus world W? OK W OK W? OK S OK A A OK OK B P A A of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 12

  13. Other tight spots P? Breeze in (1,2) and (2,1) B OK P? P? ⇒ no safe actions A Assuming pits uniformly distributed, OK B OK (2,2) has pit w/ prob 0.86, vs. 0.31 P? A A Smell in (1,1) ⇒ cannot move Can use a strategy of coercion: shoot straight ahead S wumpus was there ⇒ dead ⇒ safe A wumpus wasn’t there ⇒ safe of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 13

  14. Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language Semantics define the “meaning” of sentences; i.e., define truth of a sentence in a world E.g., the language of arithmetic x + 2 ≥ y is a sentence; x 2 + y > is not a sentence x + 2 ≥ y is true iff the number x + 2 is no less than the number y x + 2 ≥ y is true in a world where x = 7 , y = 1 x + 2 ≥ y is false in a world where x = 0 , y = 6 of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 14

  15. Entailment Entailment means that one thing follows from another: KB | = α A knowledge base KB entails a sentence α if and only if α is true in all worlds where KB is true E.g., the KB containing “There’s a pit ahead” and “There’s gold to the left” entails “Either there’s a pit ahead or gold to the left” E.g., x + y = 4 entails 4 = x + y Entailment is a relationship between sentences (i.e., syntax ) that is based on semantics of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 15

  16. Models Logicians typically think in terms of models, which are formally structured worlds with respect to which truth can be evaluated We say m is a model of a sentence α if α is true in m M ( α ) is the set of all models of α Then KB | = α if and only if M ( KB ) ⊆ M ( α ) x x x x x x x x E.g. KB = { there’s a pit ahead, x xx M( ) x x x there’s gold to the left } x x x x x x x x x α = there’s gold to the left x x x x x x xx x x x x x x x x x x M(KB) x x x x x x of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 16

  17. Entailment in the wumpus world Situation after detecting nothing in [1,1], moving right, breeze in [2,1] ? ? B ? Consider possible models for ?s A A assuming only pits 3 Boolean choices ⇒ 8 possible models of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 17

  18. Wumpus models 2 PIT 2 Breeze 1 Breeze 1 PIT 1 2 3 1 2 3 2 PIT 2 PIT 2 Breeze 1 PIT Breeze 1 Breeze 1 1 2 3 1 2 3 1 2 3 2 PIT PIT 2 PIT Breeze 1 Breeze 1 PIT 2 PIT PIT 1 2 3 1 2 3 Breeze 1 PIT 1 2 3 of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 18

  19. Wumpus models 2 PIT 2 Breeze 1 Breeze 1 PIT 1 2 3 KB 1 2 3 2 PIT 2 PIT 2 Breeze 1 PIT Breeze 1 Breeze 1 1 2 3 1 2 3 1 2 3 2 PIT PIT 2 PIT Breeze 1 Breeze 1 PIT 2 PIT PIT 1 2 3 1 2 3 Breeze 1 PIT 1 2 3 KB = wumpus-world rules + observations of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 19

  20. Wumpus models 2 PIT 2 Breeze 1 Breeze 1 PIT 1 2 3 KB 1 2 3 1 2 PIT 2 PIT 2 Breeze 1 PIT Breeze 1 Breeze 1 1 2 3 1 2 3 1 2 3 2 PIT PIT 2 PIT Breeze 1 Breeze 1 PIT 2 PIT PIT 1 2 3 1 2 3 Breeze 1 PIT 1 2 3 KB = wumpus-world rules + observations α 1 = “[1,2] is safe”, KB | = α 1 , proved by model checking of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 20

  21. Wumpus models 2 PIT 2 Breeze 1 Breeze 2 1 PIT 1 2 3 KB 1 2 3 2 PIT 2 PIT 2 Breeze 1 PIT Breeze 1 Breeze 1 1 2 3 1 2 3 1 2 3 2 PIT PIT 2 PIT Breeze 1 Breeze 1 PIT 2 PIT PIT 1 2 3 1 2 3 Breeze 1 PIT 1 2 3 KB = wumpus-world rules + observations α 2 = “[2,2] is safe”, KB �| = α 2 of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 21

  22. Inference KB ⊢ i α = sentence α can be derived from KB by procedure i Consequences of KB are a haystack; α is a needle. Entailment = needle in haystack; inference = finding it Soundness: i is sound if whenever KB ⊢ i α , it is also true that KB | = α Completeness: i is complete if whenever KB | = α , it is also true that KB ⊢ i α Preview: we will define a logic (first-order logic) which is expressive enough to say almost anything of interest, and for which there exists a sound and complete inference procedure. That is, the procedure will answer any question whose answer follows from what is known by the KB . of; based on AIMA Slides c Artificial Intelligence, spring 2013, Peter Ljungl¨ � Stuart Russel and Peter Norvig, 2004 Chapter 7, Sections 1–5 22

Recommend


More recommend