Download Reason Logically - Embedded Intelligent Robotics - Lecture Slides and more Slides Robotics in PDF only on Docsity!
Agents that
Reason Logically
A knowledge-based agent
- A knowledge-based agent includes a knowledge base and an inference system.
- A knowledge base is a set of representations of facts of the world.
- Each individual representation is called a sentence.
- The sentences are expressed in a knowledge representation language.
- The agent operates as follows:
- It TELLs the knowledge base what it perceives.
- It ASKs the knowledge base what action it should perform.
- It performs the chosen action. 2
Examples of sentences The moon is made of green cheese If A is true then B is true A is false All humans are mortal Confucius is a human Docsity.com
- The Inference engine derives new sentences from the input and KB
- The inference mechanism depends on representation in KB
- The agent operates as follows:
- It receives percepts from environment
- It computes what action it should perform (by IE and KB)
- It performs the chosen action (some actions are simply inserting inferred new facts into KB).
4
Knowledge Base
Inference Engine
Input from environment
Output (actions) Learning (KB update)
The Wumpus World environment
- The Wumpus computer game
- The agent explores a cave consisting of rooms connected by passageways.
- Lurking somewhere in the cave is the Wumpus , a beast that eats any agent that enters its room.
- Some rooms contain bottomless pits that trap any agent that wanders into the room.
- Occasionally, there is a heap of gold in a room.
- The goal of the player is:
- to collect the gold and
- exit the world
- without being eaten
Jargon file on āHunt the Wumpusā (cont)
- Unfortunately for players, the movement necessary to map the maze was made hazardous not merely by the wumpus
- (which would eat you if you stepped on him)
- There are also bottomless pits and colonies of super bats that would pick you up and drop you at a random location
- (later versions added:
- āanaerobic termitesā that ate arrows,
- bat migrations,
- and earthquakes that randomly change pit locations).
- This game appears to have been the first to use a non-random graph-structured map (as opposed to a rectangular grid like the even older Star Trek games).
- In this respect, as in the dungeon-like setting and its terse, amusing messages, it prefigured ADVENT and Zork.
- It was directly ancestral to both.
- (Zork acknowledged this heritage by including a super-bat colony.)
- Today, a port is distributed with SunOS and as freeware for the Mac.
- A C emulation of the original Basic game is in circulation as freeware on the net. 7
This slide has only historical information or info useful for extensions and can be skipped
A typical Wumpus world
- The agent always starts in the field [1,1].
- The task of the agent is to find the gold, return to the field [1,1] and climb out of the cave.
The actions of the agent in Wumpus game are:
- go forward
- turn right 90 degrees
- turn left 90 degrees
- grab means pick up an object that is in the same square as the agent
- shoot means fire an arrow in a straight line in the direction the agent is looking. - The arrow continues until it either hits and kills the wumpus or hits the wall. - The agent has only one arrow. - Only the first shot has any effect.
- climb is used to leave the cave.
- Only effective in start field.
- die , if the agent enters a square with a pit or a live wumpus.
The agentās goal
The agentās goal is to find the gold and bring it back to the start as quickly as possible, without getting killed.
- 1000 points reward for climbing out of the cave with the gold
- 1 point deducted for every action taken
- 10000 points penalty for getting killed
Later
Agent takes a risk togo here 13
Agent takes a risk togo here but finds gold Now Agent has tosafely withdraw
World-wide web wumpuses
- http://scv.bu.edu/wcl
- http://216.246.19.
- http://www.cs.berkeley.edu/~russell/code/do c/overview-AGENTS.html
The connection between
sentences and facts
16
Semantics maps sentences in logic to facts in the world.
The property of one fact following from another is mirrored by the property of one sentence being entailed by another.
Entails
Follows
Logic as a Knowledge-Representation (KR)
language
17
Propositional Logic
First Order
Higher Order
Modal
Fuzzy Logic
Multi-valued Logic
Probabilistic Logic
Temporal Non-monotonicLogic
Propositional logic
- Logical constants : true, false
- Propositional symbols : P, Q, S, ...
- Wrapping parentheses : ( ⦠)
- Sentences are combined by connectives : ā§ ...and ⨠...or ā...implies ā..is equivalent ¬ ...not (^) Docsity.com^19
Propositional logic (PL)
- A simple language useful for showing key ideas and definitions
- User defines a set of propositional symbols, like P and Q.
- User defines the semantics of each of these symbols, e.g.: - P means "It is hot" - Q means "It is humid" - R means "It is raining"
- A sentence (aka formula, well-formed formula,Docsity.com 20