Download - Logical reasoning 21.1.13
![Page 1: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/1.jpg)
Unit IILogical Reasoning
V.SaranyaAP/CSE
Sri Vidya College of Engineering and Technology,
Virudhunagar
![Page 2: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/2.jpg)
Logical AgentsKnowledge based AgentsThe Wumpus WorldLogic
![Page 3: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/3.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 3
Logical Agents• Humans can know “things” and “reason”
– Representation: How are the things stored?– Reasoning: How is the knowledge used?
• To solve a problem…• To generate more knowledge…
• Knowledge and reasoning are important to artificial agents because they enable successful behaviors difficult to achieve otherwise– Useful in partially observable environments
• Can benefit from knowledge in very general forms, combining and recombining information
![Page 4: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/4.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 4
Knowledge-Based Agents
• Central component of a Knowledge-Based Agent is a Knowledge-Base– A set of sentences in a formal language
• Sentences are expressed using a knowledge representation language
• Two generic functions:– TELL - add new sentences (facts) to the KB
• “Tell it what it needs to know”– ASK - query what is known from the KB
• “Ask what to do next”
![Page 5: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/5.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 5
Knowledge-Based Agents
• The agent must be able to:– Represent states and actions– Incorporate new percepts– Update internal representations of the world– Deduce hidden properties of the world– Deduce appropriate actions
Inference Engine
Knowledge-Base
Domain-Independent Algorithms
Domain-Specific Content
![Page 6: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/6.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 6
Knowledge-Based Agents
![Page 7: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/7.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 7
Knowledge-Based Agents
• Declarative – You can build a knowledge-based agent simply by
“TELLing” it what it needs to know
• Procedural– Encode desired behaviors directly as program
code• Minimizing the role of explicit representation and
reasoning can result in a much more efficient system
![Page 8: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/8.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 8
Wumpus World• Performance Measure
– Gold +1000, Death – 1000– Step -1, Use arrow -10
• Environment– Square adjacent to the Wumpus are smelly– Squares adjacent to the pit are breezy– Glitter iff gold is in the same square– Shooting kills Wumpus if you are facing it– Shooting uses up the only arrow– Grabbing picks up the gold if in the same square– Releasing drops the gold in the same square
• Actuators– Left turn, right turn, forward, grab, release, shoot
• Sensors– Breeze, glitter, and smell
![Page 9: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/9.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 9
Wumpus World• Characterization of Wumpus World– Observable
• partial, only local perception– Deterministic
• Yes, outcomes are specified– Episodic
• No, sequential at the level of actions– Static
• Yes, Wumpus and pits do not move– Discrete
• Yes – Single Agent
• Yes
![Page 10: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/10.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 10
Wumpus World
![Page 11: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/11.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 11
Wumpus World
![Page 12: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/12.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 12
Wumpus World
![Page 13: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/13.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 13
Wumpus World
![Page 14: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/14.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 14
Wumpus World
![Page 15: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/15.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 15
Wumpus World
![Page 16: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/16.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 16
Wumpus World
![Page 17: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/17.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 17
Wumpus World
![Page 18: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/18.jpg)
LOGIC
Syntax:– Knowledge base consists of sentences– These sentences are expressed according to the
syntax.Ex: “x + y=4” is a well formed sentence.
Semantic: • Meaning of the sentence.• Mention the truth of each sentence.
![Page 19: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/19.jpg)
February 20, 2006 AI: Chapter 7: Logical Agents 19
Logic
• Entailment means that one thing follows logically from anothera |= b
• a |= b iff in every model in which a is true, b is also true
• if a is true, then b must be true
• the truth of b is “contained” in the truth of a
![Page 20: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/20.jpg)
Example• “X+Y=4” is true where X is 2 – And Y is 2
• But false where x is 1 and y is 1.• (every sentence must be true or false in each
possible world.)
![Page 21: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/21.jpg)
Entailment
• Relation of logical element.• A sentence follows logically from another
sentence.• Notation : αl= β– Means sentence a entails(require, need, improve,
demand) β– If every word of α is true and β is also true.– (simply if α is true then β must be true)
![Page 22: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/22.jpg)
Logic in Wumpus world
• The agent detecting nothing in [1,1]
• The agent is interested in whether the adjacent squares [1,2] & [2,2] and [3,1].
• Each of these squares may or may not contain a pit.
• So 23 = 8 possible models.
![Page 23: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/23.jpg)
No pit in [1,2]
![Page 24: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/24.jpg)
• No pit in [2,2]
![Page 25: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/25.jpg)
Conclusion• α1 : there is no pit in [1,2]• α2 : there is no pit in [2,2]• KB is false in any model in which [1,2]
contains pit ,because there is no breeze in [1,1]
We know if KB is true α1 is also true.Hence KB is not equal to α1
in some models, if KB is true α2 is falseKB V α2 so the agent cannot conclude that
there is no pit in [2,2]
![Page 26: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/26.jpg)
Inference (assumption or conclusion)
• The inference algorithm I can be derive from KB, then
•KB |-i a
• a is derived from KB by i” (or)• “ i derives a from KB”
![Page 27: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/27.jpg)
Sound• An inference algorithm derives only entailed sentences is called
“Sound or Truth Preserving”.• Soundness is highly desirable property.
Correspondence between world and representation
entailssentences sentence
Representation
World
Aspects of the real world
Aspects of the real world
semantics
semantics
![Page 28: Logical reasoning 21.1.13](https://reader033.vdocument.in/reader033/viewer/2022061218/54b651824a795904138b4596/html5/thumbnails/28.jpg)
Illustration Sentences are physical configuration of the
agent.Reasoning is the process of constructing new
physical configurations from old ones.If any connection between logical reasoning
process and the real environment in which the agent exists is called “grounding”