Title: KM
1KMs Inference Algorithm
- Peter Clark
- Knowledge Systems
- Boeing Math Computing Technology
2The Top-Level KM Algorithm
- An atomic value returns itself
- Otherwise, apply a set of rewrite rules to
decompose the expression - Decomposing a KM expression corresponds to
breaking up its equivalent logical expression
KM (the age of (the spouse of Pete)) -gt
find x, (the spouse of Pete) -gt find (the age of
x) LOGIC y spouse(Pete,x), age(x,y) -gt find
x in spouse(Pete,x) -gt find y in age(x,y)
- Eventually, decomposed to KMs basic operations
- If an instance changes, re-check its
classification
3The Top-Level KM Algorithm
PROCEDURE km(expr) -gt values If expr is an atomic
value, return expr Else REWRITES
PATTERN REWRITE AS (the slot of
expr) km(expr) -gt f, km(the slot of f) (allof
expr where test) km(expr) -gt set, return i in
set if km(test) (if test then expr) km(test)
-gt boolean, if boolean then km(expr)
... PRIMITIVES (instance has slotsvals)
Assert in KB (every class has slotsvals)
Assert in KB (a class has slotsvals)
Generate Skolem, then assert in KB (the slot of
frame) (frame1 frame2) (set1
set2) PROCEDURE classify(instance) If instances
properties change then check its classification
41. Computing the value of a slot
- Corresponds to
- find all the x where slot(instance,x) is true
- (or, can think of slot as a function on instance)
- Algorithm
- Collect all the information about instances slot
- local
- inherited
- Evaluate and combine that information
51. Computing the value of a slot
Person age (a Number)
Working on an individual clause PROCEDURE
(the slot of frame) -gt values 1. Find the set of
"local" values on frame's slot projection,
subslots, global situation 2. a. Find all the
classes of frame b. For each class, find the
set of values on the class's slot 3. Set-unify
the sets together km(set1 set2 ..)
For single-valued slots, do km(set1 set2
set3 ...) 4. a. Find the local and inherited
constraints on the slot b. Check and enforce
those constraints 5. Assert the resulting values
on the frame's slot 6. Return the final set of
values
Fred age 32
62. Unification (asserting equality)
- The syntactic process of merging two data
structures corresponds to the semantic process of
asserting equality - if x y, then
- all things true of x will be true of y, and vice
versa - so the data structure denoting things true of x
will also be part of the data structure denoting
things true of y, and vice versa
72. Unification (asserting equality)
PROCEDURE (frame1 frame2) -gt frame12 1. Choose
a name for the unified frame frame12 2. For the
slots used in frame1 and frame2 a. Find
the values vals1 of slot on frame1 b. Find
the values vals2 of slot on frame2 c.
Create a new structure (slot ((vals1 vals2)))
d. Find constraints on slot (in vals1,
vals2, and inherited) Check that vals1, vals2,
and (vals1 vals2) don't violate
constraints 3. Assemble these pieces together
(frame12 has (slot1 ((vals1 vals2)))
(slot2 ((vals1 vals2))) ...) 4. Assert it
in the KB 5. "Bind" frame1 and frame2 to frame12
Fred age 32 owns _Car1
_Person2 owns _Car2
Fred age 32 owns ((_Car1) (_Car2))
Binding List _Person2 -gt Fred
83. Set Unification
- Goal is to sensibly combine information from
different frames together - Can think of this as
- non-deductive inference step
- deductive based on an additional coreference
algorithm
93. Set Unification
PROCEDURE (set1 set2) -gt set12 1. For each
value v in set1 a. Find a value v' in set2 a.
whose classes are equal/generalization/specializat
ion of v's b. which can be consistently unified
with v b. If there is a v' then add (v
v') to set12, and remove v' from set2
else add v to set12 2. Add remaining values in
set2 to set12 3. Return set12
(_Cat1 _Dog1) ((a Cat) (a Dog)) -gt (_Cat1
_Dog1)
10The next level of detail
- Situations, projection
- Caching
- Explanation
- Automatic classification
- Text generation
- Defaults
- KB loading/saving/checking
- Loop detection
- Recursive calls
- Prototypes
11Further Reading
- The KM Manuals
- The KM Tutorial
- powerpoint
- Building Knowledge Bases from Reusable
Components AAAI97 - paper, describes an example of the interleaving
of backward chaining (path following) and
automatic classification - Using Access Paths to Guide Inference with
Conceptual Graphs, ICCS97 - paper and animated powerpoint. Describes KMs
top-level algorithm in detail, along with a
worked example. - The powerpoint gives an animation of this
inferencing in operation. - Short note on the implementation of situations
- technical note
All available at http//www.cs.utexas.edu/users/m
fkb/km.html