0% found this document useful (0 votes)
22 views34 pages

Unit-4 - Representing Knowledge Using Rules

Knowledge representation is a key aspect of artificial intelligence that enables machines to understand and utilize information about the real world to solve complex problems. It encompasses various types of knowledge, including declarative, procedural, meta-knowledge, heuristic, and structural knowledge, and involves different approaches such as relational, inheritable, inferential, and procedural knowledge. The relationship between knowledge and intelligence is crucial, as AI agents rely on their knowledge to demonstrate intelligent behavior and make decisions.

Uploaded by

yebes90096
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)
22 views34 pages

Unit-4 - Representing Knowledge Using Rules

Knowledge representation is a key aspect of artificial intelligence that enables machines to understand and utilize information about the real world to solve complex problems. It encompasses various types of knowledge, including declarative, procedural, meta-knowledge, heuristic, and structural knowledge, and involves different approaches such as relational, inheritable, inferential, and procedural knowledge. The relationship between knowledge and intelligence is crucial, as AI agents rely on their knowledge to demonstrate intelligent behavior and make decisions.

Uploaded by

yebes90096
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

Representing Knowledge

using Rules
Ravirajsinh Chauhan
Assistant Professor
School of Engineering, P P Savani University
What is knowledge representation?
´ 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.

Hence we can describe Knowledge representation as following:


´ Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which
concerned with AI agents thinking and how thinking contributes to intelligent behaviour of
agents.
What is knowledge representation?
´ 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 behaviour 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).
Knowledge:
´ Knowledge is awareness or familiarity gained by experiences of facts, data, and
situations. Following are the types of knowledge in artificial intelligence:
Knowledge:
1. Declarative Knowledge:
´ Declarative knowledge is to know about something.
´ It includes concepts, facts, and objects.
´ It is also called descriptive knowledge and expressed in declarative sentences.
´ It is simpler than procedural language.

2. 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.
´ 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.
Knowledge:
3. Meta-knowledge:
´ Knowledge about the other types of knowledge is called Meta-knowledge.

4. 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.

5. 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.
The relation between knowledge and intelligence:
Knowledge of real-worlds plays a vital role in intelligence and same for creating artificial
intelligence. Knowledge plays an important role in demonstrating intelligent behavior in AI
agents. An agent is only able to accurately act on some input when he has some
knowledge or experience about that input.
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent behaviour:
´ Perception
´ Learning
´ Knowledge Representation and Reasoning
´ Planning
´ Execution

Execution
Approaches to knowledge representation:
1. Simple relational knowledge:
´ 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.

Player Weight Age


Player1 65 23
Player2 58 18
Player3 75 24
Approaches to knowledge representation:
2. 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.
´ We use Arrows which point from objects to their values.
Approaches to knowledge representation:
2. Inheritable knowledge: Example
Approaches to knowledge representation:
3. Inferential knowledge:
´ Inferential knowledge approach represents knowledge in the form of formal logics.
´ This approach can be used to derive more facts.
´ It guaranteed correctness.

´ Example: Let's suppose there are two statements:


´ Marcus is a man
´ All men are mortal
Then it can represent as;

man(Marcus)
∀x = man (x) à mortal (x)s
Approaches to knowledge representation:
4. Procedural knowledge:
´ Procedural knowledge approach uses small programs and codes which describes how to do
specific things, and how to proceed.
´ In this approach, one important rule is used which is If-Then rule.
´ In this knowledge, we can use various coding languages such as LISP language and Prolog
language.
´ We can easily represent heuristic or domain-specific knowledge using this approach.
´ But it is not necessary that we can represent all cases in this approach.
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.
Production Rules
´ 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.
´ If there is a new situation (state) generates, then multiple production rules will be
fired together, this is called conflict set.

´ In this situation, the agent needs to select a rule from these sets, and it is called a
conflict resolution.
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:
Advantages
´ The production rules are expressed in natural language.
´ The production rules are highly modular, so we can easily remove, add or modify an
individual rule.
Disadvantages
´ Production rule system does not exhibit any learning capabilities, as it does not store
the result of the problem for the future uses.
´ During the execution of the program, many rules may be active hence rule-based
production systems are inefficient.
Procedural Knowledge:
´ Procedural Knowledge also known as Interpretive knowledge, is the type of
knowledge in which it clarifies how a particular thing can be accomplished.
´ It is not so popular because it is generally not used.
´ It emphasize how to do something to solve a given problem.
´ For example, - how to copy an array using JavaScript in a procedural way.
Declarative Knowledge:
´ Declarative Knowledge also known as Descriptive knowledge, is the type of
knowledge which tells the basic knowledge about something and it is more popular
than Procedural Knowledge.
´ It emphasize what to do something to solve a given problem.
´ For example, - how to copy an array using JavaScript in a declarative way.
Procedural vs. Declarative Knowledge:
Forward Reasoning/chaining:
´ Conclude from "A" and "A implies B" to "B".

´ Example:
Forward Reasoning/chaining:
´ Forward chaining or data-driven inference works from an initial state, and
by looking at the premises of the rules (IF-part), perform the actions (THEN-
part), possibly updating the knowledge base or working memory.

´ This continues until no more rules can be applied or some cycle limit is met.
Forward Reasoning: Example
Forward Reasoning:
´ In example: no more rules, that is, inference chain for this is:

´ Problem with forward chaining:


many rules may be applicable. The whole process is not directed towards a goal.
Backward Reasoning/chaining:
´ Conclude from "B" and "A implies B" to "A".

´ Example:
Backward Reasoning/chaining:
´ Backward chaining or goal-driven inference works towards a final state,
and by looking at the working memory to see if goal already there. If not
look at the actions (THEN-parts) of rules that will establish goal, and set up
sub goals for achieving premises of the rules (IF-part).
´ This continues until some rule can be applied, apply to achieve goal state.

´ Advantage of backward chaining:


search is directed
´ Disadvantage of backward chaining:
goal has to be known
Backward Reasoning: Example
Forward or Backward Reasoning? Four major factors
´ More possible start states or goal states?
´ Move from smaller set of states to the larger
´ Assume you are at home and you need some bread. You've one initial state and
many possible goal states where to get bread from (Sainsbury's, Tesco, Aldi,
Morrison, ASDA, Corner Shop, Bakery). That is, in such a situation it is probably a
good approach to search in forward chaining fashion, since you have many
chances to hit a goal. If you choose backward chaining you would have to
commit to one of the goals, e.g. the Bakery and then search backwardly how the
get there from home.

´ If, however, there are 5 people Alice, Bob, Claire, Dora, and Edgar at 5 different
places A, B, C, D, and E, and one of them should get the Tesco home brand of
ketchup, then it would be better to start backward chaining from the Tesco store
and stop search when one of the places A, B, C, D, or E is reached.
Forward or Backward Reasoning? Four major factors
´ Has program to justify reasoning?
´ Prefer direction that corresponds more closely to the way users think.

´ What kind of events triggers problem-solving?


If it is arrival of a new fact, forward chaining makes sense.
If it is a query to which a response is required, backward chaining is more natural.
Forward or Backward Reasoning? Four major factors
´ In which direction is branching factor greatest?
Go in direction with lower branching factor.
´ backward chaining better:

´ Forward chaining better:


Forward vs. Backward Reasoning
Forward vs. Backward Reasoning
THANK YOU

Contact Details
Ravirajsinh Chauhan
[Link]@[Link]
7405419415

You might also like