Artificial Intelligence
Topic: Knowledge Representation & Reasoning
by
Dr. Vikas Goel
Department of IT
KIET Group of Institutions
Knowledge-Based Agent
o An intelligent agent needs knowledge about the real world for taking decisions and reasoning to act
efficiently.
o Knowledge-based agents are those agents who have the capability of maintaining an internal state of
knowledge, reason over that knowledge, update their knowledge after observations and take actions.
These agents can represent the world with some formal representation and act intelligently.
o Knowledge-based agents are composed of two main parts:
o Knowledge-base and
o Inference system.
A generic knowledge-based agent
TELL: This operation tells the knowledge base what it perceives
from the environment.
ASK: This operation asks the knowledge base what action it
should perform.
Perform: It performs the selected action.
Various levels of knowledge-based agent
• is the first level of knowledge-based agent,
• In this level, we need to specify what the agent knows, and what the agent goals
are.
• With these specifications, we can fix its behavior.
• For example, suppose an automated taxi agent needs to go from a station A to
station B, and he knows the way from A to B, so this comes at the knowledge
level.
The logical level
• At this level, we understand that how the knowledge representation of
knowledge is stored.
• At this level, sentences are encoded into different logics.
• At the logical level, an encoding of knowledge into logical sentences occurs.
• At the logical level we can expect to the automated taxi agent to reach to the
destination B.
The implementation level
• This is the physical representation of logic and knowledge.
• At the implementation level agent perform actions as per logical and
knowledge level.
• At this level, an automated taxi agent actually implement his
knowledge and logic so that he can reach to the destination.
Approaches for designing a knowledge-based agent
1. Declarative approach: We can create a knowledge-based agent by initializing with an
empty knowledge base and telling the agent all the sentences with which we want to start
with. This approach is called Declarative approach.
2. Procedural approach: In the procedural approach, we directly encode desired
behaviour as a program code. Which means we just need to write a program that already
encodes the desired behaviour or agent.
Knowledge 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
behaviour 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:
Following are the kind of knowledge which needs to be represented in AI systems:
o Object: All the facts about objects in our world domain. E.g., Guitars contains strings,
trumpets are brass instruments.
o Events: Events are the actions which occur in our world.
o Performance: It describe behaviour which involves knowledge about how to do things.
o Meta-knowledge: It is knowledge about what we know.
o Facts: Facts are the truths about the real world and what we represent.
o Knowledge-Base: The central component of the knowledge-based agents is the
knowledge base. It is represented as KB. The Knowledge-base 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.
2. Procedural Knowledge
• Procedural knowledge is a type of knowledge which is responsible for knowing how to do something.
• It includes rules, strategies, procedures, agendas, etc.
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:
• It describes relationships between concepts or objects such as kind of, part of, and grouping of
something.
AI knowledge cycle
An Artificial intelligence system has the following components for
displaying intelligent behavior:
• Perception
• Learning
• Knowledge Representation and Reasoning
• Planning
• Execution
Approaches to knowledge representation
• 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.
Player Weight Age
Player1 65 23
Player2 58 18
Player3 75 24
• Inheritable knowledge
• All data must be stored into a hierarchy of classes.
• Inferential knowledge
• Inferential knowledge approach represents knowledge in the form of formal
logics.
• Example: 1. Marcus is a man. 2.All men are mortal
man(Marcus)
∀x = man (x) ----------> mortal (x)s
• 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.
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.
• 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 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
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 / true or
false.
• In propositional logic, we use symbolic variables to represent the logic, such A, B,
C, P, Q.
• Propositional logic consists of an object, relations or function, and logical
connectives.
• These connectives are also called logical operators.
• Connectives can be said as a logical operator which connects two sentences.
• 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 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 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 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:
• We can create compound propositions with the help of logical connectives. There are mainly
five connectives, which are given as follows:
• Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or
negative literal.
• 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.
• 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 Engineer so we can write it as P ∨ Q.
• 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
• 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.
Thank
You