11-711: Nyberg's Lecture Notes

file:/afs/cs/project/cmt-55/lti/Courses/711/html/index.html



FrameKit (Nyberg, 1988)

FrameKit is a compact, easily-extensible frame-based knowledge representation language, written in Common Lisp.

Features

  • Frames
  • Slots
  • Views
  • Fillers
  • Relations
  • Inheritance (BFS, DFS, User-defined)
  • Restrictions
  • Default values
  • Demons (IF-ADDED, IF-NEEDED, IF-ACCESSED, IF-ERASED)

BNF for FrameKit Syntax

<frame>  ::= (<name> <slot>*)
<slot>   ::= (<name> <facet>*)
<facet>  ::= (<name> <view>*) | <pre-defined-facet>
<view>   ::= (<name> <filler>*)
<filler> ::= <value>* | <demon>* | <predicate>*
<name>   ::= any CommonLisp symbol
<value>  ::= any CommonLisp expression; generally a symbol
             or number

<demon>  ::= a CommonLisp expression; generally a function
             call that produces side-effects when evaluated

<predicate> ::= a CommonLisp expression; evaluates to
                true or false (non-NIL or NIL)

<pre-defined-facet> ::=
             (VALUE <view>*) |  
             (IF-ADDED <view>*) |
             (IF-NEEDED <view>*) |
             (IF-ERASED <view>*) |
             (IF-ACCESSED <view>*) |
             (RESTRICTIONS <view>*) |
             (DEFAULT <view>*)

Example Frame Creation

* (make-frame 
    cmu
     (is-a (value (common university non-profit-institution)))
     (location (city (common pittsburgh))
               (state (common pa))
               (country (common usa))))
CMU

Demons

* (make-frame
    vehicle
     (fuel (value))
     (mpg  (value (common 50)))
     (cruising-range (value)))
VEHICLE 

* (add-filler 'vehicle 'fuel 'if-added
    '(update-cruising-range !frame !filler))
T
* (add-value 'vehicle 'fuel 5 :demons t)
T
* (get-values 'vehicle 'cruising-range)
(250)

Relations

* (make-frame
    father-of
     (instance-of (value (common relation)))
     (inverse (value (common father))))
FATHER-OF
* (make-frame ken)
KEN
* (make-frame rudy)
RUDY
* (add-value 'ken 'father-of 'rudy)
T
* (get-values 'ken 'father-of)
(RUDY)
* (get-values 'rudy 'father)
(KEN)

Inheritance

* (make-frame
    car
     (wheels (value (common 4))))
CAR
* (make-frame
    toyota
     (instance-of (value (common car))))
TOYOTA
* (get-values 'toyota 'wheels :inherit t)
(4)

13-Nov-96 by ehn@cs.cmu.edu