Debugging AI::Prolog

Ovid on 2005-02-28T19:50:34

Version 0.63 of AI::Prolog is sitting on my hard drive, but will likely not be uploaded soon. I've increased its math abilities and have cleaned up the internals, but have decided to stop pushing out code until I can track down a nasty bug. Specifically, the following three line program has issues:

i_am_at(bedroom).
up   :- i_am_at(X),retract(i_am_at(X)),assert(i_am_at(bedroom)).
down :- i_am_at(X),retract(i_am_at(X)),assert(i_am_at(bed)).

I load that into the shell and as soon as I issue the 'down' command, it tells me it 'Can't call method "clause" on an undefined value'. I've loaded it into SWI-Prolog just to be sure I wasn't missing something obvious, but it worked fine there, so now I have a minimal test case that causes a bug that I suspect has cropped up in a few other places.