1. By Bal Krishna Subedi 1
Artificial Intelligence Knowledge & Reasoning
How to represent the real world aspect ?
What content to put in the Knowledge Base?
Knowledge Representation
Reference: Sections 10.1, 10.2, 10.6 & 10.7 of Textbook R&N
2. By Bal Krishna Subedi 2
Knowledge Representation
There are various types of knowledge that need to be represented in
a computer:
- declarative and procedural knowledge,
- commonsense knowledge, scientific knowledge, mathematical knowledge.
There is always a relationship between the form in which knowledge
is represented and the way in which the knowledge is used.
Domain-specific knowledge is often necessary for many AI tasks
logic-based representation is the foundation of various kinds of
knowledge representation.
Artificial Intelligence Knowledge & Reasoning
3. By Bal Krishna Subedi 3
What is a representation?
A representation consists of two sets and a mapping between them. The elements
of each set are objects, relations, classes, laws, actions. The first set is called the
represented domain, and the second one is called the representation domain.
This mapping allows the agent to reason about the represented domain by
performing reasoning processes in the representation domain, and transferring the
conclusions back into the represented domain.
Artificial Intelligence Knowledge & Reasoning
If an object is on top of
another object that is itself on
top of a third object then the
first object is on top of the
third object.
RULE
x,y,z OBJECT,
(ON x y) & (ON y z) (ON x z)
represents
ONCUP1 BOOK1 ON TABLE1
CUP BOOK TABLE
INSTANCE-OF
OBJECT
SUBCLASS-OF
Represented Domain Representation Domain
ONTOLOGY
4. By Bal Krishna Subedi 4
What is an ontology
Every knowledge-based agent has a conceptualization or a model of
its world which consists of representations of the objects, concepts,
and other entities that are assumed to exist, and the relationships that
hold among them.
An ontology is a specification of the terms that are used to represent
the agent’s world.
Define the terminology about the objects and their relationships in a
systematic way
– closely related to taxonomies, classifications
• ontologies don’t have to be hierarchical
• emphasis on the terms to describe objects, relationships, not on the properties of
objects or specific relationships between objects
Artificial Intelligence Knowledge & Reasoning
5. By Bal Krishna Subedi 5
Why ontological Representation?
Enables an agent to communicate with other agents,
because they share a common vocabulary (terms) which
they both understand.
Enables knowledge sharing and reuse among agents.
– Ontological commitment:
Agreement among several agents to use a shared vocabulary in a
coherent and consistent manner.
Artificial Intelligence Knowledge & Reasoning
6. By Bal Krishna Subedi 6
Object ontology
We define an object ontology as a hierarchical description of the
objects specifying their properties and relationships
In the military domain the object ontology will include descriptions of military
units and of military equipment. These descriptions are most likely needed in
almost any specific military application.
Because building the object ontology is a very complex task, it makes sense to
reuse these descriptions when developing a knowledge base for another military
application, rather than starting from scratch.
It includes both descriptions of types of objects (called concepts)
and descriptions of specific objects (called instances).
Artificial Intelligence Knowledge & Reasoning
7. By Bal Krishna Subedi 7
Instances, concepts and generalization
A concept is a representation of a set of instances.
An instance is a representation of a particular entity in
the application domain.
Artificial Intelligence Knowledge & Reasoning
OSTRICHCANARY
BIRD
INSTANCE-OF INSTANCE-OF
Represents the
entity called
OSTRICH
Represents the set of all birds
(which includes CANARY &
OSTRICH)
8. By Bal Krishna Subedi 8
Generalization
• Generalization is a fundamental relation between concepts.
• Intuitively, a concept P is said to be more general than (or
a generalization of) another concept Q if and only if the set
of instances represented by P includes the set of instances
represented by Q.
Artificial Intelligence Knowledge & Reasoning
ANIMAL
BIRD
OSTRIC
H
FISH
CANAR
Y
Possible relationship between two concepts P and Q
- P is more general than Q
- Q is more general than P
- There is no generalization relationship between P and Q
9. By Bal Krishna Subedi 9
Basic representation unit
This is a necessary definition of ‘conceptk’.
It defines ‘conceptk’ as being a subconcept of ‘concepti’ and having
additional features.
This means that if ‘concepti’ represents the set Ci of instances, then ‘conceptk’
represents a subset Ck of Ci.
The elements of Ck have the features ‘FEATURE1’,..., ‘FEATUREn’ with the
values ‘value1’,..., ‘valuen’, respectively.
Artificial Intelligence Knowledge & Reasoning
conceptk ISA concepti
FEATURE1 value1
. . .
FEATUREn valuen
10. By Bal Krishna Subedi 10
General features of a representation
Artificial Intelligence Knowledge & Reasoning
• Representational adequacy
The ability to represent all of the kinds of knowledge that are needed in a
certain domain.
• Inferential adequacy
The ability to represent all of the kinds of inferential procedures (procedures
that manipulate the representational structures in such a way as to derive new
structures corresponding to new knowledge inferred from old).
• Inferential efficiency
The ability to represent efficient inference procedures (for instance, by
incorporating into the knowledge structure additional information that can be
used to focus the attention of the inference mechanisms in the most promising
directions).
• Acquisitional efficiency
The ability to acquire new information easily.
11. By Bal Krishna Subedi 11
Representing knowledge in semantic
networks
The underlying idea of semantic networks is to represent knowledge
in the form of a graph in which the nodes represent objects, situations,
or events, and the arcs represent the relationships between them.
Artificial Intelligence Knowledge & Reasoning
Mammals
Persons
Female Male
JohnMary
MemberOf MemberOf
SubsetOf
SubsetOf
SubsetOf
62
HasHeight
2
Legs
FriendOf
12. By Bal Krishna Subedi 12
Representing knowledge in semantic
networks
Artificial Intelligence Knowledge & Reasoning
Sun
Earth
yellow
mass
mass
temperature
greater-than
color
revolves-
arround
attracts
TSun
TEarth
MSun
MEarth
temperature
greater-than
value3500
Example of a semantic network
representing knowledge about
our solar system.
13. By Bal Krishna Subedi 13
Reasoning with semantic networks
The transitivity of the ISA and INSTANCE-OF
The relationships between ISA and INSTANCE-OF :
x y z INSTANCE-OF(x, y) & ISA(y, z) INSTANCE-OF(x, z)
that is, if x is an instance of y and y is a subconcept of z then x is an instance of z.
x y z ISA(x, y) & ISA(y, z) ISA(x, z)
i.e., if x is a subconcept of y and y is a subconcept of z then x is a subconcept of z.
Artificial Intelligence Knowledge & Reasoning
animal
robin
Clyde
bird
isa
isa
instance-of
Clyde is an instance of robin,
an instance of bird,
and an instance ofanimal
robin is a subconcept (subclass) ofbird,
and a subconcept of animal
Example:
14. By Bal Krishna Subedi 14
Reasoning with semantic networks
Inheritance
A knowledge which is implicitly represented in a semantic network
is the inheritance of properties from a more general concept to a
less general one.
For example:
ISA(ACETONE, SOLVENT) & REMOVES(SOLVENT, SURPLUS-
ADHESIVE) REMOVES (ACETONE, SURPLUS-ADHESIVE)
i.e. the fact that SOLVENT REMOVES SURPLUS-ADHESIVE and
ACETONE is a SOLVENT implies that ACETONE REMOVES
SURPLUS-ADHESIVE.
Artificial Intelligence Knowledge & Reasoning
15. By Bal Krishna Subedi 15
Reasoning with semantic networks
Multiple inheritance
An object (instance or concept) may inherit properties from several
super-concepts.
How can we deal with the inheritance of contradictory properties?
In such a case, the system would use some strategy in selecting one of the values.
The simplest strategy is to use the first value found.
A better solution is to detect such conflicts when the semantic network is built or
updated, and to directly associate the correct property value with each node that
would inherit conflicting values.
cartoon character
Opus
funny paperssouth pole penguin
instance-ofinstance-of
habitathabitat
Artificial Intelligence Knowledge & Reasoning
16. By Bal Krishna Subedi 16
Reasoning with semantic networks
Default Inheritance
Properties associated with concepts in a hierarchy are assumed to be true of all
subclasses and instances.
How can we deal with exceptions (i.e. sub-concepts or instances that do not
have the inherited property)?
Explicitly override the inherited property.
Artificial Intelligence Knowledge & Reasoning
bird
wren false
true
ostrich
fly
fly
woodpecker
animal
mammal
17. By Bal Krishna Subedi 17
Reasoning with semantic networks
Network matching
A network fragment is constructed, representing a sought-for object or a
query, and then matched against the network database to see if such an
object exists.
Network matching allows to ask questions about the object in the
network.
Variable nodes in the fragment are bound in the matching process to the
values with which they match perfectly.
Artificial Intelligence Knowledge & Reasoning
John
height
72
What is the height of John ?
John
height
x
Question:
Answer:
The height of John is 72.
18. By Bal Krishna Subedi 18
Reasoning with semantic networks
Network matching: Example
We might construct the network which represents an instance of ownership in
which Clyde is the owner. This fragment is then matched against the network
database looking for an own node that has an owner link to Clyde.
When it is found, the node that the ownee link points to is bound in the partial
match and is the answer to the question.
And if no match been found, the answer would have been "Clyde does not own
anything".
Artificial Intelligence Knowledge & Reasoning
ownership
own1
owner ownee
nest-1
nest
robin
Clyde
bird
instance-of
isa
instance-of instance-of
Query: "What does Clyde own?"
Network Database
19. By Bal Krishna Subedi 19
Reasoning with semantic networks
Network matching: Example
Artificial Intelligence Knowledge & Reasoning
ownership
own-?owner ownee
?Clyde
instance-of
ownership
own-?
owner ownee
nest-?
nest
bird-?
bird
instance-ofinstance-of instance-of
A semantic network representing the question "What does Clyde own ?".
A semantic network representing the question "Is there a bird who owns a nest?".
Here, bird-?, nest-?, and own-? nodes represent the yet to be determined bird-
owning-nest relation.
Answer to the question would be "Yes, Clyde"
20. By Bal Krishna Subedi 20
Conceptual Graphs
A finite, connected, bipartite graph.
The nodes of graph are either concepts or conceptual relations (no
leveled arcs).
Conceptual relation nodes indicate a relation involving one or more
concepts.
A relation of arity n is represented by a conceptual relation node
having n arcs.
The types and individual labels are separated by colon.
# to represent unnamed individual.
Graphs may be arbitrarily complex but must be finite.
A typical knowledge base contain a number of such graphs.
Artificial Intelligence Knowledge & Reasoning
21. By Bal Krishna Subedi 21
Conceptual Graphs
Artificial Intelligence Knowledge & Reasoning
dog browncolor
Proposition: “A dog has a color of brown”
Proposition: “Mary gave John the book”
Person: Mary
Person: John
agent
recipient
give Object
book
Dog: #1352 browncolor
Proposition: “A dog named emma is brown”
emmaname
22. By Bal Krishna Subedi 22
Conceptual Graphs
We can use generic marker * to indicate an unspecified individual.
dog ~ dog:*.
Generic marker allows the use of named variables. dog: *X.
Proposition: “The dog scratches its ear with its paw”.
Artificial Intelligence Knowledge & Reasoning
dog:*X scratch ear
dog:*Xpaw
agent object
part
part
instrument
23. By Bal Krishna Subedi 23
Conceptual Graphs & Logic
Conjunction – easy to represent in conceptual graph.
Negation – represented by using a “neg” unary operation.
Artificial Intelligence Knowledge & Reasoning
Disjunction - Using the negation and conjunction we may form
a graphs that represent disjunction
In conceptual graphs, generic concepts are assumed to be
existential quantified.
Using the negation and existential quantification we can represent
universal quantification.
24. By Bal Krishna Subedi 24
Conceptual Graphs & Logic
This graph corresponds to the logical expression
X Y (dog(X) color(Y) pink(Y)) is equivalent to
X Y (¬(dog(X) color(Y) pink(Y))).
Artificial Intelligence Knowledge & Reasoning
Proposition: “There are no pinks dogs”
dog color pink
neg
25. By Bal Krishna Subedi 25
Home Works
1. 10.5, 10.7, 10.22 & 10.23.
2. Represent the following sentences into a semantic network.
Birds are animals.
Birds have feathers, fly and lay eggs.
Albatros is a bird.
Donald is a bird.
Tracy is an albatros
3. Consider the following network fragment:
Explain how a semantic network system would answer the questions:
Artificial Intelligence Knowledge & Reasoning
Roman person
Pompeian man
ruler
Marcus Caesartryassassinate
isa isa
instance-of instance-of
instance-of
height
72
What is the height of Marcus?
Is there a person who tried to assassinate Caesar?
26. By Bal Krishna Subedi 26
Home Works
4. Translate each of the following sentences into predicate
calculus and conceptual graphs:
“Jane gave Tom an ice cream cone”
“Basketball player are tall”
“Paul cut down the tree with an axe”
“Place all the ingredients in a bowl and mix thoroughly”
5. Translate the following graphs into predicate calculus.
Artificial Intelligence Knowledge & Reasoning
Person: John eat
soup
handpart
instrument
object
agent