Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 47

Knowledge Representation and

Reasoning
Session 2 Slides
AI - Agents & Environments
🠶 An AI system is composed of an agent and its
environment.
🠶 The agents act in their environment.
🠶 The environment may contain other agents.
🠶 What are Agent and Environment?
🠶 An agent is anything that can perceive its environment
through sensors and acts upon that environment
through effectors.
AI - Agents & Environments
🠶 Examples of agents.

🠶 A Human agent has eyes, ears, and other organs which act


as sensors and hands, legs, mouth, and other body parts
acting as actuators.

A Robotic agent has Cameras and infrared range finders


which act as sensors and various motors acting as actuators.
Homework
🠶 Look at the five types of AI agents
🠶 Simple Reflex Agents
🠶 Model-Based Reflex Agents
🠶 Goal-Based Agents
🠶 Utility-Based Agents
🠶 Learning Agent
What is knowledge representation?
🠶 Knowledge consists of models that attempt to represent the
environment in such a way as to maximally simplify
problem-solving.
🠶 It is assumed that no model can ever hope to capture all
relevant information
🠶 Humans are best at understanding, reasoning, and
interpreting knowledge.
🠶 Human knows things, which is knowledge and as per their
knowledge they perform various actions in the real world.
🠶 But how machines do all these things comes under
knowledge representation and reasoning
Main question
🠶 Intelligent behavior can be achieved through the
manipulation of symbol structures (representing bits
of knowledge).
🠶 How we can represent knowledge as
symbol structures ?
🠶 How can we can use that knowledge to
intelligently solve problems ?
What is knowledge?
What is representation?
What is representation?
🠶 Knowledge representation and reasoning (KR, KRR) is the part of
Artificial intelligence which concerned with AI agents thinking
and how thinking contributes to intelligent behavior of agents.
🠶 It is responsible for representing information about the real world
so that a computer can understand and can utilize this knowledge
to solve the complex real world problems such as diagnosis a
medical condition or communicating with humans in natural
language.
🠶 It is also a way which describes how we can represent knowledge
in artificial intelligence.
🠶 Knowledge representation is not just storing data into some
database, but it also enables an intelligent machine to learn from
that knowledge and experiences so that it can behave intelligently
like a human.
What to represent?
🠶 Object: All the facts about objects in our world domain. E.g.,
Guitars contains strings, trumpets are brass instruments.
🠶 Events: Events are the actions which occur in our world.
🠶 Performance: It describe behavior which involves knowledge about
how to do things.
🠶 Meta-knowledge: It is knowledge about what we know.
🠶 Facts: Facts are the truths about the real world and what we
represent.
🠶 Knowledge-Base: The central component of the knowledge-based
agents is the knowledge base.
🠶 It is represented as KB.
🠶 The Knowledgebase is a group of the Sentences (Here, sentences are
used as a technical term and not identical with the English language).
Types of knowledge
🠶
Declarative Knowledge:
🠶 Declarative knowledge is to know about something.
🠶 It includes concepts, facts, and objects.
🠶 This is fact based knowledge and is static in other words we cannot change it
🠶 For example the sun rises in the east
🠶 Sun sets in the west
🠶 It is also called descriptive knowledge and expressed in declarative sentences.
🠶 It is simpler than procedural language.
Procedural Knowledge:
🠶 It is also known as imperative knowledge.
🠶 Procedural knowledge is a type of knowledge which is responsible for
knowing how to do something/ perform something
🠶 It can be directly applied to any task.
🠶 It includes rules, strategies, procedures, agendas, etc.
🠶 Procedural knowledge depends on the task on which it can be applied.
🠶 For example: How to make coffee, how to cook sadza
🠶 In other words we must have the knowledge of how to make coffee
Tasks
🠶 Employee ID = 900
🠶 Calculating overtime for an employee
🠶 Employee age = 35
🠶 Riding a bicycle
🠶 Is this Procedural or Declarative knowledge? Explain
Meta-knowledge
🠶 Meta-knowledge-Knowledge about the other types of knowledge is called Meta-
knowledge.
🠶 Meta-knowledge is a piece of data that describes the knowledge in the world of
AI. It is not specific to any single domain but aims to describe the structure of the
data present in the knowledge systems.
🠶 The main usage of meta-knowledge is to understand and improve the nature of
user interface components and to maintain the knowledge bases that are used
alongside inference engines as well.
🠶 With the increasing complexity of problems around us, it can be said that
extensive use of meta-knowledge will be seen in the becoming days.
🠶 In a system, there are many things that are crucial for the autonomous operations
to run smoothly such as control systems, support subsystems, and the architecture
as well. Implementation of meta-knowledge helps in the inter-domain
communication of modules that work hand-in-hand to solve the problems as well.
Heuristic knowledge
🠶 Heuristic knowledge- is representing knowledge of some experts in a filed or
subject.
🠶 Heuristic knowledge- is rules of thumb based on previous experiences,
awareness of approaches, and which are good to work but not guaranteed.
🠶  It is the knowledge of good practice, good judgment, and plausible reasoning
in the field
🠶 heuristics are simple, efficient rules, learned or inculcated by evolutionary
processes, that have been proposed to explain how people make decisions,
come to judgments, and solve problems typically when facing complex
problems or incomplete information
🠶 Example: 'traveling salesman problem.' This is a common problem posed in AI,
and it goes like this: Imagine that you have a long list of cities and distances
between each of the cities. You have to visit all the cities and return home.
Write an algorithm to find the most efficient route
Structural knowledge
🠶 Structural knowledge is basic knowledge to problem-solving.
🠶 It describes relationships between various concepts such as kind of, part of,
and grouping of something.
🠶 It describes the relationship that exists between concepts or objects.
🠶 Structure Knowledge Representations have been explored for many years as a
general symbolic representation for declarative knowledge.
🠶 As we have seen, a fundamental concept for organizing such structures is the
concept of "relation".
🠶 For example the slots FATHER and MOTHER contained pointers to an object
of the class PERSON.
The relation between knowledge and intelligence:
AI knowledge cycle:
🠶 An Artificial intelligence system has the following components for displaying
intelligent behavior:
🠶 Perception
🠶 Learning
🠶 Knowledge Representation and Reasoning
🠶 Planning
🠶 Execution
AI knowledge cycle:
AI knowledge cycle:

🠶 Perception
🠶 Receives data from the environment
🠶  It can be visual, audio or another form of sensory input

🠶 Learning
🠶 The learning component is responsible for learning from data captured by Perception
comportment
AI knowledge cycle:

🠶 Knowledge representation and reasoning


🠶 In the complete cycle, the main components are knowledge representation and Reasoning.
🠶 These two components are involved in showing the intelligence in machine-like humans. 
🠶 Planning and Education
🠶 The planning and execution depend on analysis of Knowledge representation and
reasoning
Approaches to knowledge representation,

🠶 Simple relational representation


🠶 Inheritable Knowledge
🠶 Inference Knowledge
🠶 Procedural Knowledge
Simple relational representation

🠶 It is the simplest way of storing facts which uses the relational method, and
each fact about a set of the object is set out systematically in columns.
🠶 This approach of knowledge representation is famous in database systems
where the relationship between different entities is represented.
🠶 This approach has little opportunity for inference.
Inheritable knowledge

🠶 In the inheritable knowledge approach, all data must be stored into a hierarchy
of classes.
🠶 All classes should be arranged in a generalized form or a hierarchal manner.
🠶 In this approach, we apply inheritance property.
🠶 Elements inherit values from other members of a class.
🠶 This approach contains inheritable knowledge which shows a relation between
instance and class, and it is called instance relation.
🠶 Every individual frame can represent the collection of attributes and its value.
🠶 In this approach, objects and values are represented in Boxed nodes.
Inheritable knowledge
Inferential Knowledge
🠶 The inferential knowledge approach represents knowledge in the form
of formal logic.
🠶 Thus, it can be used to derive more facts.
🠶 Also, it guarantees correctness
🠶 Example:
🠶 Statement 1: John is a cricketer.
🠶 Statement 2: All cricketers are athletes.
🠶 Then it can be represented as;
🠶 Cricketer(John)
Procedural Knowledge
🠶 Rules or Production Rules for Procedural Knowledge Representation
🠶 A production system consists of three components; the data base, the rules and
the interpreter.
🠶 The data base or the working memory represents all the knowledge of the
system at any given moment.
🠶 It can be thought of as a simple data base of facts which are true of the domain
at that time.
🠶 The contents of data base change as facts are added or deleted according to the
application of the rules.
Procedural Knowledge
🠶 Rules are expressed as IF-THEN statements
🠶 If the pH of the spill is less than 6,
🠶 Then the spill material is an acid.
🠶 When the If portion of a rule is satisfied by the facts in the database the action
specified by the THEN in the database portion is performed.
🠶 When this happens the rule is said to fire or execute.
🠶 A rule interpreter compares the IF portions of rules with facts in the database
and executes the rule whose IF portion matches the facts.
Procedural Knowledge
Techniques of knowledge representation

🠶 There are mainly four ways of knowledge representation which are given as
follows:
🠶 Logical Representation
🠶 Semantic Network Representation
🠶 Frame Representation
🠶 Production Rules
Logical Representation

🠶 Logical representation is a language with some concrete rules which deals


with propositions and has no ambiguity in representation.
🠶 Logical representation means drawing a conclusion based on various
conditions.
🠶 This representation lays down some important communication rules.
🠶 It consists of precisely defined syntax and semantics which supports the sound
inference
Logical Representation
Logical Representation

🠶  Propositions are statements that can be either true or false, and nothing else.
🠶 Lets look at this proposition
🠶 Example 1: Peter is a man
🠶 Here man is the predicate
🠶 a predicate is statement whose truth value is depend upon the variables
🠶 This can be represented in a predicate logic statement as
🠶 Man(Peter)
🠶 In other words we can say Man is a class and Peter is an object of class man
Logical Representation

🠶  
Logical Representation

🠶  
Logical Representation

🠶  
Semantic Network Representation

🠶  Semantic networks work as an alternative of predicate logic for knowledge


representation.
🠶 In Semantic networks, you can represent your knowledge in the form of
graphical networks.
🠶 This network consists of nodes representing objects and arcs which describe
the relationship between those objects.
🠶 Also, it categorizes the object in different forms and links those objects.
Semantic Network Representation
Frame Representation
🠶 A frame is a record like structure which consists of a collection of attributes
and its values to describe an entity in the world.
🠶 Frames are the AI data structure which divides knowledge into substructures
by representing stereotypes situations.
🠶 It consists of a collection of slots and slot values.
🠶 These slots may be of any type and sizes.
🠶 Slots have names and values which are called facets
Frame Representation
🠶 Task:
🠶 Tom is a cat.
🠶 Tom caught a bird.
🠶 Tom is owned by John.
🠶 Tom is ginger in colour.
🠶 Cats like cream.
🠶 The cat sat on the mat
🠶 A cat is a mammal.
🠶 A bird is an animal.
🠶 All mammals are animals.
🠶 Mammals have fur
Frame Representation
Production Rules
🠶 Production rules system consist of (condition, action) pairs which mean, "If
condition then action". It has mainly three parts:
🠶 The set of production rules
🠶 Working Memory
🠶 The recognize-act-cycle
🠶 In production rules agent checks for the condition and if the condition exists then
production rule fires and corresponding action is carried out.
🠶 The condition part of the rule determines which rule may be applied to a problem.
🠶 And the action part carries out the associated problem-solving steps. This
complete process is called a recognize-act cycle.
🠶 The working memory contains the description of the current state of problems-
solving and rule can write knowledge to the working memory. This knowledge
match and may fire other rules
Production Rules
🠶 Example
🠶 IF (at bus stop AND bus arrives) THEN action (get into the bus)
🠶 IF (on the bus AND paid AND empty seat) THEN action (sit down).
🠶 IF (on bus AND unpaid) THEN action (pay charges).
🠶 IF (bus arrives at destination) THEN action (get down from the bus).
Production Rules
🠶 Example
🠶 IF (at bus stop AND bus arrives) THEN action (get into the bus)
🠶 IF (on the bus AND paid AND empty seat) THEN action (sit down).
🠶 IF (on bus AND unpaid) THEN action (pay charges).
🠶 IF (bus arrives at destination) THEN action (get down from the bus).
Homework
🠶 State the advantages and disadvantages of the following knowledge
representations:
🠶 Logical Representation
🠶 Semantic Network Representation
🠶 Frame Representation
🠶 Production Rules
End of session 2
🠶 Any Questions

You might also like