AI Unit 2
AI Unit 2
AI Unit 2
KNOWLEDGE REPRESENTATION
Knowledge Representation
• A knowledge representation is a study of ways of how
knowledge is actually represented and how effectively
it resembles the representation of knowledge in
human brain.
• A knowledge representation system should provide
ways of representing complex knowledge.
• How to represent the knowledge in a machine?
• So to represent the knowledge we need a language.
There must be a method to use this knowledge.
• Syntax and semantic must be well defined in order to
represent the language.
Characteristics of Knowledge Representation
i. The representation scheme should have a set of well-
defined syntax and semantic. This will help in
representing various kinds of knowledge.
form.
Equivalent Logical Expressions
i. ~(~F) = F (Double Negation)
ii. F & G = G & F, F V G = G V F (Commutativity)
iii. (F & G) & H = F & (G & H), (F V G) V H = F V (G V H) (Associativity)
iv. F V (G & H) = (F V G) & (F V H), F & (G V H) = (F & G) V (F & H)
(Distributivity)
v. ~(F & G) = ~F V ~G, ~(F V G) = ~F & ~G (De Morgan)
vi. F G = ~F V G
vii. F G = (~F V G) & (~G V F)
viii.x F[x] V G = x (F[x] V G )
ix. x F[x] V G = x (F[x] V G )
x. x F[x] & G = x (F[x] & G )
xi. x F[x] & G = x (F[x] & G )
Equivalent Logical Expressions...
xii. ~(x) F[x] = x (~F[x])
Hence we see that the negation of the conclusion has been proved as a
complete contradiction with the given set of facts. Hence the negation is
completely invalid or false or the assertion is completely valid or true.
Structured Knowledge
Type of Knowledge Structure
• Weak Slot - Filler Structure
– Semantic Nets
– Frame
– Scripts
– Conceptual Dependency
Semantic Nets
• Semantic network or a semantic net is a structure for
representing knowledge as a pattern of interconnected
nodes and arcs.
• It is also representation of knowledge.
• Node in the semantic net represent either
– Entities,
– Attributes,
– State or Events.
• Arcs in the net give the relationship between the nodes.
• Labels on the arc specify what type of relationship actually
exits.
Example: Semantic networks…
• “A sparrowis a bird”
– Two concepts: “sparrow” and “bird”
– sparrow is a kind of bird, so connect the two
concepts with a IS-A relation
This is an higher-lower relation or abstract-concrete
relation
Sparrow IS-A
Bird
Example: Semantic networks…
• “A bird
has wings”
– This is a different relation: the part-whole relation
– Represented by a HAS-A link or PART-OF link
– The link is from whole to part, so the direction is the
opposite of the IS-A link
Wings
HAS-A
Sparrow IS-A
Bird
Example: Semantic Networks…
• Tweety and Sweety are birds
• A crow is a bird
• Sparrow is a bird.
Beak
Red Color
Semantic networks can answer
•
queries
Query: “Which birds have red beaks?” ?
• Answer: Tweety
• Method: Direct match of subgraph Beak
HAS-A
Red
• Query: “Can Tweety fly?” Color
• Answer: Yes
• Method: Following the IS-A link from “Tweety”
to “bird” and the property link of “bird” to “fly”
Example: Semantic Networks..
• Motor-bike is a moving-vehicle.
has has
Brakes Moving-Vehicle Engine
has has
Electrical-system Fuel-system
Hierarchical Structure
vehicle
Is_a Is_a Is_a
Is_a Is_a
head trunk
mouth
Semantic networks
• Advantages of semantic networks
– Simple representation, easy to read
– Associations possible
– Inheritance possible
• Disadvantages of semantic networks
– A separate inference procedure (interpreter) must be
build
– The validity of the inferences is not guaranteed
– For large networks the processing is inefficient
Partitioned Semantic Networks
• Hendrix the so-called partitioned
developedto represent thesemantic
network difference between the description of
an individual object or process and the description of a set of
objects. The set description involves quantification.
SA
General
Statemen dog bite postman
t
is_a S1
is_a is_a is_a
form
G D
agent
B
patient
P
Partitioned Semantic Networks
• Suppose that we now want to look at the statement:
– "Every dog has bitten every postman"
SA
General
Statemen dog bite postman
t
is_a S1
is_a is_a is_a
form
G D
agent
B
patient
P
Partitioned Semantic Networks
• Suppose that we now want to look at the statement:
– "Every dog in town has bitten the postman"
SA
dog
General
Statemen town dog bite postman
t
is_a S1
is_a is_a is_a
form
G D
agent
B
patient
P
NB: 'ako' = 'A Kind Of'
Partitioned Semantic Networks
• The partitioning of a semantic network renders them more
– logically adequate, in that one can distinguish between
individuals and sets of individuals,
– and indirectly more heuristically adequate by way of
controlling the search space by delineating semantic
networks.
is_a
object
space
pizza tasty
is_a is_a
form
S1 is_a
form is_a
S2 is_a
GS2 exists
p1 receiver l1
s1 agent
Solution 3
• John gave Mary the book
Gave Book
Action Instance
Patient
Mary
Frame
• Marvin proposed (1975) frames as a means of
Minsky
common-sense knowledge.
• Minsky proposed that knowledge is organized into small
packets called frames.
• The contents of the frame are certain slots which have values .
• A Frame can be defined as static data structure that has slots for
various objects and a collection of frames consists of
expectation for a given situation.
• All frames of a given situation constitute the system, whenever
one encounters a situation, a series of related frames are
activated and reasoning is done.
Type of Frame
• Frame is used to represent two type of knowledge
– Declarative/factual/situational/ frame
– Procedural/action frame
Declarative Frame
• A frame that contains only descriptive type of knowledge
called declarative/factual Frame type .
Example of Declarative Frame
Name : Computer Centre Frame Name
Computer
Printer
Stationery
Procedural Frame
• Apart from the declarative part in a frame, it is possible to attached
slots which explain how to perform things. Or we say that, it is
possible to have procedural knowledge representation in a frame.
The action-frame (Procedural knowledge embedded) has the
following slots-
• Actor Slot- Which holds information about who is performing the
activity.
• Object Slot- This frame has information about the item to
be operated on.
• Source Slot- Source slot holds information from where the action
has to begin
• Destination Slot- Holds information about the place where
the action has to end.
• Task Slot-This generate the necessary sub-frames required
to the operation.
perform
Name : Cleaning the jet of carburetor
Actor
Expert
Object
Carburetor
Source Destination
Scooter Scooter
• Reflex Agent
• Reflex Agent with State
• Goal-based Agent
• Utility-Based Agent
• Learning Agent
Reflex Agent
Reflex Agent with State
State Management