chapter 10 knowledge representation
DESCRIPTION
Chapter 10 Knowledge Representation. KR. previous chapters: syntax, semantics, and proof theory of propositional and first-order logic Chapter 10: what content to put into an agent’s KB How to represent knowledge of the world. Natural Kinds. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/1.jpg)
1
Chapter 10Knowledge Representation
![Page 2: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/2.jpg)
2
KR
• previous chapters: syntax, semantics, and proof theory of propositional and first-order logic
• Chapter 10: what content to put into an agent’s KB
• How to represent knowledge of the world
![Page 3: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/3.jpg)
3
Natural Kinds
• Some categories have strict definitions (triangles, squares, etc)
• Natural kinds don’t• Define a cup (distinguishing it from
bowls, mugs, glasses, etc)• Bachelor: is the Pope a bachelor?• But logical treatment can be useful (can
extend with typicality, uncertainty, fuzziness)
![Page 4: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/4.jpg)
4
Upper Ontologies
• An ontology is similar to a dictionary but with greater detail and structure
• Ontology: concepts, relations, axioms that formalize a field of interest
• Upper ontology: only concepts that are meta, generic, abstract; cover a broad range of domain areas
![Page 5: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/5.jpg)
5
AnythingAbstractObjects GeneralizedEvents
Sets Numbers RepresentationalObjects Interval Places PhysicalObjects Processes
Categories Sentences Measurements Moments things stuff
times weights animals agents solid liquid gas
Lower concepts are specializations of their parents
![Page 6: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/6.jpg)
6
Categories and Objects
• I want to marry a Swedish woman– Category of Swedish woman?– A particular woman who is Swedish?
• Choices for representing categories: predicates or reified objects
• basketball(b) vs member(b,basketballs)
• Let’s go with the reified version…
![Page 7: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/7.jpg)
7
Facts about categories and objects in FOL
• An object is a member of a category• A category is a subclass of another
category• All members of a category have some
properties• Members of a category can be
recognized by some properties• A category as a whole has some
propertiesNecessary versus sufficient properties?Note: simplification of real categories
![Page 8: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/8.jpg)
8
Other Relationships
• disjoint (no members in common)• exhaustive decomposition of a
category (all members are in at least one of the sets)
• Partition: disjoint, exhaustive decomposition
![Page 9: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/9.jpg)
9
Composite Objects
• partof(england,europe)• All X,Y,Z partof(X,Y) ^ partof(Y,Z)
partof(X,Z)• Heavy(bunchOf({apple1,apple2,apple3}
))• Before continuing: inspiration for
creative reification!• From Through the Looking Glass
![Page 10: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/10.jpg)
10
Measures
• Diameter(basketball12) = inches(9.5)• All XY member(X,dimestore) ^ sells(X,Y)
cost(Y) = $(1)• member(db1,dollarbills)• member(db2,dollarbills)• denomination(db1) = $(1) • denomination(db2) = $(1)There are multiple dollar bills, but a single
$(1)
![Page 11: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/11.jpg)
11
Ordinal Comparisons
• But often scales are not so precisely defined
• Often, ordinal comparisons among members of categories are useful
• member(p1,poems) ^ member(p2,poems) ^ beauty(p1) < beauty(p2)
We don’t have to say p1 has beauty 54.321Qualitative physics: reasoning about
physical systems without detailed equations and numerical simulations.
![Page 12: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/12.jpg)
12
Stuff versus Things
• Suppose some ice cream and a cat in front of you. There is one cat, but no obvious number of ice-cream things in front of you.
• A piece of an ice-cream thing is an ice-cream thing (until you get down to very low level)
• A piece of a cat is not a cat
![Page 13: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/13.jpg)
13
Stuff versus Things
• Linguistically distinguished, in English through mass versus count noun phrases
• “a cat”• “an ice-cream” (you have to coerce this
to a thing, such as an ice-cream bar, or a variety of ice cream)
• “a sand”, “an energy”• “some cat” (you have to coerce this to a
substance; eeewww)
![Page 14: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/14.jpg)
14
Actions, Situations, and Events
The Situation Calculus• The robot is in the kitchen.
– in(robot,kitchen)• It walks into the living room.
– in(robot,livingRoom)• Oops…• in(robot,kitchen,2:02pm)• in(robot,livingRoom,2:17pm)• But what if you are not sure when it was? • We can do something simpler than rely
on time stamps…
![Page 15: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/15.jpg)
15
Situation Calculus Ontology
• Actions: terms, such as “forward” and “turn(right))”
• Situations: terms; initial situation s0 and all situations that are generating by applying an action to a situation. result(a,s) names the situation resulting when action a is done in situation s.
![Page 16: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/16.jpg)
16
Situation Calculus Ontology continued
• Fluents: functions and predicates that vary from one situation to the next. By convention, the situation is the last argument of the fluent. ~holding(robot,gold,s0)
• Atemporal or eternal predicates and functions do not change from situation to situation. gold(g1). lastName(wumpus,smith). adjacent(livingRoom,kitchen).
![Page 17: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/17.jpg)
17
Sequences of Actions
• Also useful to reason about action sequences
• All S resultSeq([],S) = S• All A,Se,S resultSeq([A|Se],S) =
resultSeq(Se,result(A,S))resultSeq([a,b,a2,a3],so) is
result(a3,result(a2,result(b,result(a,s0)
![Page 18: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/18.jpg)
18
Modified Wumpus World
• Fluent predicates: at(O,X,S) and holding(O,S)
• Initial situation: at(agent,[1,1],s0) ^ at(g1,[1,2],s0)
• But we want to exclude possibilities from the initial situation too…
![Page 19: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/19.jpg)
19
Initial KB
• All O,X at(O,X,s0) [O=agent ^ X = [1,1]) v (O=g1 ^ X = [1,2])]
• All O ~holding(O,s0)• Eternals:
– gold(g1) ^ adjacent([1,1],[1,2]) ^ adjacent([1,2],[1,1]).
![Page 20: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/20.jpg)
20
Goal: g1 is in [1,1]
At(g1,[1,1],resultSeq( [go([1,1],[1,2]),grab(g1),go([1,2],[1,1])], s0)Or, planning by answering the query: Exists S at(g1,[1,1],resultSeq(S,s0))
So, what has to go in the KB for such queries to be answered?...
![Page 21: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/21.jpg)
21
Possibility and Effect Axioms
• Possibility axioms: – Preconditions poss(A,S)
• Effect axioms:– poss(A,S) changes that result from
that action
![Page 22: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/22.jpg)
22
Axioms for our Wumpus World
• For brevity: we will omit universal quantifies that range over entire sentence. S ranges over situations, A ranges over actions, O over objects (including agents), G over gold, and X,Y,Z over locations.
![Page 23: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/23.jpg)
23
Possibility Axioms
• The possibility axioms that an agent can – go between adjacent locations, – grab a piece of gold in the current
location, and – release gold it is holding
![Page 24: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/24.jpg)
24
Effect Axioms
• If an action is possible, then certain fluents will hold in the situation that results from executing the action– Going from X to Y results in being at Y– Grabbing the gold results in holding the
gold– Releasing the gold results in not
holding it
![Page 25: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/25.jpg)
25
Frame Problem
• We run into the frame problem• Effect axioms say what changes,
but don’t say what stays the same• A real problem, because (in a non-
toy domain), each action affects only a tiny fraction of all fluents
![Page 26: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/26.jpg)
26
Frame
• A data structure• Knowledge about an object or
concept• Natural way for concise
representation of knowledge• Organizes knowledge into a set of
slots
![Page 27: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/27.jpg)
27
Frame Problem (continued)
• One solution approach is writing explicit frame axioms, such as:
At(O,X,S) ^ ~(O=agent) ^ ~holding(O,S) at(O,X,result(Go(Y,Z),S))
• With F fluent predicates and A actions, need O(AF) frame axioms
• But if an action has at most E effects, then need only O(AE).
![Page 28: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/28.jpg)
28
Representational Frame Problem
• What stays the same?• A actions, F fluents, and E
effects/action (worst case). Typically, E << F
• Want O(AE) versus O(AF) solution
![Page 29: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/29.jpg)
29
Solving the Representational Frame
Problem• Instead of writing the effects of each
action, consider how each fluent predicate evolves over time
• Successor-state axioms:• Action is possible
(fluent is true in result state action’s effect made it true v it was true before and action left it alone)
![Page 30: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/30.jpg)
30
Ramification Problem
• Implicit effects, such as: if an agent moves from X to Y, then any gold it is carrying will move too
• For our specific domain, we can solve this by writing a more general successor-state axiom for “at”
![Page 31: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/31.jpg)
31
Initial KB (reminder)
• All O,X at(O,S,s0) [O=agent ^ X = [1,1]) v (O=g1 ^ X = [1,2])]
• All O ~holding(O,s0)• Eternals:
– gold(g1) ^ adjacent([1,1],[1,2]) ^ adjacent([1,2],[1,1]).
![Page 32: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/32.jpg)
32
Qualification Problem
• Ensuring that all necessary conditions for an action’s success have been specified. No complete solution.
![Page 33: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/33.jpg)
33
Inheritance
• If a property is true of a class, it is true of all subclasses of that class
• If a property is true of a class, it is true of all objects that are members of that class
• (If a property is true of a class, it is true of all objects that are members of subclasses of that class)
• There are exceptions
![Page 34: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/34.jpg)
34
Semantic Networks
• Graphical aids for visualizing the knowledge base
• Efficient algorithms for inferring properties based on category membership
• Often, correspond to a subset of first-order logic
• Many variants• All distinguish among individual objects,
categories of objects and relations among objects
![Page 35: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/35.jpg)
35
Mammals
Persons
Female Male
Mary John
SubsetOf
SubsetOf SubsetOf
MemberOf MemberOf
SisterOf
Legs
2
Legs
1
HasMother
![Page 36: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/36.jpg)
36
Example
• See previous slide• Specify what edges and nodes mean• In previous slide, indivs and categories
look the same• memberOf(indiv,category)• sisterOf(indiv,indiv)• subsetOf(category,category)• hasMother(indiv,indiv)
![Page 37: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/37.jpg)
37
Semantic Networks
• How about hasMother(persons,femalePersons)?
• Nope: hasMother is a relation between individuals
• cat1-- label cat2 means:• all X X in cat1 [all Y label(X,Y) Y in
cat2](So, this does not say that each person
has a mother)
![Page 38: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/38.jpg)
38
Semantic Networks
• cat – label value• All X X in cat label(X,value)
![Page 39: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/39.jpg)
39
Inheritance
• Inheritance is efficient and convenient
• Trace paths from individuals to categories, inheriting properties as you go
• In Example slide, how many legs does John have? Most specific (nearest) information wins
![Page 40: Chapter 10 Knowledge Representation](https://reader033.vdocuments.net/reader033/viewer/2022061502/56813be2550346895da50f4d/html5/thumbnails/40.jpg)
40
Semantic Networks
• In a semantic network, only binary relations are possible
• A richer representation is possible by reifying propositions and events
• This forces creation of a rich ontology of reified concepts; many current ideas originated in semantic network systems