Python class ( Prolog ) ???

Joseph A. Knapka jknapka at earthlink.net
Thu Sep 5 17:57:20 EDT 2002


> Luis wrote:
> 
> Does anyone have a class that provides the functionality of prolog ???

There's a SourceForge project that enables you to call
GNUProlog from Python:

<URL: http://bedevere.sourceforge.net/>

I've seen a similar product for SWI Prolog as well, but the
reference escapes me at present.

It would be possible to implement a Prolog-like inference
engine in Python, but it would be rather slow compared to
genuine Prolog. Of course, for simple things that might
not be a problem. I have a Prolog-like unifier written in
Python lying around somewhere, which I'll track down
and post if you're interested. It's not a complete
inference engine, just the unification piece, but
once you've got that building a simple resolver
is not too difficult. If you want to implement cut, or
things with side effects, it may get a bit hairy.

Cheers,

-- Joe
  "I'd rather chew my leg off than maintain Java code, which
   sucks, 'cause I have a lot of Java code to maintain and
   the leg surgery is starting to get expensive." - Me



More information about the Python-list mailing list