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

Knowledge Representation

Uploaded by

immidisivani678
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Knowledge Representation

Uploaded by

immidisivani678
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

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.
 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.
 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:
 Following are the kind of knowledge which needs to be represented
in AI systems:
 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
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.
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 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.
 Let's suppose if you met some person who is speaking in a
language which you don't know, then how you will able to act on
that. The same thing applies to the intelligent behavior of the
agents.
 As we can see in below diagram, there is one decision maker
which act by sensing the environment and using knowledge. But
if the knowledge part will not present then, it cannot display
intelligent behavior.
AI knowledge cycle:
An Artificial intelligence system has the following components for
displaying intelligent behavior:
 Perception

 Learning

 Knowledge Representation and Reasoning

 Planning

 Execution

The above diagram is showing how an AI system can interact with


the real world and what components help it to show intelligence.
 Perception :-Perception component by which it retrieves

information from its environment. It can be visual, audio or another


form of sensory input.
 Learning :-learning component is responsible for learning from data

captured by Perception comportment.


 the main components are knowledge representation and Reasoning.
These two 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.
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 is a language with some concrete rules
which deals with propositions and has no ambiguity (two or more
possible ways) 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. Each sentence can be translated into
logics using syntax and semantics.
Syntax:
 Syntaxes are the rules which decide how 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(explain) the

sentence in the logic.


 Semantic also involves assigning a meaning to each sentence.

Logical representation can be categorised into mainly two logics:


 Propositional Logics

 Predicate logics

Advantages of logical representation:


 Logical representation enables us to do logical reasoning.

 Logical representation is the basis for the programming languages.

Disadvantages of logical Representation:


 Logical representations have some restrictions and are challenging

to work with.
 Logical representation technique may not be very natural, and

inference may not be so efficient.


Propositional logic in Artificial intelligence
 Propositional logic (PL) is the simplest form of logic where all the
statements are made 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.
Example:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
Following are some basic facts about propositional logic:
 Propositional logic is also called Boolean logic as it works on 0 and

1.
 In propositional logic, we use symbolic variables to represent the

logic, and we can use any symbol for a representing a proposition,


such A, B, C, P, Q, R, etc.
 Propositions can be either true or false, but it cannot be both.
 Propositional logic consists of an object, relations or function,
and logical connectives.
 These connectives are also called logical operators
 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.
 A proposition formula which has both true and false values is
called
 Statements which are questions, commands, or opinions are not
propositions such as "Where is Rohini", "How are you", "What is
your name", are not propositions.
 Syntax of propositional logic:
 The syntax of propositional logic defines the allowable

sentences for the knowledge representation. There are two types


of Propositions:
 Atomic Propositions

 Compound propositions

Atomic Proposition: Atomic propositions are the simple


propositions. It consists of a single proposition symbol. These are
the sentences which must be either true or false.
Example:
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "The Sun is cold" is also a proposition as it is a false fact.
Compound proposition: Compound propositions are constructed
by combining simpler or atomic propositions, using parenthesis and
logical connectives.
Example:
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."
Logical Connectives:
 Logical connectives are used to connect two simpler propositions

or representing a sentence logically. We can create compound


propositions with the help of logical connectives. There are mainly
five connectives, which are given as follows:
1. Negation: A sentence such as ¬ P is called negation of P. A literal
can be either Positive literal or negative literal.
2. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is
called a conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
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
5. Biconditional: A sentence such as P⇔ Q is a Biconditional
sentence, example If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
Following is the summarized table for Propositional
Logic Connectives:
Truth Table:

 In propositional logic, we need to know the truth values of


propositions in all possible scenarios. We can combine all the
possible combination with logical connectives, and the
representation of these combinations in a tabular format is
called Truth table. Following are the truth table for all logical
connectives:
 Truth table with three propositions:
We can build a proposition composing three
propositions P, Q, and R. This truth table is made-
up of 8n Tuples as we have taken three proposition
symbols.
Propositional Theorem Proving:
Inference and proofs, Proof by
resolution, Horn clauses and definite
clauses.
Propostional Theorem Proving

 Applying Rules on Inference directly to the sentences in our


knowledge base to construct a proof of the desired a proof of the
desired sentences without consulting models.
 To build that sentences and satisfy then the logical equivalence

and Inference Rules .


Logical Equivalence:- two sentences α and β are logically
equivalent if they are true in the same set of models.
α=β
Eg:- P ∧Q = Q∧ P
Inference and Proof’s
Horn clauses and definite clauses
 Horn clauses are a specific form of logic clause used in knowledge
representation. They are named after the logician Alfred Horn,
who first defined them. A Horn clause is a logical formula of the
form:
p1 ∧ p2 ∧ ... ∧ pn → q
 Here, p1, p2, ..., pn are literals (propositional variables or their

negations), and q is a single literal.


There are two types of Horn clauses:
 Definite Horn Clauses: These are Horn clauses where n = 1. In

other words, there is only one positive literal on the left-hand side
of the implication. Example: p → q.
 Horn Clauses in General: These are Horn clauses where n ≤ 1. In

other words, there can be zero or one positive literal(s) on the left-
hand side of the implication.
 Horn clauses are particularly useful in logic programming and
artificial intelligence because they are easy to reason about and can
be efficiently evaluated.
 Definite Clauses:
 Definite clauses are a broader concept than Horn clauses. A
definite clause is a logical formula that consists of a head and a
body. It is of the form:
H ← B1, B2, ..., Bn
 Here, H is the head, which is a single literal, and B1, B2, ..., Bn are
the body, which consists of zero or more literals.
 Definite clauses include Horn clauses as a special case when there
is only one literal in the body. However, definite clauses are more
general because they can have multiple literals in the body.
 In summary, Horn clauses are a specific type of definite clause
where there are restrictions on the number of literals in the body,
making them particularly simple and efficient for certain types of
logical reasoning.
First-Order Logic in
Artificial intelligence
 In the topic of Propositional logic, we have seen that how to
represent statements using propositional logic. But unfortunately,
in propositional logic, we can only represent the 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. Consider the following
sentence, which we cannot represent using PL logic.
 "Some humans are intelligent", or
 "Sachin likes cricket."
 To represent the above statements, PL logic is not sufficient, so we
required some more powerful logic, such as first-order logic.
First-Order logic:
 First-order logic is another way of knowledge representation in
artificial intelligence. It is an extension to propositional logic.
 FOL is sufficiently expressive to represent the natural language
statements in a concise way.
 First-order logic is also known as Predicate logic or First-order
predicate logic. First-order logic is a powerful language that
develops information about the objects in a more easy way and can
also express the relationship between those objects.
 First-order logic (like natural language) 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, wars, theories, squares, pits,
wumpus, ......
 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
 Syntax of First-Order logic:
 The syntax of FOL determines which collection of symbols is a
logical expression in first-order logic. The basic syntactic elements of
first-order logic are symbols. We write statements in short-hand
notation in FOL.

You might also like