Lab 10: Backward Chaining in Clips
The purpose of this workshop is to:
familiarise the student with backward chaining. This includes
implementing a system, but stretches on to criticism of the
implementation of backward chaining.
- There are three files directly involved in this exercise.
The downloading instructions are complex, so read them
carefully if you have a problem.
- First, get the monkeys
and bananas clips file that I wrote. You have to
save it or the clipboard viewer may try to open it.
- Have a look at this code. It's not complex.
- You may want to try and run it in the standard clips, but
be careful as it loops.
- Step through it (run 1) to see what happens.
- Unfortunately, clips does not have backward chaining built
in. So, I wrote a version that does backwards chaining.
It involves a modified version of the clips executable, and rules
that implement the chaining. If you're interested in how I
implemented it see
Huyck's Implementation of Backward Chaining in Clips.
- Download the clips exe with an x suffix.
Make sure you save it as something.exe (e.g. chrisclips.exe).
Unfortunately, my old server didn't allow downloading of executable
files, clips exe,
so I've just renamed it.
- Download the backchaining rules
you have to save it. It's best to put all the files in
the same directory.
- Now run the executable. It's a clips dialog window with no
- Load in the backchain and monkeys files (e.g. (load "monkeys.clp")).
- Now run it and you should get the backward chaining system working.
- To get the backward chaining working, you need to assert two things:
(assert (push goal "yourgoal" 0 0))
(assert (stacktop goal 0))
- The first is your goal, and the second makes the stack.
- Try to make your own goal directed system. Note that
subgoaling won't work with variables.
- Also note that I've just put this together myself. There may
be bugs in it. Please tell me if you find any.