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.
- Define classes Region, Country, City,
and Food.
Country and City should have Region
as a superclass.
- Define slots as follows:
- For Region, define population, area,
latitude, and longitude.
- For Country, define capital, language,
neighbors, and cities.
- For City, define food.
- For Food, define spicy.
- Define slot description fromes for population and
cities. Define the inverse slot name for cities,
and the domain, range, and cardinality for both.
- 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).
- For Country, define friends as countries that
have the same language. Define best-friends as countries
that are both friends and neighbors.
- For City, define country as a slot inverse.
Define interesting as having spicy food.
- 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.
- Try some KM queries on the knowledge you have encoded:
- What is the population of the USA?
- What are neighbors, friends, and best-friends of the USA?
- What is the population density of the USA?
- What is the maximum population of any city in the USA (that
you have defined) ?
- What is the city that has the maximum population?
- What are the interesting cities of some country?
- What is the country of Austin?
- What are the countries where the language is English?
- What are the countries where the population density is over
50 people per square km?