Chapter-4
Chapter-4
KNOWLEDGE
REPRESENTATION AND
REASONING
OUTLINE
Knowledge Based Agents
Logic
Propositional Logic
KNOWLEDGE-BASED AGENTS
Intelligent agents
need knowledge about the real world
for taking decisions and reasoning to
act efficiently.
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
CONT’D…
A KBA must able to do the following:
An agent should be able to represent
states, actions, etc.
An agent should be able to incorporate
new percepts
An agent can update the internal
representation of the world
An agent can deduce the internal
representation of the world
An agent can deduce appropriate
actions.
CONT’D…
In AI, knowledge-based agents use
a process of reasoning over an
internal representation of knowledge
to decide what actions to take.
These agents can represent the world
with some formal representation and
act intelligently.
KBAs are composed of two main parts:
Knowledge-base (KB) and
Inference system
CONT’D…
1. Knowledge Base (KB)
It is the central component of a knowledge-
based agent.
A knowledge base is a set of sentences.
Sentence is used as a technical term.
It is related but not identical to the sentences
of English and other natural languages.
Each sentence is expressed in a language
called a knowledge representation
language and represents some assertion
about the world.
CONT’D…
There must be a way to add new
sentences to the knowledge base and a
way to query what is known.
The standard names for these
operations are TELL and ASK,
respectively.
Both operations may involve inference.
Inference
Inference is deriving new sentences
from old.
LOGIC
Knowledge bases consist of sentences.
These sentences are expressed
according to the syntax of the
representation language, which
specifies all the sentences that are
well formed.
Example: “x + y = 4” is a well-formed
sentence, whereas “x4y+ = “is not.
A logic must also define the
semantics, or meaning, of sentences.
CONT’D…
The semantics defines the truth of
each sentence with respect to each
possible world.
For example, the semantics for
arithmetic specifies that the
sentence “x + y = 4” is true in a
world where x is 2 and y is 2, but
false in a world where x is 1 and y is
1.
PROPOSITIONAL LOGIC
Propositionallogic (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.
The syntax of propositional logic
defines the allowable sentences.
CONT’D…
There are two types of propositions:
1. Atomic Propositions
2. Compound propositions
1. Atomic Propositions
The atomic sentences consist of a
use:
1. Negation:
A sentence such as ¬ P is called
negation of P.
A literal can be either Positive literal
or negative literal.
CONT’D…
2. Conjunction:
A sentence which has ∧ connective
P= Chala is intelligent,
Q= Chala is hardworking. → P∧ Q.
CONT’D…
3. Disjunction:
A sentence which has ∨ connective, such as P
P= Chala is Doctor
Q.
4. Implication:
A sentence such as P → Q, is called an
implication.
Implications are also known as if-then rules.
CONT’D…
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.
Cont’d…
The semantics define the rules to
determine the truth of a sentence
with respect to a particular model.
In propositional logic, a model simply
tables.
CONT’D…
CONT’D…
CONT’D…
Precedence of operators
Just like arithmetic operators, there is a
are:
Parentheses
Negation
Conjunction (AND)
Disjunction (OR)
Implication
Biconditional
CONT’D…
Logical equivalence
Two propositions are said to be
logically equivalent if and only if the
columns in the truth table are
identical to each other.
CONT’D…
Properties of Operators:
• Commutativity:
• P∧ Q= Q ∧ P, or
• P ∨ Q = Q ∨ P
• Associativity:
• (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
• (P ∨ Q) ∨ R= P ∨ (Q ∨ R)
• Double-negation elimination:
• ¬ (¬P) = P.
CONT’D…
• Identity element:
• P ∧ True = P,
• P ∨ True= True.
• 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).