Transcript Lecture 15

Alternative representations: Semantic networks
A semantic net is a labeled directed graph, where each node represents an
object (a proposition), and each link represents a relationship between two
objects.
Example:
sister-of
Ann
husband-of
wife-of
husband-of
mother-of
Carol wife-of
Bill
father-of
David
mother-of
wife-of
father-of
Susan husband-of
mother-of
Tom
father-of
John
Note that only binary relationships can be represented in this model.
Semantic nets represent propositional information. Relations between propositions are
of primary interest because they provide the basic structure for organizing knowledge.
Some important relations are:
– “IS-A” (is an instance of). Refers to a member of a class, where a class is a
group of objects with one or more common attributes (properties). For
example, “Tom IS-A bird”.
– “A-KIND-OF”. Relates one class to another, for example “Birds are A-KIND-OF
animals”.
– “HAS-A”. Relates attributes to objects, for example “Mary HAS-A cat”.
– “CAUSE”. Expresses a causal relationship, for example “Fire CAUSES smoke”.
Note that semantic nets can be easily converted into a set of FOL formulas, and
vice versa. Semantic nets, however, have two important advantages:
1. A very simple execution model.
2. Very readable representation, which makes it easy to visualize inference steps.
Inference in semantic networks.
The inference procedure in semantic nets is called inheritance, and it allows
one node’s characteristics to be duplicated by a descendent node.
Example: Consider a class “aircraft”, and assume that “balloons”, “propeller-driven
objects” and “jets” are subclasses of it, i.e.
“Balloons are A-KIND-OF aircrafts”
“Propeller-driven objects are A-KIND-OF aircrafts”, etc.
Assume that the following attributes are assigned to aircrafts: “Aircraft IS-A flying
object”, “Aircraft HAS-A wings”, “Aircraft HAS-A engines”
All properties assigned to the superclass, “aircraft”, will be inherited
by its subclasses, unless there is an “exception” link capturing a
non-monotonic inference relation.
Multiple inheritance may result in a conflicting inference
In some semantic networks, one class can inherit properties of more than one
superclass.
The “Nixon diamond” example: It is widely accepted that Quakers tend to be pacifists, and
Republicans tend not to be. Nixon is known to be both - a Quaker, and a Republican.
Not IS-A
Pacifists
Republicans
IS-A
Quakers
IS-A
IS-A
Nixon
The resulting conflict can be resolved only if additional information stating a preference to
one of the conflicting inferences is provided.
Object-attribute-value triplets
One problem with semantic nets is that there is no standard definition of link
names. To avoid this ambiguity, we can restrict this formalism to a very simple
kind of a semantic network, which has only two types of links, “HAS-A” and
“IS-A”. Such a formalism is called Object-Attribute-Value (OAV) triplets, and it
is a widely used mode of knowledge representation (especially for representing
declarative knowledge). It is also the base of the Semantic Web KR model, called RDF.
Example: Consider object “airplane”. Some of its attributes are:
– number of engines;
– type of engines;
– type of wing design.
Possible values of these attributes are:
– number of engines: 2, 3, 4.
– type of engines: jet, propeller-driven.
– type of wing design: conventional, swept-back.
Object-attribute-value triples (example contd)
Object
Airplane
Airplane
Airplane
Airplane
Airplane
Airplane
Airplane
Attribute
NumberOfEngines
NumberOfEngines
NumberOfEngines
TypeOfEngines
TypeOfEngines
TypeOfWings
TypeOfWings
Or, as predicates
NumberOfEngines (Airplane, 2), …
TypeOfEngines (Airline, Jet), …
TypeOfWings (Airlines, Propeller), …
Value
2
3
4
Jet
Propeller
Conventional
SweptBack
Problems with semantic nets and OAV triplets
•
•
•
•
There is no standard definition of link and node names. This makes it difficult to
understand the network, and whether or not it is designed in a consistent
manner.
Inheritance is a combinatorially explosive search, especially if the response to a
query is negative. Plus, it is the only inference mechanism built in semantic nets,
which may be insufficient for some applications.
Initially, semantic nets were proposed as a model of human associative memory
(Quinllian, 1968). But, are they an adequate model? It is believed that human
brain contains about 10^10 neurons, and 10^15 links. Consider how long it takes
for a human to answer “NO” to a query “Are there trees on the moon?”
Obviously, humans process information in a very different way, not as suggested
by the proponents of semantic networks.
Semantic nets are logically and heuristically very weak. Statements such as “Some
books are more interesting than others”, “No book is available on this subject”, “If
a fiction book is requested, do not consider books on history, health and
mathematics” cannot be represented in a semantic network.
Frames (Minsky, 1975)
Semantic nets represent shallow knowledge, because all of the information must be
represented in terms of nodes and links which are propositions. What if the objects in
the domain are, in turn, complex structures? For example, consider object “animal”.
We may want to incorporate as part of the object’s description all of the important
properties of this object.
Example: AIMA (first edition), page 318, Figure 10.7
Note that “frames” comprising the nodes of this frame-based network represent
“typical examples” or “stereotypes” of described objects. Such typical example are
called concepts, and they are like data structures where data, in turn, contain data.
The underlying assumption of the frame theory is that when one encounters a
new situation (or a substantial change in one’s view of the situation occurs),
one selects from his/her memory the frame representing a given concept and
changes it to reflect the new reality.
Note: Case-based reasoning systems exclusively utilize frames as a knowledge
representation formalism.
Problems with Frames
•
•
•
Frames cannot represent exceptions. By definition, frames represent typical
objects. But, consider Clyde, an elephant with 3 legs. Is he NOT an elephant?
Frames lack a well-defined semantics. Consider Sam, a bat. Is he a typical
mammal?
It is difficult to incorporate heuristic information into the frame. For example,
consider a medical ES which uses frames to represent a typical patient or a
typical disease. It is difficult to represent how specific symptoms relate to each
other and how they must be used in the diagnostic process.
In general, frames are good for representing class hierarchies to model domains
where objects are well defined and the classification is clear cut.
Description logics
Description logics are decidable fragments of FOL intended to represent categories
(classes/concepts), the relations between classes (roles) and individuals.
Example: Consider category “Student”. One possible definition of this category is
Student  And(takes-classes, does-homeworks, is-responsible)
Note that this definition can be translated into the following FOL sentence
 x (Student(x) <=> Takes-classes(x) & Does-homeworks(x) &
& Is-responsible(x))
Example: Consider category of men with at least three sons who are all unemployed
and married to doctors, and at most two daughters who are all professors in
physics or chemistry departments.
Man3SS2SD  And(Man, At-Least(3, Son), At-Most(2, Daughter),
All(Son, And(Unemployed, Married, All(Spouse, Doctor))),
All(Daughter, And(Professor, Fills(Department, Physics, Chemistry)))).
DLs is a family of logics which defer by their expressivity depending on the
constructors employed to build complex descriptions from simple ones.
General Architecture of Description Logics
DL knowledge base consists of 3 parts:
•
•
•
The TBox, which contains terminological knowledge (i.e. knowledge about concepts in
a domain).
Examples: Student  Person ⊓  takesCourse . Course
Student ⊑ Person
The ABox, which contains assertion knowledge (i.e. knowledge about individuals).
Example: Student (Bob), takesCourse (Bob, ComputerScience)
The RBox, R, which contains role-centric knowledge (i.e. knowledge about
interdependences between roles/properties)
Example: teachesGradCourse ⊑ teachesAtUniv
RBox is not required; only more expressive DLs have constructors to handle RBoxes.
The smallest deductively complete DL is called ALC. It contains ⊓, ⊔, and  constructors,
and quantifiers restricting the domain and the range of roles, i.e.  R . C and  R . C
It also contains class inclusion axiom (ex. Student ⊑ Person) and class equivalence
axiom (ex. PhDThesis  Dissertation)
ALC (Attributive Language with Complements): Syntax

ALC Atomic types:
• Concept names: A, B, C, …
• Top and bottom concepts, ᴛ and 
• Role names: R, S, …
 ALC Constructors: ⊓, ⊔, ,  R . C and  R . C
 Class inclusion and equivalence axioms: ⊑, 
 Complex class relations are built from atomic types and ⊓, ⊔, 
Example: Instructor ⊑ (Staff ⊓ Professor) ⊔ Lecturer
In FOL: x Instructor(x)  (Staff(x)  Professor(x))  Lecturer(x)
 Quantifiers on Roles:
• Strict binding of the range of a role to a class. Example: A thesis must be authored
by a student, i.e. Thesis ⊑  author . Student
In FOL: x (Thesis(x)  y(author(x, y)  Student(y)))
• Open binding of the range of a role to a class. Example: Every student has at least
one advisor, i.e. Student ⊑  advisor . Professor
In FOL: x (Student(x)  y (advisor(x, y)  Professor(y)))
ALC: Formal Syntax
 Production rules for creating classes in ALC :
C, D ::= A | T | | C | C ⊓ D | C ⊔ D |  R . C |  R . C
where A is an atomic class, C and D are complex classes, and R
is a role.
 An ALC TBox contains assertions of the forms C ⊑ D and C  D
 An ALC ABox contains assertions of the form C(a) and R(a, b), where a and b
are individuals.
 An ALC Knowledge Base = {TBox, ABox}.
ALC: Semantics

An interpretation, I = (I, .I), is defined by:
• A domain of individuals, I
• An interpretation function .I which maps
• Individual names, a, to domain elements aI  I
• Class names, C, to a set of domain elements CI  I
• Role names, R, to a set of pairs of domain elements
RI  I  I
 An interpretation, I, for axioms:
• C(a) holds iff aI  CI
• R(a, b) holds iff (aI, bI)  RI
• C ⊑ D holds iff CI  DI
• C  D holds iff CI = DI
 An interpretation, I, for complex classes is defined as follows:
• TI = I and I = 
• (C ⊓ D)I = CI  DI , (C ⊔ D)I = CI  DI , ( C)I = I \ CI
•  R . C = {a  I |(  b  I ) ((a, b)  RI  b  CI )}
•  R . C = {a  I | (b  I ) ((a, b)  RI  b  CI )}
More DL constructors that are beyond ALC







Number restrictions for roles. Example:  20 hasStudent
Qualified number restrictions for roles. Example:
6 hasStudent . Graduate
Nominals (definition by enumeration): {CS151, CS152, CS253}
Concrete domains (datatypes): hasStudent . ( 20)
Inverse roles: hasChild-  hasParent
Transitive roles: has Ancestor ⊑+ has Ancestor
Role composition: hasParent . hasBrother (uncle)
Constructors allowed define the specific DL. Examples
–
–
–
–
–
–
S: ALC + Transitive roles;
R: Role constructors;
O: Nominals;
I: Inverse roles;
Q: Qualified number restrictions;
(D): datatypes.
SROIQ(D) is the DL behind the latest version of OWL 2.
Questions DLs inference must address







Does the knowledge base make sense?
Are there empty classes?
Are two classes equivalent?
Does one class subsume another class?
Are two classes disjoined?
Is a given individual a member of a specified class?
Find all individuals of a given class.
The so-called tableaux algorithm (initially developed for FOL) is adapted to
DLs to guarantee that these questions are answered in finite time. Tableaux
algorithm proves unsatisfiability of a KB using the refutation method and
transformation rules similar to Wang’s algorithm (called here tableaux
extension rules)
Tableaux algorithm: PL example
Given an expression in disjunctive normal form, construct the tableaux /
decision tree where each node is a logical formula, each path from the root
note to a leaf note is a conjunction of formulas, and each branch of a path is a
disjunction of formulas. To build the tree, we apply the following rules:
Example:
(A & B & C)  (D & A)  (B & D)
-rule
(A & B & C)
-rule
(D & A)  (B & D)
-rule
A
(D & A)
B
D
C
A
(B & D)
B
D
-- -Rules: (A & B) => A, B
(A  B) => A, B
(A  B) => A, B
-- -Rules:
A
AB
B
A
(A & B)
B
A
AB
B
-- Double negation rule: A => A
-- True => False, False => True
Tableaux Algorithm for ALC
Step 1: Translate the DL KB to a negation normal form (NNF) using the following
transformations:
i.
Substitute C  D by C ⊑ D and D ⊑ C
ii.
Substitute C ⊑ D by C ⊔ D
iii. Apply all possible NNF transformations to complex classes:
i.
NNF ( C)  NNF (C)
ii.
NNF (C ⊔ D)  NNF (C) ⊔ NNF (D)
iii. NNF (C ⊓ D)  NNF (C) ⊓ NNF (D)
iv. NNF ((C ⊔ D))  NNF (C) ⊓ NNF (D)
v.
NNF ((C ⊓ D))  NNF (C) ⊔ NNF (D)
vi. NNF ( R . C)  ( R) . NNF (C)
vii. NNF ( R . C)  ( R) . NNF (C)
viii. NNF ( R . C)  ( R) . NNF (C)
ix. NNF ( R . C)  ( R) . NNF (C)
Tableaux Algorithm for ALC (contd.)
Step 2: Apply the following tableaux expansion rules to derive new ABox facts until no
more rules can be applied (in which case we say that the tableaux is fully
expanded).




⊓ -Rule if (C ⊓ D) (a)  ABox and {C(a), D(a)}  ABox,
then ABox’ = Abox  {C(a), D(a)}
⊔ -Rule if (C ⊔ D) (a)  ABox and {C(a), D(a)}  ABox = ,
then ABox’ = ABox  {C(a)} and ABox” = ABox  {D(a)}
-Rule if  R . C(a)  ABox and there is no b such that C(b)  ABox and
R(a, b)  ABox
then Abox ‘ = Abox  {C(z), R(a, z)} for a new individual z  ABox
-Rule if R . C(a)  ABox and R(a, b)  Abox, but C(b) ABox
then Abox ‘ = Abox  {C(b)}
The algorithm returns TRUE if there is a clash-free tableaux and FALSE if the tableaux is
closed. The tableaux is closed if all its paths are closed, where a path is closed if a
formula and its negation occur along that path, or if false occurs. To prove X, we must
obtain a closed tableaux for X.
Example
Let TBox = {Professor ⊑ (Person ⊓ Staff) ⊔ (Person ⊓ Student)}
Prove: Professor ⊑ Person
Step 1: Negate the conclusion you want to prove.
 (Professor ⊑ Person)
Step 2: Convert all formulas in the NNF:
TBox = { Professor ⊔ (Person ⊓ Staff) ⊔ (Person ⊓ Student)}
NNF ( (Professor ⊑ Person)) = NNF ( (Professor ⊔ Person)) =
= NNF (Professor) ⊓ NNF ( Person) = Professor ⊓  Person
Step 3: Apply the tableaux extension rules to derive new ABox facts from the TBox
extended with the negated theorem.
Example: step 3 (contd.)
(1) Professor(a) ⊓  Person(a)
(Consider a new individual a for whom you are
disproving the theorem)
(2) Apply ⊓-rule to (1): Professor(a)
closed path
(3) Apply ⊓-rule to (1):  Person(a)
closed path
(4) Professor(a) ⊔ (Person(a) ⊓ Staff(a)) ⊔ (Person(a) ⊓ Student(a))
(5) Apply ⊔-rule to (4): Professor(a)
(6) Apply ⊔-rule to (4): (Person(a) ⊓ Staff(a)) ⊔ (Person(a) ⊓ Student(a))
(7) Apply ⊔-rule to (6): (Person(a) ⊓ Staff(a))
(8) Apply ⊔-rule to (6): (Person(a) ⊓ Student(a))
closed path (9) Apply ⊓-rule to (7): Person(a)
(10) Apply ⊓-rule to (7): Staff(a)
(11) Apply ⊔-rule to (8): Person(a)
(12) Apply ⊔-rule to (8): Student(a)
No more rules can be applied – the tableaux is fully expanded and closed. Therefore, the
original theorem is proved.
Advantages and disadvantages of description logics
Advantages:
 The two inference tasks in DLs, subsumption (i.e. checking if one category is a
subset of another based on their descriptions) and classification (i.e. checking if
an object belongs to a category) have polynomial complexity. Some DLs may
include also consistency checking, i.e. whether a category definition is
satisfiable.
 DLs have clear semantics, which makes them a good KR formalism for
applications with large declarative component. The Semantic Web language
OWL is build upon DLs.
Disadvantages:
 Polynomial inference is assured by the definitions of categories. If they are small
and correctly defined, then the inference tasks are easy to carry out. But, if
categories are hard to define in a concise manner, then their descriptions may
become (exponentially) large.
 Weak inference capabilities (to preserve decidability), which cannot handle
imprecisely specified concepts and not fully enforced relations between them.