Lab 22: Rule Based Systems
- Get Clips running. It's on
http://clipsrules.sourceforge.net. Go to download;
I got clips_windows_executables_630.zip, and extracted
CLIPSIDE32.exe.
- Run that, and you get the clips shell.
- Assert some facts (assert (duck)) (facts)
- Make some rules. Open up a file, (defrule bob (duck) =>
(assert (chicken))). Load it in, run.
- Now make some assertions that define a hierarchy of mammals.
You can do it in a variety of ways, but I used facts that looked
like (ISA canine mammal).
- Make sure that you have some grand-children nodes, like (ISA wolf
canine).
- Make a rule which expands the ISA relation. In my case it added the
fact (ISA wolf mammal).
- Now add some feature facts. For example (feature blood mammal warm).
Only add them in the appropriate place in the hierarchy. (IE don't
also say (feature blood canine warm).
- Now add a rule which exploits the ISA relations to put these
facts in.
- If you haven't already done so, add an initial rule that puts your
basic facts in the system, reset and see what you get. You should
also save your rules into a .clp file, clear, reset, load the file,
and run and see what you get.
- Now implement overriding inheritence. For instance, by default
mammals travel by walking, but bats do not. I did this by
modifying my feature inheritence rule.
- Now add enough nodes so that it expands to over 100 facts. (I did
it with 20 facts, but I'm sure I could have used less.)
- Can you implement any other interesting rules like one that only
prints out the facts for one type animal, or prints out all
the subclasses of an animal?