16 Knowledge Representation in AI-Part II
16 Knowledge Representation in AI-Part II
Part-II
isa isa
has_part
reptile mammal head
isa
size colour
large elephant grey
instance_of instance_of
likes
Clyde Nellie apples
SEMANTIC NETWORK EXAMPLE 2
Represent following KB as semantic networks.
Tom is a cat.
Tom caught a bird.
Tom is owned by John.
Tom is ginger in colour.
Cats like cream.
The cat sat on the mat.
A cat is a mammal.
A bird is an animal.
All mammals are animals.
Mammals have fur.
REPRESENTING NON-BINARY PREDICATES
RELATIONS
Semantic nets are natural ways of representing
binary predicates of predicate logic like:
Team(Pee-Wee-Resse,Brooklyn Dodgers)
Uniform_color(Pee-Wee-Resse,blue)
class Book {
Person author;
String title;
int price;
}
Mammal
subclass: Animal
has-part: head Nellie
Instance: Elephant
likes: apples
Elephant
subclass: Mammal
colour: grey Clyde
size: large Instance: Elephant
Example of a frame for a Student
Slots Filters
Roll No 101
Branch BE
Name Ram
Age 20
Address Patiala
AGPA 9.8
Advantages:
It makes the programming easier by grouping the related data.
Frame representation is easy to understand and visualize.
It is very easy to add slots for new attributes and relations.
Also, it is easy to include default data and search for missing values.
Disadvantages:
In frame system, inference mechanism cannot be easily processed.
It has a very generalized approach.
4. Production Rules
In production rules, agent checks for the condition and if the condition exists then production rule fires and
corresponding action is carried out.
The condition part of the rule determines which rule may be applied to a problem. Whereas, the action
part carries out the associated problem-solving steps. This complete process is called a recognize-act cycle.
The production rules system consists of three main parts:
i. The set of production rules
ii. Working Memory
iii. The recognize-act-cycle
Example:
IF (at station AND train arrives) THEN action (get into the train)
IF (on the train AND empty seat) THEN action (sit down).
IF (on train AND unpaid) THEN action (pay charges).
IF (train arrives at destination) THEN action (get down from the
train).
The working memory contains the description of the current state of problems-
solving and rule can write knowledge to the working memory. This knowledge
match and may fire other rules.
If there is a new situation (state) generation, then multiple production rules may
be fired together, this is called conflict set. In this situation, the agent needs to
select a rule from these sets, and it is called a conflict resolution.
Advantages of Production rule:
1. The production rules are expressed in natural language.
2. The production rules are highly modular, so we can easily remove, add or
modify an individual rule.
Disadvantages of Production rule:
1. Production rule system does not exhibit any learning capabilities, as it does not
store the result of the problem for the future uses.
2. During the execution of the program, many rules may be active hence rule-
based production systems are inefficient.