AI Unit II All Topics
AI Unit II All Topics
UNIT II
Knowledge Representation (KR)
Introduction to KR
Representation of knowledge and the reasoning process
are central to the entire field of artificial intelligence.
Robert is American
American(Robert). ..........(8)
Forward Chaining: Example
Step-1:
In the first step we will start with the known facts and will
choose the sentences which do not have implications, such
as: American(Robert), Enemy(A, America), Owns(A, T1),
and Missile(T1).
so we can add
Criminal(Robert)
which infers all
the available facts.
And hence we
reached our
goal statement.
Backward Chaining
A backward chaining algorithm is a form of reasoning,
which starts with the goal and works backward, chaining
through rules to find known facts that support the goal.
Example:
In backward-chaining, we will use the same above example,
and will rewrite all the rules:
American(Robert). ..........(8)
Backward Chaining: Example
In Backward chaining, we will start with our goal predicate,
which is Criminal(Robert), and then infer further rules.
Step-1:
At the first step, we will take the goal fact. And from the
goal fact, we will infer other facts, and at last, we will prove
those facts true.
So we will
add all the
conjunctive
facts below
the first level
and will
replace p with Robert.
Backward Chaining: Example
Step-3: We will extract further fact Missile(q) which infer
from Weapon(q), as it satisfies Rule-(5).
Weapon (q) is
also true with
the substitution
of a constant T1
at q.
Backward Chaining: Example
Step-4: we can infer facts Missile(T1) and Owns(A, T1) form
Sells(Robert, T1, r)
which satisfies the
Rule- 4, with the
substitution of A
in place of r.
So these two
statements are
proved here.
Backward Chaining: Example
At step-5, we can infer the fact Enemy(A,
America) from Hostile(A)
which satisfies Rule- 6.
Note: Statement (2) and (4) are not used in proving the given
axiom. So, it is clear that goal never matches the negated
versions of the axioms. Always Modus Ponen is used,
rather Modus Tollen.
Backward Chaining: Example 3
Consider the below axioms:
1. x: clothes(x)→loves(Gita, x).
2. Suits(x)→Clothes(x).
3. Jackets(x)→Clothes(x).
4. wears(x,y)→Ʌ ¬bad(y)→Clothes(x)
5. wears(Sita,skirt)Ʌ ¬good(Sita)
6. wears(Sita,x)→wears(Renu,x)
It is clear from the above graph Gita wears Kurtis and does
not look bad. Hence, Gita loves Kurtis.
Resolution
Resolution method is an inference rule which is used in
both Propositional as well as First-order Predicate Logic in
different ways.
If C1' and C2' are singletons (i.e. contain just one literal), the
rule is called Binary Resolution.
Resolution: in first order logic
Problem Statement:
1. Ravi likes all kind of food.
2. Apples and chicken are food
3. Anything anyone eats and is not killed is food
4. Ajay eats peanuts and is still alive
5. Rita eats everything that Ajay eats
Hence Proved
Resolution: Example 2
Consider the following Knowledge Base:
1. The humidity is high or the sky is cloudy.
2. If the sky is cloudy, then it will rain.
3. If the humidity is high, then it is hot.
4. It is not hot.
Hence, we have
achieved the given
goal with the help
of Proof by Contradiction.
If for example:
we have a rule ``IF (bird X) THEN ADD (flies X)'' and another
rule ``IF (bird X) AND (penguin X) THEN ADD (swims X)'' and
a penguin called tweety
then we would fire the second rule first and start to draw
conclusions from the fact that tweety swims.
Forward reasoning: properties
• It is a down-up approach, as it moves from bottom to top.
Solution:
• Create new nodes to represent new objects either
contained or alluded to in the knowledge, game and
fixture in the current example.
• Relate information to nodes and fill up slots.
Semantic Nets: Example
Example 2: Colour
instance: SLOT
domain: Physical-Object
range: Colour-Set
single-valued: FALSE
Semantic Net – Slots Example
Example3 : Team-Colours
instance: SLOT
isa: Colour
domain: team-player
range: Colour-Set
range-constraint: not Pink
single-valued: FALSE
Example 4: Position
instance: SLOT
domain: Rugby-Player
range: { Back, Forward, Reserve }
to-compute: x.position
single-valued: TRUE
Semantic Net - Inheritance
Inheritance is one of the main kind of reasoning done
in semantic nets.
The ISA (is a) relation is often used to link a class and its
super- class.
Inheritable Knowledge
Inferential Knowledge
Procedural knowledge
Inheritable Knowledge
Relational knowledge is made up of objects consisting
of
• Attributes
• Corresponding associated values
Advantages:
• A set of strict rules.
o Can be used to derive more facts.
o Truths of new statements can be verified.
o Guaranteed correctness.
• Many inference procedures available to in implement
standard rules of logic.
• Popular in AI systems. e.g Automated theorem
proving.
Procedural knowledge
Knowledge encoded in some procedures.