This post originated from an RSS feed registered with Python Buzz
by Ng Pheng Siong.
Original Post: Prolog In Smalltalk
Feed Title: (render-blog Ng Pheng Siong)
Feed URL: http://sandbox.rulemaker.net/ngps/rdf10_xml
Feed Description: Just another this here thing blog.
In a workspace, enter the above code, select and do it:
?- remove.
yes
?- einstein(Houses,FishOwner).
no
false
Ho-ho! Wrong answer! Look-see look-see... nope, I don't think I've
transcribed the Prolog wrongly. I removed the underscores in
next_to and Fish_Owner because the Smalltalk Prolog parser chokes on
them.
Be that as it may ;-) let's take a peek at the implementation
itself. It appears this particular Prolog uses operators like CAR,
CDR, CONSP, etc. in its implementation, i.e., this is a Prolog written
in Smalltalk using Lisp operators. Speculating wildly (I haven't
gone through the code) this implementation may even be based on Peter
Norvig's or Paul Graham's Common Lisp Prologs. If indeed so, it won't
be too difficult to make it give the correct answer to Einstein's
riddle, then.
Anyone looking for a programming project? Fixing this Prolog will give
you the triple whammy of doing Smalltalk, Prolog and Lisp in one shot!
On reflection, personally I wouldn't attempt to fix it. I'd do
this: figure out how the Smalltalk Lisp operators
work, then write some Common Lisp macros to walk an existing
known-good Prolog-in-Lisp and render it in Smalltalk. Worth a try...