Knowledge Representation Techniques
Knowledge Representation Techniques
ARTIFICIAL
INTELLIGENT SYSTEMS
TOPIC: KNOWLEDGE REPRESENTATION TECHNIQUES
INTRODUCTION
• We, humans, are good at reasoning, understanding, analyzing, and interpreting what we are
seeing in our daily life. We know how to react and respond to the situation we are going
through. But how to make machines perform similar actions?
• Here comes the knowledge representation in AI that equips the machines to perform
understanding and interpreting the queries of the real world.
• Knowledge Representation in AI is the study of how to equip intelligent machines with
beliefs, intentions, and judgments to express according to the situations through automated
reasoning.
2
WHAT IS KNOWLEDGE
REPRESENTATION?
• Knowledge Representation in AI describes the representation of knowledge. Basically, it is a study of how
the beliefs, intentions, and judgments of an intelligent agent can be expressed suitably for automated
reasoning.
• One of the primary purposes of Knowledge Representation includes modeling intelligent behavior for an
agent.
• Knowledge Representation and Reasoning (KR, KRR) represents information from the real world for a
computer to understand and then utilize this knowledge to solve complex real-life problems like
communicating with human beings in natural language.
• Knowledge representation in AI is not just about storing data in a database, it allows a machine to learn from
that knowledge and behave intelligently like a human being.
3
DIFFERENT TYPES OF KNOWLEDGE
4
DIFFERENT TYPES OF KNOWLEDGE…
• Declarative Knowledge – It includes concepts, facts, and objects and expressed in a declarative
sentence.
• Structural Knowledge – It is a basic problem-solving knowledge that describes the relationship
between concepts and objects.
• Procedural Knowledge – This is responsible for knowing how to do something and includes rules,
strategies, procedures, etc.
• Meta Knowledge – Meta Knowledge defines knowledge about other types of Knowledge.
• Heuristic Knowledge – This represents some expert knowledge in the field or subject.
5
TECHNIQUES OF KNOWLEDGE
REPRESENTATION
6
LOGICAL REPRESENTATION
• Logical representation is a language with some definite rules which deals with propositions
and has no ambiguity in representation.
• It represents a conclusion based on various conditions and lays down some
important communication rules.
• Logical representation can be categorized into mainly two logics:
• Propositional Logic
• First Order Logic
8
LOGICAL REPRESENTATION…
• Propositional Logic, also known as propositional calculus or statement logic, is a formal system of logic
that deals with the relationships between propositions, which are statements that are either true or false.
Propositional logic is based on the Boolean system, which means that propositions are evaluated as either true
or false. In propositional logic, propositions are combined using logical connectives such as "and", "or", and
"not", and the resulting compound propositions can also be evaluated as true or false based on the truth values
of their component propositions.
• First-order logic (FOL), also known as first-order predicate calculus (FOPC) or first-order logic with
identity, is an extension of propositional logic that allows for the representation of more complex
relationships between objects. In FOL, propositions are constructed using predicates, which are statements
that describe properties or relations between objects, and quantifiers, which specify the scope of the variables
in the proposition.
9
LOGICAL REPRESENTATION…
• Advantages:
• Logical representation helps to perform logical reasoning.
• This representation is the basis for the programming languages.
• Disadvantages:
• Logical representations have some restrictions and are challenging to work with.
• This technique may not be very natural, and inference may not be very efficient.
10
PROPOSITIONAL LOGIC
• Represent real world facts as logical propositions written as Well Formed Formula (Wffs).
• Simple to deal with.
• A decision procedure exists for it.
Facts Propositional logic
it is raining RAINING
it is sunny SUNNY
it is windy WINDY
if it is raining, then it is not sunny RAINING SUNNY
11
SUMMARIZED TABLE FOR PROPOSITIONAL
LOGIC CONNECTIVES
12
PROPOSITIONAL LOGIC
1. Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative literal.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication. Implications are also known as if-then rules. It can be represented as:
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
14
LOGICAL EQUIVALENCE
• Commutativity: • Distributive:
• P∧ Q= Q ∧ P, or • P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
• P ∨ Q = Q ∨ P. • P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
• Associativity: • DE Morgan's Law:
• (P ∧ Q) ∧ R= P ∧ (Q ∧ R), • ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R) • ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
• Identity element: • Double-negation elimination:
• P ∧ True = P, • ¬ (¬P) = P.
• P ∨ True= True.
15
LOGICAL EQUIVALENCE…
Name Equivalences
Identity p ∧ T ≡ p, p ∨ F ≡ p
Domination p ∨ T ≡ T, p ∧ F ≡ F
Idempotent p ∧ p ≡ p, p ∨ p ≡ p
Double Negation ¬(¬p) ≡ p
Commutative p∨q≡q∨p, p∧q≡q∧p
Associative (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) , (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
Distributive p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r), p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
De Morgan's Law ¬(p ∧ q)≡ ¬p ∨ ¬q, ¬(p ∨ q) ≡ ¬p ∧ ¬q
Absorption p ∨ (p ∧ q)≡p, p ∧ (p ∨ q) ≡ p
Negation p ∨ ¬p ≡ T, p ∧ ¬p ≡ F
16
LIMITATIONS OF PROPOSITIONAL LOGIC
• If you want to represent complicated sentences or natural language statements, PL is not sufficient.
• We cannot represent relations like ALL, some, or none with propositional logic. Example:
• All the girls are intelligent.
• Some apples are sweet.
• There is very limited expressive power in PL, so we use FOL instead
• Example:
All men are mortal MORTALMAN
• fails to capture the relationship between individual being a man and that individual being a
mortal.
17
FIRST ORDER LOGIC
18
QUANTIFIERS IN FIRST-ORDER LOGIC
• These are the symbols that permit to determine or identify the range and scope of the
variable in the logical expression. There are two types of quantifier:
• Universal Quantifier, (for all, everyone, everything)
• Existential quantifier, (for some, at least one).
• The is represented by a symbol ∀, which resembles an inverted A. Universal quantifier
• Existential quantifiers are denoted by the logical operator ∃, which resembles as
inverted E. When it is used with a predicate variable then it is called as an existential
quantifier.
19
UNIVERSAL QUANTIFIER
• Example:
• All man drink coffee.
• Let a variable x which refers to a man, so all x can
be represented as: ∀x man(x) → drink (x, coffee)
• It will be read as: There are all x where x is a
man who drink coffee. ∀x man(x) → drink (x,
coffee).
20
EXISTENTIAL QUANTIFIER
• Example:
• Some boys are intelligent.
• ∃x: boys(x) ∧ intelligent(x)
• It will be read as: There are some x where x is
a boy who is intelligent. ∃x: boys(x) ∧
intelligent(x)
21
FIRST ORDER LOGIC
• Use of predicate logic as a way of representing knowledge:
1.Marcus was a man man(Marcus)
2.Marcus was a Pompeian Pompeian(Marcus)
3.All Pompeians were Romans x: Pompeian(x) Roman(x)
4.Casear was a ruler ruler(Casear)
5.All Romans are either loyal to Caesar or hated him
x: roman(x) loyalto(x,Caesar) hate(x,Caesar)
6.Everyone is loyal to someone x: y: loyalto(x,y)
7.people only try to assassinate rulers they are not loyal to
x: y: person(x) ^ ruler(y) ^ tryassassinate(x,y) loyalto(x,y)
8.Marcus tried to assassinate Caesar tryassassinate(Marcus,Caesar)
22
SEMANTIC NETWORK REPRESENTATION
23
SEMANTIC NETWORK REPRESENTATION
Mamm
Statements: Cat
al
Is-a
1.Jerry is a cat. Is-a
Rubi Anim
2.Jerry is a mammal Is-colored Is-owned al
24
SEMANTIC NETWORK REPRESENTATION…
• Advantages:
• Semantic networks are a natural representation of knowledge.
• Also, it conveys meaning in a transparent manner.
• These networks are simple and easy to understand.
• Disadvantages:
• Semantic networks take more computational time at runtime.
• Also, these are inadequate as they do not have any equivalent quantifiers.
• These networks are not intelligent and depend on the creator of the system.
25
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.
• The various aspects of a slot is known as Facets. Facets are features of frames which enable
us to put constraints on the frames.
• A frame is also known as slot-filter knowledge representation in artificial intelligence.
26
FRAME REPRESENTATION: EXAMPLE
• Example:
Let's take an example of a frame for a book:
Slots Filters
Title Artificial Intelligence
Genre Computer Science
Author Peter Norvig
Edition Third Edition
Year 1996
Page 1152
27
FRAME REPRESENTATION…
28
SUMMARY
29
SELF ASSESSMENT
QUESTIONS
1. Knowledge and reasoning also play a crucial role in dealing with __________________
environment.
2. A knowledge-based agent can combine general knowledge with current percepts to infer
hidden aspects of the current state prior to selecting actions.
(a) True
(b) False
TERMINAL QUESTIONS
31
REFERENCE
• Reference Books:
• 1. Russel and Norvig, ‘Artificial Intelligence’, third edition, Pearson Education, PHI, (2015)
• 2. Elaine Rich & Kevin Knight, ‘Artificial Intelligence’, 3nd Edition, Tata Mc Graw Hill
Edition, Reprint( 2008)
1. https://www.virtusa.com/digital-themes/heuristic-search-techniques
2. https://towardsdatascience.com/a-star-a-search-algorithm-eb495fb156bb
32