0% found this document useful (0 votes)
7 views

15 Knowledge Representation in AI-Part I

Uploaded by

mehtabksidhu
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)
7 views

15 Knowledge Representation in AI-Part I

Uploaded by

mehtabksidhu
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/ 42

Knowledge Representation and Reasoning

Part-1

Dr. Singara Singh Kasana


Associate Professor
Computer Science and Engineering Department
Thapar Institute of Engineering and Technology
Patiala
 Knowledge is the collection of facts, information, and skills acquired
through experience or training or education.
 It is the theoretical or practical understanding of a subject/topic.
 Reasoning means processing of knowledge.
 Intelligence is the ability to use the knowledge.
 Humans are capable to understand, and interpret the knowledge.

 As per their knowledge, they perform various actions in the real world.

 How machines can do all these things?

 It comes under knowledge representation and reasoning.

 It is part of AI which concerned with AI agents thinking and how thinking

contributes to their intelligent behavior.


Knowledge representation is not just storing data into some database, but it also
enables an intelligent agent to learn from that knowledge and experiences so that
it can behave intelligently like a human.

Knowledge representation can use this knowledge to solve the real world problems
like diagnosis a medical condition or communicating with humans in natural
language.
1. Declarative Knowledge:

 Declarative knowledge is to know about something like concepts, facts, and


objects.
 It is also called descriptive knowledge and expressed in declarative sentences.
 It is static in nature.
For example: New Delhi is the capital of India.
2. Procedural Knowledge
 Procedural knowledge involves knowing how to do something.
 It can be directly applied to any task.
 It includes rules, strategies, procedures, agendas, etc.
 It is process-oriented in nature
For example- riding a bicycle. When someone was teaching you how to ride a
bicycle, no matter what they said, you probably struggled to grasp it until you’d
actually done it a few times. Once you figured it out, it quickly became implicit
knowledge. That is, the type of knowledge that is hard to explain as it is
subconsciously stored in your mind.
3. Meta-knowledge:

 Knowledge about the knowledge is called Meta-knowledge.

 It is used to describe things such as tags, models and taxonomies that describe
knowledge.
For example: bibliography
4. Heuristic knowledge:
 Heuristic knowledge is representing knowledge of some experts in a field 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 and objects.
Relationship between Knowledge and Intelligence:

 There is one decision


maker which act by
sensing the environment
as well as using its
knowledge.
 If the knowledge part will
not present then, it
cannot display intelligent
behavior.
 So for any intelligent
system, we need
knowledge.
Cycle of knowledge

 Perception component: Using this, AI agent retrieves information


from its environment. It can be visual, audio or another form of
sensory input.
 The learning component is responsible for learning from data
captured by Perception comportment.
 knowledge representation and Reasoning: These components
are involved in showing the intelligence in machine-like humans.
These two components are independent with each other but
also coupled together.
 The planning and execution depend on analysis of Knowledge
representation and reasoning.
Approaches of Knowledge Representation
 Logical Representation
 Semantic Network Representation
 Frame Representation
 Production Rules
1. Logical Representation: It is a language type representation with some definite
rules which deals with the propositions and has no ambiguity. It represents a
conclusion based on various conditions

Syntax Semantics
Using syntax we can decide how we can These are the rules by using which we can
construct legal sentences in a logic. interpret the sentences.
It determines which symbol we can use in It assigns a meaning to each sentences.
knowledge representation
How to write those particular symbols
Propositional logic
 Propositional/Boolean logic is the simplest form of logical representation in
which all the statements are represented by propositions.
 A proposition is a declarative statement which is either true or false.
 It is a technique of knowledge representation in logical and mathematical form.
 Propositional logic consists of an object, relations or function, and logical
connectives/logical operators.
For example:
Sun rises from East (True)
7 is a prime number (True)
2+2 = 5 (False)
 A proposition formula which is always true is called tautology, and it is also
called a valid sentence.
 A proposition formula which is always false is called Contradiction.
 Statements which are questions, commands, or opinions are not propositions
such as "Where is Ram?", "How do you do?", "What is your name?", are not
propositions.
It consists of precisely defined syntax and semantics which supports the sound
inference. Each sentence can be translated into logics using syntax and semantics.
Syntax:
Syntaxes are the rules using which we can construct legal sentences in the
logic.
It determines which symbol we can use in knowledge representation.
How to write those symbols.
Semantics:
Semantics are the rules by which we can interpret the sentence in the logic.
Semantic also involves assigning a meaning to each sentence.
 Atomic: These are the simple propositions consisting of single proposition
symbol. For example 1+1 = 2 is an atomic proposition.
 Compound/complex/composite: These are constructed by combining atomic
propositions, using parenthesis and logical connectives. For example: (It is not
raining today in Patiala)
Logical Connectives
1. Negation: A sentence such as ¬ P is called negation of P. A literal can be either
Positive literal or negative literal. For example: Today is not holiday can be
represented as ¬ P , where P: Today is holiday.
2. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a
conjunction. For example: Ramu eats fries, and Aman drinks soda.
3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called
disjunction, where P and Q are the propositions. For example- The clock is slow
or the time is correct can be represented as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an implication. Implications
are also known as if-then rule. For example: If there is a rain then the streets
are wet.
5. Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, For
example If I am breathing, then I am alive
Truth Tables of Logical Connectors
"If you get an A+, then your father will give you a gift."

The statement will be true if your father keep his promise and false if he does n't.

Suppose it's true that you get an A+ and it's true that your father give you a gift. Since he
kept his promise, the implication is true. This corresponds to the first row in the table.

Suppose it's true that you get an A+ but it's false that your father give you a gift. Since he
didn't keep his promise, the implication is false. This corresponds to the second row in the
table.

What if it's false that you get an A+? Whether or not your father give you a gift, he has n't
broken his promise. Thus, the implication can't be false, so (since this is a two-valued
logic) it must be true. This explains the last two rows of the table.
Note: We can create truth table for more than three propositions
Construct a truth table for ¬ P ∧(P →Q)
Show that (P →Q) V (Q →P) is a tautology.
Truth table for (P →Q) ∧ (Q →R)
Examples
It is hot
It is humid
It is raining
Write down the proposition logic for
1. If it is humid then it is hot
2. If it is hot and humid then it is not raining

Take A= It is hot.
1. B → A
B = It is humid. 2. (A ∧ B) → ¬C
C= It is raining.
P: Good mobile phones are not cheap
Q: Cheap mobile phones are not good

L: P implies Q
M: Q implies P
N: P is equivalent to Q
Which one of the following about L, M, and N is CORRECT?
(A) Only L is TRUE.
(B) Only M is TRUE.
(C) Only N is TRUE.
(D) L, M and N are TRUE
Truth Table
Let a and b be two proposition a b ~a ~b P Q
a: Good Mobile phones. T T F F F F
b: Cheap Mobile Phones. T F F T T T
F T T F T T
P and Q can be written in logic as F F T T T T
P: a → ~b
Q: b → ~a. It clearly shows P and Q are equivalent.
so option D is Correct
First-order logic does not only assume that the world contains facts like
propositional logic but also assumes the following things in the world:
 Objects: A, B, people, numbers, colors etc.
 Relations: It can be unary relation such as: red, round, is adjacent, or n-any
relation such as: the sister of, brother of, has color, comes between
 Function: Father of, best friend, third inning of, end of, ......
Predicate Logic/First Order Logic
In Propositional Logic(PL), we can represent statements/facts which are either true
or false.
PL is not sufficient to represent the complex sentences or natural language
statements. The propositional logic has very limited expressive power.

For example we cannot represent following sentences using PL logic.

"Some employees are hard workers“


or
“All boys like cricket."
First-order logic does not only assume that the world contains facts like
propositional logic but also assumes the following things in the world:
 Objects: A, B, people, numbers, colors etc.
 Relations: It can be unary relation such as: red, round, is adjacent, or n-any
relation such as: the sister of, brother of, has color, comes between
 Function: Father of, best friend, third inning of, end of, ......
As a natural language, first-order logic also has two main parts:
 Syntax
 Semantics
Basic Elements of First-order logic

Constant 1, 2, A, John, Mumbai, cat,....


Variables x, y, z, a, b,....
Predicates Brother, Father, >,....
Function sqrt, LeftLegOf, ....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
 Atomic sentences:
Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis with a
sequence of terms.
We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Example: Ram and Shyam are brothers: => Brothers(Ram, Shyam).
 Atomic sentences:
Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis with a
sequence of terms.
We can represent atomic sentences as Predicate (term1, term2, ......, term n).
Example: Ram and Shyam are brothers: => Brothers(Ram, Shyam).
 Complex Sentences:
Complex sentences are made by combining atomic sentences using connectives.
First-order logic statements can be divided into two parts:
 Subject: Subject is the main part of the statement.
 Predicate: A predicate can be defined as a relation, which binds two atoms
together in a statement.

For example: Ram is a batsman


Here Ram is Subject and is a batsman, is Predicate.
Quantifiers in First-order logic:
 Universal Quantifier, (for all, everyone, everything)
 Existential quantifier, (for some, at least one).

If there is a statement: All man play cricket.


It can be converted into FOL as
∀x : man(x) → play (x, cricket).
Also if we have another statement- Some boys are intelligent.
∃x: boys(x) ∧ intelligent(x)
Note:

 The main connective for universal quantifier ∀ is implication →.

 The main connective for existential quantifier ∃ is and ∧.


Example 1: Every house is a physical object

∀x: house(x) → physical_object(x)


where house and physical_object are unary predicate symbols.
Example 2: Some physical objects are houses

∃x: physical_object(x) ∧ house(x)

Example 3: Every house has an owner

∀x: house(x) → ∃y.owns(y, x)


here owns is a binary predicate symbol.
Example 4: “Everybody owns a house” is translated as

∀x.∃y.(owns(x, y) ∧ house(y))

Example 5: “Ram owns a house” is translated as

∃x.(owns(Ram, x) ∧ house(x))
where Ram is an individual constant symbol.
Example 6: “Ram does not own a house” is translated as

¬∃x.(owns(Ram, x) ∧ house(x))

Example 7: “Somebody does not own a house” is translated as

∃x.∀y.(owns(x, y) → ¬house(y))
Advantages Disadvantages
Logical representation help to perform Logical representations have some
logical reasoning restrictions and are challenging to work
with.

This representation is the basis for the This technique may not be very natural
programming languages and inference may not be very efficient.

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