logical agents
play

Logical agents 5 AI Slides (5e) c Lin Zuoquan@PKU 2003-2019 5 1 - PowerPoint PPT Presentation

Logical agents 5 AI Slides (5e) c Lin Zuoquan@PKU 2003-2019 5 1 5 Logical Agents 5.1 Knowledge-based agents 5.2 Propositional logic 5.3 Theorem proving 5.4 Resolution 5.5 Model checking 5.6 SAT problem AI Slides (5e) c Lin


  1. Logical agents 5 AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 1

  2. 5 Logical Agents 5.1 Knowledge-based agents 5.2 Propositional logic 5.3 Theorem proving 5.4 Resolution 5.5 Model checking ∗ 5.6 SAT problem ∗ AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 2

  3. Knowledge-based agents Logic: study of thought, rational part of intelligence Knowledge: power of thinking Before building knowledge-based systems (agents) before there can be learning, reasoning, planning, · · · need to be able to express knowledge Need a formal (precise declarative) language → logical language domain−independent algorithms Inference engine Knowledge base domain−specific content KB = set of sentences in a logical language IE = algorithms by logical reasoning Using logic: – no universal language / why not English or Chinese? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 3

  4. knowledge level Declarative approach to building an agent Tell it what it needs to know — into KB Then it can Ask itself what to do — from 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 struct. in KB and algorithms that manipulate them AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 4

  5. A simple 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 The agent must be able to Represent states, actions, etc. Incorporate new percepts Update internal representations of the world Deduce hidden properties of the world Deduce appropriate actions AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 5

  6. Wumpus World Performance measure gold +1000, death -1000 -1 per step, -10 for using the arrow Environment Breeze Stench 4 PIT Squares adjacent to wumpus are smelly Squares adjacent to pit are breezy Breeze Breeze 3 PIT Stench Glitter iff gold is in the same square Gold Breeze Shooting kills wumpus if you are facing it Stench 2 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 AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 6

  7. Wumpus world characterization Observable?? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 7

  8. Wumpus world characterization Observable?? No—only local perception Deterministic?? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 8

  9. Wumpus world characterization Observable?? No—only local perception Deterministic?? Yes—outcomes exactly specified Episodic?? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 9

  10. Wumpus world characterization Observable?? No—only local perception Deterministic?? Yes—outcomes exactly specified Episodic?? No—sequential at the level of actions Static?? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 10

  11. 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?? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 11

  12. 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?? AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 12

  13. 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 AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 13

  14. Exploring a wumpus world OK OK OK A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 14

  15. Exploring a wumpus world B OK A OK OK A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 15

  16. Exploring a wumpus world P? B OK P? A OK OK A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 16

  17. Exploring a wumpus world P? B OK P? A S OK OK A A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 17

  18. Exploring a wumpus world P? P B OK P? OK A S OK OK W A A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 18

  19. Exploring a wumpus world P? P B OK P? OK A A S OK OK W A A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 19

  20. Exploring a wumpus world P? OK P B OK P? OK OK A A S OK OK W A A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 20

  21. Exploring a wumpus world P? OK P B OK P? BGS OK OK A A A S OK OK W A A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 21

  22. Other tight spots Breeze in (1,2) and (2,1) P? ⇒ no safe actions Assuming pits uniformly dis- B OK P? P? A tributed, (2,2) has pit w/ prob 0.86, OK B OK vs. 0.31 P? A A Smell in (1,1) ⇒ cannot move Can use a strategy of coercion: shoot straight ahead wumpus was there ⇒ dead ⇒ safe S wumpus wasn’t there ⇒ safe A AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 22

  23. Logic Logics are formal languages for representing knowledge 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 AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 23

  24. Types of logic Logics are characterized by what they commit to as “primitives” – Ontological commitment: what exists—facts? objects? time? beliefs? – Epistemological commitment: what states of knowledge? Language Ontological Commitment Epistemological Commitment Propositional logic facts true/false/unknown First-order logic facts, objects, relations true/false/unknown Temporal logic facts, objects, relations, times true/false/unknown Probability theory facts degree of belief 0. . . 1 Fuzzy logic degree of truth degree of belief 0. . . 1 Picking a logic has issues at the knowledge level Start with first-order (predicate calculus) logic (FOL) consider subsets / supersets and very different looking repre- sentation languages – propositional logic as subsets of FOL AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 24

  25. Propositional logic • (Propositional) Language • Syntax Proof theory • Semantics Model theory • Pragmatics Reasoning Knowledge Representation AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 25

  26. Propositional language Propositional logic (PL) is the simplest logic, but illustrates basic ideas and important applications A propositional language L : • Syntax – a set of (possibly infinite) symbols: ¬ , ⇒ , ( , ) , P 1 , P 2 , · · · – a set of (well-formed) formulas (Wffs) • Semantics – truth evaluations, i.e., truth functions (truth tables) AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 26

  27. Syntax The proposition symbols P 1 , P 2 , · · · are sentences (atom) If S is a sentence, ¬ S is a sentence (negation) If S 1 and S 2 are sentences, S 1 ∧ S 2 is a sentence (conjunction) If S 1 and S 2 are sentences, S 1 ∨ S 2 is a sentence (disjunction) If S 1 and S 2 are sentences, S 1 ⇒ S 2 is a sentence (implication) If S 1 and S 2 are sentences, S 1 ⇔ S 2 is a sentence (biconditional) Connectives precedence: ¬ , ∧ ∨ , ⇒ , ⇔ A literal is a proposition (symbol) or its negation, i.e., P i , or ¬ P i AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 27

  28. Semantics Each model specifies true/false for each proposition symbol E.g. P 1 , 2 P 2 , 2 P 3 , 1 true true false (With these symbols, 8 possible models, can be enumerated automat- ically) Rules for evaluating truth with respect to a model m : ¬ S is true iff is false S S 1 ∧ S 2 is true iff is true and is true S 1 S 2 S 1 ∨ S 2 is true iff S 1 is true or S 2 is true S 1 ⇒ S 2 is true iff S 1 is false or S 2 is true i.e., is false iff S 1 is true and S 2 is false S 1 ⇔ S 2 is true iff S 1 ⇒ S 2 is true and S 2 ⇒ S 1 is true Simple recursive process evaluates an arbitrary sentence, e.g., ¬ P 1 , 2 ∧ ( P 2 , 2 ∨ P 3 , 1 ) = true ∧ ( false ∨ true ) = true ∧ true = true AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 28

  29. Truth tables for connectives ¬ P P ∧ Q P ∨ Q P ⇒ Q P ⇔ Q P Q false false true false false true true false true true false true true false true false false false true false false true true false true true true true AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 29

  30. Wumpus world sentences Let P i,j be true if there is a pit in [ i, j ] Let B i,j be true if there is a breeze in [ i, j ] ¬ P 1 , 1 ¬ B 1 , 1 B 2 , 1 “Pits cause breezes in adjacent squares” AI Slides (5e) c � Lin Zuoquan@PKU 2003-2019 5 30

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