0% found this document useful (0 votes)
33 views48 pages

Lecture 05 - Knowledge-Based Agents

The document discusses knowledge-based agents in artificial intelligence, emphasizing the importance of logic for reasoning and decision-making. It outlines the components of knowledge-based agents, including knowledge bases and inference engines, and their applications in various fields such as medical diagnosis and natural language processing. Additionally, it covers reasoning methods, knowledge representation, and the significance of sound reasoning for effective agent performance.

Uploaded by

Kavini Amandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views48 pages

Lecture 05 - Knowledge-Based Agents

The document discusses knowledge-based agents in artificial intelligence, emphasizing the importance of logic for reasoning and decision-making. It outlines the components of knowledge-based agents, including knowledge bases and inference engines, and their applications in various fields such as medical diagnosis and natural language processing. Additionally, it covers reasoning methods, knowledge representation, and the significance of sound reasoning for effective agent performance.

Uploaded by

Kavini Amandi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Introduction to Artificial Intelligence

Session 05 - Knowledge-Based Agents

Mahesh Madhushan
B.Sc. in ICT (RUSL), B.Eng. (Hons) in Software Engineering (UK), M.Sc. in IT (UOP)
Big Idea
• Drawing reasonable conclusions from a set of data (observations,
beliefs, etc.) seems key to intelligence
• Logic is a powerful and well developed approach to this and highly
regarded by people
• Logic is also a strong formal system that we can programs computers
to use
• Maybe we can reduce any AI problem to figuring out how to represent
it in logic and apply standard proof techniques to generate solutions
Inference in People
• People can do logical inference, but are not very
good at it
• Reasoning with negation and disjunction seems to
be particularly difficult
• But, people seem to employ many kinds of
reasoning strategies, most of which are neither
complete nor sound
Thinking Fast and Slow
• A popular 2011 book by a Nobel
prize winning author
• His model is that we have 2 differ-
ent types of reasoning facilities
• System 1 operates automatically
and quickly, with little or no effort
and no sense of voluntary control
• System 2 allocates attention to
the effortful mental activities that
demand it, including complex
computations
Question #1
Here is a simple puzzle.
Do not try to solve it but listen to your intuition:

A bat and ball cost $1.10.


The bat costs one dollar more than the ball.
How much does the ball cost?
The ball costs $0.05.
Question #2
Try to determine, as quickly as you can, if the argument is
logically valid. Does the conclusion follow the premises?

All roses are flowers.


Some flowers fade quickly.
Therefore some roses fade quickly.
It is possible that there are no roses
among the flowers that fade quickly.
Question #3

If it takes 5 machines 5 minutes to make 5 widgets,


how long would it take 100 machines to make 100 widgets?
100 minutes or 5 minutes?
5 minutes
Wason Selection Task
• Wason (1966) showed that people are not very good at
this task.
Wason, P. (1966). Reasoning. In New Horizons in Psychology. Penguin,
Hammondsworth, UK.
• To disprove P=>Q, find a situation in which P ^ ~Q
• To disprove vowel => even, find a card with a vowel and
an odd number
• Thus, turn over the cards showing vowels and turn over
cards showing odd numbers
E 4 T 7
Wason Selection Task
• This version seems easier for people to do, as was shown by
Griggs & Cox, 1982
• Your are the bouncer in a bar. Which of these people do you
card given the rule:
You must be 21 or older to drink beer.

beer coke 22 20

•It may be simpler because it’s more familiar or because people


have special strategies to reason about certain situations, such
as “cheating” in a social situation
Negation in Natural Language

• We often model the meaning of a natural language sentence as a logic


statement
• This maps the following into equivalent statements
• All elephants are gray
• No elephant are not gray

• Double negation is common in informal language : That won’t do you no good

• But what does this mean : We cannot underestimate the importance of logic
Logic as a Methodology
Even if people do not use formal logical reasoning for solving a
problem, logic might be a good approach for AI for a number of
reasons
– Airplanes don’t need to flap their wings
– Logic may be a good implementation strategy
– Developing a solution in a formal system like logic can offer
other benefits, e.g., letting us prove properties of the approach
Knowledge and Reasoning
Knowledge and Reasoning:
humans are very good at acquiring new information by
combining raw knowledge, experience with reasoning.
AI-slogan: “Knowledge is power” (or “Data is power”?)
Examples:
Medical diagnosis --- physician diagnosing a patient
infers what disease, based on the knowledge he/she
acquired as a student, textbooks, prior cases
Common sense knowledge / reasoning ---
common everyday assumptions / inferences
e.g., “lecture starts at nine” infer am not pm;
when traveling, I assume there is some way to get from the
airport to the hotel.
A knowledge-based agent
• Knowledge-based agents are intelligent systems that use
knowledge to reason, make decisions, and solve problems.
• Components: Knowledge base, Inference engine, User interface,
Knowledge acquisition system.
• Role: Utilize explicit knowledge to perform tasks more efficiently
and effectively.
A knowledge-based agent
• Knowledge base: Stores facts and rules about the world.
• Inference engine: Uses the knowledge base to derive new
conclusions.
• Applications:
• Expert systems
• Natural language processing
• Computer vision
• Robotics
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:
1. It TELLs the knowledge base what it perceives
2. It ASKs the knowledge base what action it should perform
3. It performs the chosen action
Architecture of a KB agent
• Knowledge Level
– The most abstract level: describe agent by saying
what it knows
– Ex: A taxi agent might know that the Golden Gate Bridge connects San
Francisco with the Marin County
• Logical Level
– The level at which the knowledge is encoded into sentences
– Ex: links(GoldenGateBridge, SanFrancisco, MarinCounty)
• Implementation Level
– Physical representation of the sentences in the logical level
– Ex: as a tuple serialized as (links goldengatebridge sanfrancisco
marincounty)
The Wumpus World environment
• Based on Hunt 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
• The Wumpus can fall into a pit too, so avoids them

• Occasionally, there is a heap of gold in a room.

• The goal is to collect the gold and exit the world without being eaten
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.

23
Agent in a Wumpus world: Percepts
• The agent perceives
• a stench in the square containing the wumpus and in the
adjacent squares (not diagonally)
• a breeze in the squares adjacent to a pit
• a glitter in the square where the gold is
• a bump, if it walks into a wall
• a woeful scream everywhere in the cave, if the wumpus is
killed
• The percepts are given as a five-symbol list. If there is a stench and a
breeze, but no glitter, no bump, and no scream, the percept is
[Stench, Breeze, None, None, None]
Wumpus world actions
• go forward
• turn right 90 degrees
• turn left 90 degrees
• grab: Pick up an object that is in the same square as the agent
• shoot: Fire an arrow in a straight line in the direction the agent is facing.
The arrow continues until it either hits and kills the wumpus or hits the
outer wall. The agent has only one arrow, so only the first Shoot action
has any effect
• climb is used to leave the cave. This action is only effective in the start
square
• die: This action automatically and irretrievably happens if the agent
enters a square with a pit or a live wumpus
Wumpus goal
The agent’s goal is to find the gold and bring it back to the start
square 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

26
The Wumpus agent’s first step

¬W

¬W

27
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
B breeze
G glitter
OK safe cell
P pit
S stench
W wumpus
Exploring a wumpus world

A agent
P?
B breeze
G glitter
OK safe cell
P pit
P?
S stench
W wumpus
Representation of Knowledge
• Importance of Knowledge Representation:
• Organizes information in a structured format for efficient processing.
• Facilitates reasoning and problem-solving tasks.
• Enables communication and sharing of knowledge between agents and humans.
• Types of Knowledge Representation: Declarative knowledge, Procedural
knowledge, Meta-knowledge.
Representation of Knowledge
• Symbolic representations:
• Propositional logic: Represents facts using true or false statements.
• First-order logic: Allows for more complex statements using variables
and quantifiers.

• Semantic networks:Nodes represent concepts, edges


represent relationships.
• Frames:Organizes knowledge into objects with slots for
attributes.
Reasoning
• Resolution: Proves statements by finding contradictions.
• Forward chaining: Derives new conclusions from known
facts.
• Backward chaining: Uses known conclusions to find
evidence for a hypothesis.
• Non-monotonic reasoning: Deals with incomplete and
changing knowledge.
• Uncertainty reasoning: Represents and reasons with
uncertain information.
Learning

• Symbolic learning:
• Inductive logic programming: Learns rules from examples.
• Rule extraction: Extracts rules from a knowledge base.
• Statistical learning:
• Decision trees: Classifies data using a tree-like structure.
• Support vector machines: Finds optimal hyperplanes to
separate data points.
• Artificial neural networks: Models complex relationships using
connected layers of nodes.
Representation, reasoning, and logic
• The object of knowledge representation is to express knowledge in a
computer-tractable form, so that agents can perform well.
• A knowledge representation language is defined by:
• its syntax, which defines all possible sequences of symbols that
constitute sentences of the language.
• Examples: Sentences in a book, bit patterns in computer memory.
• its semantics, which determines the facts in the world to which
the sentences refer.
• Each sentence makes a claim about the world.
• An agent is said to believe a sentence about the world.
The connection between
sentences and facts

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.
42
Soundness and completeness
• A sound inference method derives only entailed
sentences.
• Analogous to the property of completeness in search, a
complete inference method can derive any sentence that
is entailed.

43
Ontologies
• Ontologies formalize knowledge using a set of concepts,
relationships, and axioms to represent a specific
domain.
• Components: Classes, Properties, Instances,
Relationships, Axioms.
• Applications: Semantic web, information retrieval,
knowledge sharing and integration.

44
Ontology and epistemology
• Ontology is the study of what there is—an inventory of what
exists. An ontological commitment is a commitment to an
existence claim.
• Epistemology is a major branch of philosophy that concerns
the forms, nature, and preconditions of knowledge.

45
Knowledge-Based Systems
• Expert systems:
• Emulate the expertise of human experts in a specific
domain.
• Natural language processing:
• Deals with understanding, generating, and reasoning about
human language.
• Computer vision:
• Processes images and videos to understand the visual
world.
46
Examples and Applications of Knowledge-Based
Agents
• Medical Diagnosis and treatment planning: Expert systems that analyze patient
symptoms and medical history to suggest diagnoses and treatment plans.
• Natural Language Understanding: Language processing systems that interpret
and generate human language using semantic representations.
• Robotics and autonomous systems : Intelligent agents in robotics that utilize
knowledge of the environment and tasks to plan and execute actions effectively.
• Personal Assistants: Virtual assistants that leverage knowledge about users'
preferences and tasks to provide personalized recommendations and assistance.
• Education: Intelligent tutoring systems that adapt learning materials and strategies
based on students' knowledge levels and learning styles.
• Financial planning and risk assessment
• Scientific discovery and hypothesis generation

47
No independent access to the world
• The reasoning agent often gets its knowledge about the facts of
the world as a sequence of logical sentences and must draw
conclusions only from them without independent access to the
world.
• Thus it is very important that the agent’s reasoning is sound!

48
Questions?

Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy