Title: Alternative representations: Semantic networks
1Alternative 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
husband-of - wife-of
-
wife-of - husband-of
- mother-of
father-of
mother-of -
wife-of
father-of -
-
husband-of -
mother-of
father-of - Note that only binary relationships can be
represented in this model.
Ann
Carol
David
Bill
Tom
Susan
John
2- 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 - A very simple execution model.
- Very readable representation, which makes it easy
to visualize inference steps.
3Inference in semantic networks.
- The inference procedure in semantic nets is
called inheritance, and it allows - one nodes 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.
4Multiple 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
IS-A -
IS-A IS-A -
- The resulting conflict can be resolved only if
additional information stating a preference to - one of the conflicting inferences is provided.
Pacifists
Republicans
Quakers
Nixon
5Object-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.
6Object-attribute-value triples (example contd)
- Object Attribute
Value - Airplane NumberOfEngines
2 - Airplane NumberOfEngines
3 - Airplane NumberOfEngines
4 - Airplane TypeOfEngines
Jet - Airplane TypeOfEngines
Propeller - Airplane TypeOfWings
Conventional - Airplane TypeOfWings
SweptBack - Or, as predicates
- NumberOfEngines (Airplane, 2),
- TypeOfEngines (Airline, Jet),
- TypeOfWings (Airlines, Propeller),
7Problems 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 1010 neurons,
and 1015 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.
8Frames (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
objects 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 ones
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.
9 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.
10Description 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) ltgt 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.
11General 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)
12ALC (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)))
13ALC 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.
14ALC 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 )
15More 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.
16Questions 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 Wangs algorithm (called here
tableaux extension rules)
17Tableaux 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 -
-- ?-Rules (A
B) gt A, B - Example
?(A ? B) gt ?A, ?B -
?(A ? B) gt A, ?B - (A B C) ? (D ?A) ? (B ?D)
-- ?-Rules A - ?-rule
A ? B -
B - (A B C) (D ?A) ? (B ?D)
?A - ?-rule ?-rule
?(A B)
-
?B - A (D ?A) (B
?D)
?A -
A ? B - B D
B
B -
-- Double
negation rule ??A gt A - C ?A
?D -- ?True gt False,
?False gt True
18Tableaux Algorithm for ALC
- Step 1 Translate the DL KB to a negation normal
form (NNF) using the following transformations - Substitute C ? D by C ? D and D ? C
- Substitute C ? D by ?C ? D
- Apply all possible NNF transformations to complex
classes - NNF (? ?C) ? NNF (C)
- NNF (C ? D) ? NNF (C) ? NNF (D)
- NNF (C ? D) ? NNF (C) ? NNF (D)
- NNF (?(C ? D)) ? NNF (?C) ? NNF (?D)
- NNF (?(C ? D)) ? NNF (?C) ? NNF (?D)
- NNF (? R . C) ? (? R) . NNF (C)
- NNF (? R . C) ? (? R) . NNF (C)
- NNF (?? R . C) ? (? R) . NNF (?C)
- NNF (?? R . C) ? (? R) . NNF (?C)
19Tableaux 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.
20Example
- 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. -
21Example step 3 (contd.)
- 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 - Apply ?-rule to (1) ? Person(a)
closed
path - ?Professor(a) ? (Person(a) ? Staff(a)) ?
(Person(a) ? ?Student(a)) - 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.
22Advantages 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.
23Subsumption example
- Given the following KB
- Woman ? Person ? Female
- Man ? Person ? ?Woman
- Mother ? Woman ? ?hasChild . Person
- Father ? Man ? ?hasChild . Person
- Parent ? Mother ? Father
- Grandmother ? Woman ? ?hasChild .
Parent - Prove Grandmother ? Person.
- 1. Negate the goal and add it to the KB,
i.e. add (Grandmother ? ?Person). - 2. Translate the KB into the negation
normal form - i.) substitute A ? B with A ? B and B ?
A - Woman ? Person ? Female
Person ? Female ? Woman - Man ? Person ? ?Woman
Person ? ?Woman ? Man - Mother ? Woman ? ?hasChild . Person
Woman ? ?hasChild . Person ? Mother - Father ? Man ? ?hasChild . Person
Man ? ?hasChild . Person ? Father - Parent ? Mother ? Father
Mother ? Father ? Parent - Grandmother ? Woman ? ?hasChild.Parent Woman ?
?hasChild.Parent ? Grandmother
24Subsumption example (contd.)
- ii.) substitute A ? B with ?A ? B and then
apply all possible transformations to - complex classes to bring negation down
to atomic classes (see Lecture 7) - ?Woman ? (Person ? Female)
- ?(Person ? Female) ? Woman ? ?Person ? ?Female ?
Woman - ?Man ? (Person ? ?Woman)
- ? (Person ? ?Woman) ? Man ? ?Person ? Female ?
Man - ?Mother ? (Woman ? ?hasChild . Person)
- ? (Woman ? ?hasChild . Person) ? Mother ? ?Woman
? ?hasChild.Parent ? Mother - ?Father ? (Man ? ?hasChild . Person)
- ? (Man ? ?hasChild . Person) ? Father ? ?Man ?
?hasChild.Parent ? Father - ?Parent ? (Mother ? Father) ? ?Parent ? Mother ?
Father - ? (Mother ? Father) ? Parent ? (?Mother ?
?Father) ? Parent - ?Grandmother ? (Woman ? ?hasChild.Parent)
- ?(Woman ? ?hasChild.Parent) ? Grandmother ?
-
?Woman ? ?hasChild.Parent ?
Grandmother -
25The (beginning of the) proof
- Grandmother(a) ? ?Person(a) An individual a
for whom we are disproving the -
theorem. - (2) Apply ?-rule to (1) Grandmother(a)
- (3) Apply ?-rule to (1) ?Person(a)
closed path - (4) ?Grandmother ? (Woman ? ?hasChild.Parent)
- (5) Apply ?-rule to (4) ?Grandmother(a)
- (6) Apply ?-rule to (4) Woman
? ?hasChild.Parent - (7) Apply ?-rule to (6)
Woman(a) - (8) Apply ?-rule to (6)
?hasChild.Parent - (9) ?Woman ? (Person ? Female)
closed path - (10) Apply ?-rule
to (9) ?Woman(a) - (11) Apply ?-rule
to (9) Person ? Female closed path - (12) Apply ?-rule
to (11) Person(a) - (12) Apply ?-rule
to (11) Female(a) - (13) ?Person ?
?Female ? Woman
all three paths - (14)
Apply ?-rule to (13) ?Person(a)
are closed - (14)
Apply ?-rule to (13) ?Female(a) - (14)
Apply ?-rule to (13) Woman(a)
26Other reasoning tasks
- Note the tableau above is not fully expanded.
There are more formulas that can be transformed
by means of ?-rule, ?-rule, ?-rule and ?-rule. To
prove the original goal, we must show that all
paths of the fully expanded tableau are closed.
Although fully mechanical, this process is very
tedious for a human automated theorem provers
like Pellet and Fact (both employed in Protégé)
do a much better job. - The classification task can be reduced to
inconsistency checking as well. To prove that
individual x is a member of class A, we can
prove that ?A(x) is inconsistent instead. To find
all members of a class (task called instance
generation/retrieval), we must show ?A(x) for all
x. - To prove that a class A is inconsistent (i.e. has
no members), we can add A(x) to the KB and show
that the resulting set is inconsistent (i.e.
assume that there is a member x ? A and proof a
contradiction). - To prove A ? B (class disjointness), we can prove
that adding A ? B to the KB makes it
inconsistent.
27Inconsistency example
- Consider the following KB
- Bear ? Animal ? Omnivore
- Omnivore ? ?eat . Animal
- Panda ? Bear ? Vegetarian
- Vegetarian ? ?eat . ?Animal
- It is easy to see that this KB is inconsistent.
Assume that there exists an individual x which is
a member of the class Panda. Then - Panda(x) ? Bear(x) AND
Vegetarian(x) - Vegetarian(x) ? x does not
eat animals - Bear(x) ? Animal(x) AND
Omnivore(x) Contradiction, - Omnivore(x) ? x eats
animals therefore
class -
Panda must be empty. - Note reasoning over defined classes ONLY!