CS 343: Knowledge Representation with Frames

Due: November 9, 2007.

In this assignment we will investigate representation in a frame representation and reasoning system, KM.

There is documentation for KM at: http://www.cs.utexas.edu/users/mfkb

For this assignment, you will need to use acl Lisp on Linux or Sparc workstations in the department. Use Emacs in shell mode, then submit your interaction as well as your KM code file.

M-x shell
acl
(load "km-2-1-8.lisp")
(load-kb "myfile.km")
(km)

KM> (the population of *USA)

Any error will turn on KM's debugger, which may be interesting but also produces a lot of printout. You can stop the switching on of the debugger with (setq *error-report-silent* t) to Lisp and (nocomments) to KM.

A starter file for this assignment is kmstart.km ; expand this file for your assignment.

  1. Define classes Region, Country, City, and Food. Country and City should have Region as a superclass.
  2. Define slots as follows:
  3. Define slot description fromes for population and cities. Define the inverse slot name for cities, and the domain, range, and cardinality for both.
  4. For Region, define a computed slot population-density (population per unit area). Note that KM requires you to use an "extra" level of parentheses around this infix expression (operator in the middle).
  5. For Country, define friends as countries that have the same language. Define best-friends as countries that are both friends and neighbors.
  6. For City, define country as a slot inverse. Define interesting as having spicy food.
  7. Put in some frames for each of the classes you have defined. You can get information about countries at: www.cia.gov under World Factbook.
  8. Try some KM queries on the knowledge you have encoded: