Lecture 05 - Knowledge-Based Agents
Lecture 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:
beer coke 22 20
• 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
• The goal is to collect the gold and exit the world without being eaten
A typical Wumpus world
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.
• 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
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