CS 8520: Artificial Intelligence

65
1 CSC 8520 Spring 2010. Paula Matuszek Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt CS 8520: Artificial Intelligence Knowledge Representation Paula Matuszek Spring, 2010

description

CS 8520: Artificial Intelligence. Knowledge Representation Paula Matuszek Spring, 2010. Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt. CSC 8520 Spring 2010. Paula Matuszek. Introduction. Knowledge Representation means: - PowerPoint PPT Presentation

Transcript of CS 8520: Artificial Intelligence

Page 1: CS 8520:  Artificial Intelligence

1CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

CS 8520: Artificial Intelligence

Knowledge Representation

Paula Matuszek

Spring, 2010

Page 2: CS 8520:  Artificial Intelligence

2CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Introduction• Knowledge Representation means:

– Capturing human knowledge– In a form computer can reason about

• Why?– Model human cognition– Add power to search-based methods

• Actually a component of all software development

Page 3: CS 8520:  Artificial Intelligence

3CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

KR Introduction• General problem in Computer Science• Solutions = Data Structures

– words, arrays– records– lists, queues– objects

• More specific problem in AI• Solutions = knowledge structures

– decision trees– logic and predicate calculus– rules: production systems– description logics, semantic nets, frames– scripts– ontologies

Page 4: CS 8520:  Artificial Intelligence

4CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

We’ve been here before!• Informed search:

– a heuristic for informed search is adding knowledge

• Constraint satisfaction– heuristics for choosing which constraint next

• Logical agents:– FOL is one of the oldest forms of knowledge

representation in AI

• etc

Page 5: CS 8520:  Artificial Intelligence

5CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Characteristics of a good KR:• It should

– Be able to represent the knowledge important to the problem– Reflect the structure of knowledge in the domain

• Otherwise our development is a constant process of distorting things to make them fit.

– Capture knowledge at the appropriate level of granularity– Support incremental, iterative development

• It should not– Be too difficult to reason about– Require that more knowledge be represented than is needed

to solve the problem

Page 6: CS 8520:  Artificial Intelligence

6CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Kinds of Knowledge

• Objects– Descriptions– Classifications

• Events– Time sequence– Cause and effect

• Relationships– Among objects– Between objects and events

• Meta-knowledge

Things we need to talk about and reason about; what do we know?

Distinguish between knowledge and its representation•Mappings are not one-to-one•Never get it complete or exactly right

Page 7: CS 8520:  Artificial Intelligence

7CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Representation Mappings

• Knowledge Level

• Symbol Level

• Mappings are not one-to-one

• Never get it complete or exactly right

Internal Representation

English Representation

Facts

Reasoning Programs

7

Page 8: CS 8520:  Artificial Intelligence

8CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Knowledge engineering!• Modeling the “right” conditions and the “right” effects

at the “right” level of abstraction is very difficult• Knowledge engineering (creating and maintaining

knowledge bases for intelligent reasoning) is an entire field of investigation

• Many researchers hope that automated knowledge acquisition and machine learning tools can fill the gap:– Our intelligent systems should be able to learn about the

conditions and effects, just like we do!– Our intelligent systems should be able to learn when to pay

attention to, or reason about, certain aspects of processes, depending on the context!

Page 9: CS 8520:  Artificial Intelligence

9CSC 8520 Spring 2010. Paula Matuszek

Slides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Kinds of KR• decision trees• logic and predicate calculus• rules: production systems• description logics, semantic nets,

frames• scripts• ontologies

Page 10: CS 8520:  Artificial Intelligence

10

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Decision Trees• Knowledge captured as a series of

questions and responses or decisions and outcomes

• Common in troubleshooting manuals, medical domains, etc.

• Well-known example: Animals

• Often a binary tree, but doesn’t need to be

Page 11: CS 8520:  Artificial Intelligence

11

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Decision Trees• Example: Guessing an animal• Is your animal a mammal?

– Yes: Is your animal a pet?• Yes: Your animal is a cat• No: Your animal is a lion.

– No: Is your animal bigger than a breadbox?• Yes: Your animal is a bear• No: Your animal is a mouse.

Page 12: CS 8520:  Artificial Intelligence

12

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Decision Trees• Decision trees are relatively simple

representations leading to a single conclusion or action

• Nodes represent questions/tests/decisions

• Arcs represent answers/results

• Often but not necessarily binary

• Familiar in troubleshooting, biological keys, etc.

Page 13: CS 8520:  Artificial Intelligence

13

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Decision Trees: Advantages• Easy to implement. We know a lot about trees in

computer science.

• Explanations and the inference process are very clearcut and easy to explain

• Easy to get started. Don’t require excessive knowledge

• For simple problems, may reflect well the problem domain.

• Fast to do inference: it’s just a tree walker

• Easy to “learn”

Page 14: CS 8520:  Artificial Intelligence

14

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Decision Trees: Disadvantages• Decision trees reflect a semi-procedural view of

expertise which is often not a good match to a domain– Difficult to modify

– Difficult to maintain “tree” shape, even if you allow multiple inheritance

• Intermediate state of a problem is only captured implicitly.

• Often very difficult to elicit from expert

• Don’t scale well. Large decision trees are very hard to maintain and debug.

• Gives an illusion of structure which doesn’t actually reflect the domain

Page 15: CS 8520:  Artificial Intelligence

15

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Logic and Predicate Calculus

• We have already discussed this at length in conjunction with logical agents

• Very rich representation

• For big real-world problems has some significant issues:– very bushy inference– does not match human expert thinking very well

• excluded middle

• No good choice for “don’t know”

Page 16: CS 8520:  Artificial Intelligence

16

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Production Rules• Common formalism in expert systems

• Knowledge is represented as if-then rules:– if <condition> (LHS, left hand side)– then <action> (RHS, right hand side)

• If car won’t start, – then see if battery is dead.

• If a person is a student, – then a person has an ID card.

Page 17: CS 8520:  Artificial Intelligence

17

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Rules Continued• LHS may be a test, an observation, a

symptom, an already-known fact. – If the printer won’t print

– If power test is passed

– If strep diagnosed

• RHS may be a new fact to be asserted, an action to take, a message– Then see if it has power

– Then assert (power, yes)

– Then give antibiotics

Page 18: CS 8520:  Artificial Intelligence

18

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Inference with rules• Production rules systems typically have

three components:– the knowledge base or KB (the rules)– the fact base (details for this instance)– the inference engine (application which uses

rules)

• Inference engine repeatedly applies rules from the KB to create additional facts until a stopping point is reached

Page 19: CS 8520:  Artificial Intelligence

19

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Inference Engines• May be forward-chaining, backward-

chaining, mixed.

• In either case:– find rules which can be applied, add to agenda– pick a rule from the agenda and fire it, updating

KB

• Conflict resolution is method of choosing rule from among those on agenda– recency, specificity, explicit priority

Page 20: CS 8520:  Artificial Intelligence

20

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Some additional issues• Non-monotonicity. A rule may retract a

fact.– eg: If printer(unplugged), then plug it in and

retract printer(unplugged

• Truth maintenance. Rules on the agenda may no longer “belong there”.

• Uncertainty

Page 21: CS 8520:  Artificial Intelligence

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Evaluation of Rule-based Inference• Advantages

– Relatively fast– Captures natural human patterns– Modular– Can capture uncertainty and non-monotonicity– Restricted syntax simplifies editors, learning, etc.

• Disadvantages– Neither sound nor complete– Requires conflict resolution– restricted syntax reduces expressiveness– System behaviour reliant on conflict resolution strategy– adding new rules may produce unusual effects under conflict

resolution

Page 22: CS 8520:  Artificial Intelligence

22

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Structured Knowledge Representations• Modeling-based representations reflect the

structure of the domain, and then reason based on the model.– Semantic Nets– Frames– Scripts

• Sometimes called associative networks

Page 23: CS 8520:  Artificial Intelligence

23

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Basics of Associative Networks

• All include – Concepts– Various kinds of links between concepts

• “has-part” or aggregation

• “is-a” or specialization

• More specialized depending on domain

• Typically also include– Inheritance– Some kind of procedural attachment

Page 24: CS 8520:  Artificial Intelligence

24

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Semantic Nets graphical representation for propositional information originally developed by M. R. Quillian as a model for

human memory labeled, directed graph nodes represent objects, concepts, or situations

labels indicate the name

nodes can be instances (individual objects) or classes (generic nodes)

links represent relationships the relationships contain the structural information of the

knowledge to be represented

the label indicates the type of the relationship

Page 25: CS 8520:  Artificial Intelligence

25

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Nodes and Arcs

• Arcs define binary relationships that hold between objects denoted by the nodes.

john 5Sue

age

mother

mother(john,sue)age(john,5)wife(sue,max)age(max,34)...

34

age

father

Max

wifehusband

age

Page 26: CS 8520:  Artificial Intelligence

26

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Semantic Networks• The ISA (is-a) or AKO (a-

kind-of) relation is often used to link instances to classes, classes to superclasses

• Some links (e.g. hasPart) are inherited along ISA paths.

• The semantics of a semantic net can be relatively informal or very formal– often defined at the

implementation level

isa

isa

isaisa

Robin

Bird

Animal

RedRusty

hasPart

Wing

Page 27: CS 8520:  Artificial Intelligence

27

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Individuals and Classes

• Many semantic networks distinguish–nodes representing individuals and those representing classes

–the “subclass” relation from the “instance-of” relation

subclass

subclass

instanceinstance

Robin

Bird

Animal

RedRusty

hasPart

Wing

instance

Genus

Page 28: CS 8520:  Artificial Intelligence

29

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Inference by Inheritance

• One of the main kinds of reasoning done in a semantic net is the inheritance of values along the subclass and instance links.

• Semantic networks differ in how they handle the case of inheriting multiple different values.– All possible values are inherited, or– Only the “lowest” value or values are

inherited

Page 29: CS 8520:  Artificial Intelligence

30

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Conflicting inherited values

Page 30: CS 8520:  Artificial Intelligence

31

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Multiple inheritance• A node can have any number of superclasses that

contain it, enabling a node to inherit properties from multiple “parent” nodes and their ancestors in the network.

• These rules are often used to determine inheritance in such “tangled” networks where multiple inheritance is allowed:– If X<A<B and both A and B have property P, then X

inherits A’s property.– If X<A and X<B but neither A<B nor B<Z, and A and

B have property P with different and inconsistent values, then X does not inherit property P at all.

Page 31: CS 8520:  Artificial Intelligence

32

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Nixon Diamond

• This was the classic example circa 1980.

Person

Republican

Person

Quaker

instanceinstance

subclasssubclass

FALSEpacifistTRUE pacifist

Page 32: CS 8520:  Artificial Intelligence

33

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

From Semantic Nets to Frames• Semantic networks morphed into Frame

Representation Languages in the ‘70s and ‘80s.

• A frame is a lot like the notion of an object in OOP, but has more meta-data.

• Represents related knowledge about a subject

• A frame has a set of slots.

• A slot represents a relation to another frame (or value).

• A slot has one or more facets.• A facet represents some aspect of the relation.

Page 33: CS 8520:  Artificial Intelligence

34

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Facets• A slot in a frame holds more than a value.

• Other facets might include:– current fillers (e.g., values)– default fillers– minimum and maximum number of fillers– type restriction on fillers (usually expressed as another frame

object)– attached procedures (if-needed, if-added, if-removed)– salience measure– attached constraints or axioms

• In some systems, the slots themselves are instances of frames.

Page 34: CS 8520:  Artificial Intelligence

35

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Page 35: CS 8520:  Artificial Intelligence

36

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Usage of Frames• filling slots in frames

– can inherit the value directly – can get a default value – these two are relatively inexpensive – can derive information through the attached

procedures (or methods) that also take advantage of current context (slot-specific heuristics)

– filling in slots also confirms that frame or script is appropriate for this particular situation

[Rogers 1999]

Page 36: CS 8520:  Artificial Intelligence

37

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Example Frame: Low-level frameObject This AI class

ISA AI class

Date Spring, 2009

Time 6:15-9PM Weds

Instructor Matuszek

Enrollment 8

Has_A ROSTER

Page 37: CS 8520:  Artificial Intelligence

38

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Frame Example: default frame

Object AI Class

ISA Class

Date

Time 6:15-9PM

Instructor IF-NEEDED: Ask departmentIF-ADDED: Update payroll

Enrollment Count ROSTER: Student-IDs

Has_A ROSTER

Page 38: CS 8520:  Artificial Intelligence

39

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Another Example: high-level frame

Object ROSTER

ISA Class Record

Enrollment Limit

25

Enrollment

Status Open

Student-IDs IF-ADDED Increment Filler(Enrollment) If Filler(Enrollment) = Filler(Enrollment Limit) Then Filler(Status) = Closed

IF-DROPPED …

Page 39: CS 8520:  Artificial Intelligence

40

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Frames vs Semantic Nets• Frames and nets capture comparable knowledge

• You can automatically transform a frame into a net and vice versa

• Differences are more in typical usage:– Semantic nets are normally considered as specifications, and do

not allow exceptions or defaults

– Frames are normally considered as typical descriptions; defaults and overrides are expected

• Nets typically distinguish strongly between classes and instances; frames typically do instantiation at the slot level and don’t have a clearcut distinction at the frame level

• Which is preferable depends on your domain!

Page 40: CS 8520:  Artificial Intelligence

41

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Description Logics• Description logics provide a family of frame-

like KR systems with a formal semantics.– E.g., KL-ONE, LOOM, Classic, …

• An additional kind of inference done by these systems is automatic classification– finding the right place in a hierarchy of objects for a

new description

• Current systems take care to keep the languages simple, so that all inference can be done in polynomial time (in the number of objects)– ensuring tractability of inference

Page 41: CS 8520:  Artificial Intelligence

42

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Description Logics

• Notations to make it easier to describe definitions and properties of categories

• Taxonomic structure is organizing principle

• Subsumption: Determine if one category is a subset of another

• Classification: Determine the category in which an object belongs

• Consistency: Determine if membership criteria are logically satisfiable

Page 42: CS 8520:  Artificial Intelligence

43

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Current Description Logic• DAML+OIL

– DARPA Agent Mark-up Language + Ontology Inference Language (OIL)

– Comes out of DARPA initiative

– OIL from University of Manchester

– http://www.w3.org/TR/daml+oil-reference

• OWL– Ontology Web Language

– A language for the semantic web

– “Next generation” DAML+OIL

– Flavors: OWL-Lite, OWL-DL and OWL (full)

– W3C recommendation as of Feb 10, 2004

– http://www.w3.org/TR/2004/REC-owl-features-20040210/

43

Page 43: CS 8520:  Artificial Intelligence

44

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Ontologies• structuring knowledge in a useful fashion

• An ontology formally represents concepts in a domain and relationships between those concepts

• The concept originated in philosophy; a model of a theory of nature or existence.

• An ontology describes the things we want to talk about, including both objects and relationships

Page 44: CS 8520:  Artificial Intelligence

45

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Upper Ontologies• Ultimate goal is to represent everything in

the world!!

• Result is an upper ontology

Anything/Root

AbstractObjects GeneralizedEvents

RepresentationalObjects

Categories

NumbersSets

Sentences

Places

Measurements

Interval

WeightsTimes

Processes

ThingsMoments

PhyscialObjects

Solid Liquid Gas

Stuff

Agents

Humans

Animals

Page 45: CS 8520:  Artificial Intelligence

46

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Special- and General-purpose Ontologies• Special-purpose ontology:

– Designed to represent a specific domain of knowledge;

• genetics (GO)• immune system (IMGT)• mathematics (Tom Gruber)

• General-purpose ontology:– Should be applicable in any special-purpose domain– Unifies different domains of knowledge

• Upper ontology provides highest level framework - all other concepts follow

Page 46: CS 8520:  Artificial Intelligence

47

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Cyc Upper Ontology• Cycorp released 3,000 upper-level concepts

into public domain

• Cyc Upper Ontology satisfies two important criteria;– It is universal: Every concept can be linked to it– It is articulate: Distinctions are necessary and

sufficient for most purposes

Page 47: CS 8520:  Artificial Intelligence

48

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Representation• Two choices for representation:

– Predicate• Basketball(b)

– Object• Basketballs

• Member(b, Basketballs)

• Subset(Basketballs, Balls)

Page 48: CS 8520:  Artificial Intelligence

49

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Organizing• Inheritance:

– All instances of the category Food are edible– Fruit is a subclass of Food– Apples is a subclass of Fruit– Therefore, Apples are edible

• The Class/Subclass relationships among Food, Fruit and Apples is a taxonomy

Page 49: CS 8520:  Artificial Intelligence

50

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Partitioning

• Disjoint: The categories have no members in common

• Exhaustive Decomposition: Every member of the category is included in at least one of the subcategories

• Partition: Disjoint exhaustive decomposition

50

Page 50: CS 8520:  Artificial Intelligence

51

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Partitioning

Disjoint({Animals,Vegetables})

51

Page 51: CS 8520:  Artificial Intelligence

52

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Partitioning

Disjoint({Animals,Vegetables})

Disjoint(s) <=> (∀c1,c2 c1∈s ∧ c2∈s ∧ c1≠c2 ⇒ Intersection(c1,c2) = {})

52

Page 52: CS 8520:  Artificial Intelligence

53

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Partitioning

Disjoint({Animals,Vegetables})

Disjoint(s) <=> (∀c1,c2 c1∈s ∧ c2∈s ∧ c1≠c2 ⇒ Intersection(c1,c2) = {})

ExhaustiveDecomposition({Americans,Canadians,Mexicans},NorthAmericans})

53

Page 53: CS 8520:  Artificial Intelligence

54

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Partitioning

Disjoint({Animals,Vegetables})

Disjoint(s) <=> (∀c1,c2 c1∈s ∧ c2∈s ∧ c1≠c2 ⇒ Intersection(c1,c2) = {})

ExhaustiveDecomposition({Americans,Canadians,Mexicans},NorthAmericans})

ExhaustiveDecomposition(s,c) ⇔ (∀i i∈c ⇔ ∃c2 c2∈s ∧ i∈c2)

54

Page 54: CS 8520:  Artificial Intelligence

55

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - Partitioning

Disjoint({Animals,Vegetables})

Disjoint(s) <=> (∀c1,c2 c1∈s ∧ c2∈s ∧ c1≠c2 ⇒ Intersection(c1,c2) = {})

ExhaustiveDecomposition({Americans,Canadians,Mexicans},NorthAmericans})

ExhaustiveDecomposition(s,c) ⇔ (∀i i∈c ⇔ ∃c2 c2∈s ∧ i∈c2)

Partition({Males,Females},Animals)

55

Page 55: CS 8520:  Artificial Intelligence

56

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - PartitioningDisjoint({Animals,Vegetables})

Disjoint(s) <=> (∀c1,c2 c1∈s ∧ c2∈s ∧ c1≠c2 ⇒ Intersection(c1,c2) = {})

ExhaustiveDecomposition({Americans,Canadians,Mexicans},NorthAmericans})

ExhaustiveDecomposition(s,c) ⇔ (∀i i∈c ⇔ ∃c2 c2∈s ∧ i∈c2)

Partition({Males,Females},Animals)

Parition(s,c) ⇔ Disjoint(s) ∧ ExhaustiveDecomposition(s,c)

Page 56: CS 8520:  Artificial Intelligence

57

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories - More

• PartOfPartOf(Bucharest,Romania)

PartOf(Romania,EasternEurope)

PartOf(EasternEurope,Europe)

PartOf(Europe,Earth)

• Composite ObjectsBiped(a) ⇒ ∃c1,c2,b Leg(c1) ∧ Leg(c2) ∧ Body(b)

∧ PartOf(c1,a) ∧ PartOf(c2,a) ∧ PartOf(b,a) ∧ Attached(c1,b) ∧ Attached(c2,b) ∧ c1≠c2 ∧ [∀c3 Leg(c3) ∧ PartOf(c3,a) ⇒ (c3=c1 ∨ c3=c2)]

Page 57: CS 8520:  Artificial Intelligence

58

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Categories – And More

• Count Nouns and Mass Nouns– How many aardvarks? How many butters!?!

• Intrinsic and Extrinsic Properties– Intrinsic properties belong to the very

substance of the object; e.g. flavor, color, density, boiling point, etc.

– Extrinsic properties change if the object is changed (cut in half); e.g. weight, length, shape, etc.

58

Page 58: CS 8520:  Artificial Intelligence

59

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Generalized Events• Combines aspects of space and time

calculus

• Allows representation of events occurring in a space-time continuum

World War II is an event that happened in various geographic locations during a specific period of time within the 20th century.

Page 59: CS 8520:  Artificial Intelligence

60

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Processes• Discrete Events: the event is a whole and a

part of the event is no longer the same event

• Processes can include subintervals; a part of a plane flight is still a member of the Flying class (aka liquid events)

• Stated more precisely: “Any subinterval of a process is also a member of the same process category.”

Page 60: CS 8520:  Artificial Intelligence

61

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Intervals

• Moment: has temporal duration of zero

• Extended Interval: has temporal duration of greater than zeroPartition({Moments,ExtendedIntervals},Intervals)

Member(i,Moments) ⇔ Duration(i) = Seconds(0).

Page 61: CS 8520:  Artificial Intelligence

62

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Intervals OntologyMeet(i,j) ⇔ Time(End(i)) = Time(Start(j)).

Before(i,j) ⇔ Time(End(i)) < Time(Start(j)).

After(j,i) ⇔ Before(i,j).

During(i,j) ⇔ Time(Start(j)) ≤ Time(Start(i)) ∧ Time(End(i)) ≤ Time(End(j)).

Overlap(i,j) ⇔ ∃k During(k,i) ∧ During(k,j).

Page 62: CS 8520:  Artificial Intelligence

63

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Mental Events and Mental Objects• Knowledge about beliefs, specifically about those

beliefs held by an agent– “Which agent knows about the geography of Maine?”

• Provides an agent the ability to reason about beliefs of agents

• However, need to define propositional attitudes, such as Believes, Knows and Wants as relations where the second argument is referentially opaque (no substitution of equal terms)

Page 63: CS 8520:  Artificial Intelligence

64

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Reasoning Systems for Categories• Categories are KR building blocks

• Two primary systems for reasoning:– Semantic Networks

• Graphical aids for visualizing knowledge

• Mechanisms for inferring properties of objects based on category membership

– Description Logics• Formal language for constructing and combining

category definitions

• Algorithms for classifying objects and determining subsumption relationships

Page 64: CS 8520:  Artificial Intelligence

65

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Reasoning with Default Information

• Open and Closed worlds– Open World: Information provided is not

assumed to be complete, therefore inferences may result in sentences whose truth value is unknown

– Closed World: Information provided is assumed complete, therefore ground sentences not asserted to be true are assumed false

– Negation as Failure: A negative literal, not P, can be “proved” true if the proof of P fails

Page 65: CS 8520:  Artificial Intelligence

66

CSC 8520 Spring 2010. Paula MatuszekSlides taken in part from Eric Eaton, http://www.csc.villanova.edu/~matuszek/fall2008/KnowledgeRepresentation.ppt

Knowledge Engineering• Actually capturing the information from the

human subject matter expert (SME) in any of these formats is difficult and time-consuming– An iterative process of add knowledge/test.

– Often a knowledge engineer or ontological engineer works with the SME

– “What is the system for?” is critical

• Automated learning of knowledge is a very active research field right now.