From: Pascal Saremsky
Subject: Prolog in Lisp
Date: 
Message-ID: <7u7bfi$nbm$1@newsmaster.cc.columbia.edu>
Does anyone know of a lisp package that provides a pretty good prolog
interpreter (or any logic inference engine) to be imbedded in and interact
with your Lisp code? Something like in Norvig's AI Programming book, but a
bit more complete?

PS. I use Common Lisp.

From: Robert Monfera
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <38074EBA.4560A354@fisec.com>
Not necessarily what you want: Harlequin's Knowledgeworks contains a
Prolog implementation atop of CL IIRC.  Maybe there are open source
alternatives?  Have you checked out www.alu.org? (Poplog comes with CL
and Prolog, but both of them are implemented atop of a virtual machine.)

Robert

Pascal Saremsky wrote:
> 
> Does anyone know of a lisp package that provides a pretty good prolog
> interpreter (or any logic inference engine) to be imbedded in and interact
> with your Lisp code? Something like in Norvig's AI Programming book, but a
> bit more complete?
> 
> PS. I use Common Lisp.
From: Espen Vestre
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <w69051ce93.fsf@wallace.nextel.no>
"Pascal Saremsky" <······@docdes.com> writes:

> Does anyone know of a lisp package that provides a pretty good prolog
> interpreter (or any logic inference engine) to be imbedded in and interact
> with your Lisp code? Something like in Norvig's AI Programming book, but a
> bit more complete?

The code in Norvigs book is actually quite usable for modest purposes.
I once (5-6 years ago) tried out the prolog that came with Harlequin 
Lispworks, but at least at that time (of course this may have changed!)
it wasn't any faster or more feature-rich than the most advanced version 
of the code in Norvigs book.

There is some really old code by called URANUS which is pretty interesting.
This system implements an extended prolog with lots interesting additional
features ('multiple worlds' and lazy evaluation) on top of Common Lisp.

Seems it's available at CMU's AI Repository:

http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/areas/kr/systems/uranus/

-- 
  (espen)
From: Jason Trenouth
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <gPMKODapZoUk24itW2nqn8UHqTv6@4ax.com>
On 18 Oct 1999 09:35:52 +0200, Espen Vestre
<·····@*do-not-spam-me*.vestre.net> wrote:

> "Pascal Saremsky" <······@docdes.com> writes:
> 
> > Does anyone know of a lisp package that provides a pretty good prolog
> > interpreter (or any logic inference engine) to be imbedded in and interact
> > with your Lisp code? Something like in Norvig's AI Programming book, but a
> > bit more complete?
> 
> The code in Norvigs book is actually quite usable for modest purposes.
> I once (5-6 years ago) tried out the prolog that came with Harlequin 
> Lispworks, but at least at that time (of course this may have changed!)
> it wasn't any faster or more feature-rich than the most advanced version 
> of the code in Norvigs book.

I quick test of the PAIP Prolog (*) against KW Prolog on the standard naive
reverse benchmark shows KW about 2x faster on a 400 element list. That was a
about the largest list I could use before I started getting stack overflows in
the PAIP Prolog.

KW Prolog also has stuff like optional Edinburgh syntax, CLOS object matching,
OPS integration, custom listener, graphical debuggers, etc.

Moreover KW is a mature stable product and I'm fairly sure all this was true
5-6 years ago as well.

__Jason

(*) I compiled the PAIP sources for high speed, low safety, low debugability.
From: Espen Vestre
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <w6hfjoaoes.fsf@wallace.nextel.no>
Jason Trenouth <·····@harlequin.com> writes:

> KW Prolog also has stuff like optional Edinburgh syntax, CLOS object 
> matching, OPS integration, custom listener, graphical debuggers, etc.

sounds great, I didn't want to do any injustice to the product as it
is _now_, that's why I added my paranthesis remark (although 2x
faster than the 'paip prolog' on an nreverse test doesn't sound
like it's even comparable to really fast prologs like SICStus).

> Moreover KW is a mature stable product and I'm fairly sure all this was true
> 5-6 years ago as well.

I reviewed the product for my employee some time in '93 or '94 and was 
quite disappointed.

-- 
  (espen)
From: Espen Vestre
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <w6emesanzl.fsf@wallace.nextel.no>
Espen Vestre <·····@*do-not-spam-me*.vestre.net> writes:

> I reviewed the product for my employee some time in '93 or '94 and was 

(should spell 'employer'...)

> quite disappointed.

I actually found a mail archive with a short concluding note,
dated Thu Oct 21 13:52:08 1993:

 "Common Prolog is only usable as a toy or as an emergency solution.",

and a little bit of benchmark notes, e.g. it scored 5000 Lips on a naive 
reverse test compared to the 600000 of SICStus, both measured on 1993
state-of-the-art sun sparcs.

-- 
  (espen)
From: Jason Trenouth
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <ixULOD6L8h3mytVRzmPNy0cKWqdH@4ax.com>
On 18 Oct 1999 13:48:30 +0200, Espen Vestre
<·····@*do-not-spam-me*.vestre.net> wrote:

> Espen Vestre <·····@*do-not-spam-me*.vestre.net> writes:
> 
> > I reviewed the product for my employee some time in '93 or '94 and was 
> 
> (should spell 'employer'...)
> 
> > quite disappointed.
> 
> I actually found a mail archive with a short concluding note,
> dated Thu Oct 21 13:52:08 1993:
> 
>  "Common Prolog is only usable as a toy or as an emergency solution.",
> 
> and a little bit of benchmark notes, e.g. it scored 5000 Lips on a naive 
> reverse test compared to the 600000 of SICStus, both measured on 1993
> state-of-the-art sun sparcs.

Even then we usually reckoned KW Prolog performed at >30000 LIPS (ie 30
KLIPS). Perhaps you were using the default compilation mode (a mix of
reasonable speed, safety, and debuggability)?

__Jason
From: Jason Trenouth
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <TxMLOGsdQ=8BL3XueUkHzoIO855t@4ax.com>
On 18 Oct 1999 13:39:23 +0200, Espen Vestre
<·····@*do-not-spam-me*.vestre.net> wrote:

> Jason Trenouth <·····@harlequin.com> writes:
> 
> > KW Prolog also has stuff like optional Edinburgh syntax, CLOS object 
> > matching, OPS integration, custom listener, graphical debuggers, etc.
> 
> sounds great, I didn't want to do any injustice to the product as it
> is _now_, that's why I added my paranthesis remark 

That's why I wanted to point out that KW Prolog was faster than PAIP Prolog
and lots more features even in 1993.

> (although 2x
> faster than the 'paip prolog' on an nreverse test doesn't sound
> like it's even comparable to really fast prologs like SICStus).

Indeed. KW Prolog isn't a substitute for a native Prolog, but it does give
Lisp and CLOS programmers well integrated access to reasonably fast
unification and backtracking.

> > Moreover KW is a mature stable product and I'm fairly sure all this was true
> > 5-6 years ago as well.
> 
> I reviewed the product for my employee some time in '93 or '94 and was 
> quite disappointed.

Well, if you thought KW was no different to PAIP Prolog then I can understand
that, but I wanted to point out that it isn't EQL to PAIP Prolog and never has
been. Perhaps Harlequin failed to support your evaluation adequately? If you
were looking for a commercial Prolog then KW obviously wasn't for you or your
employer, but KW Prolog is a pretty good example of a Lisp-hosted Prolog.

__Jason
From: Espen Vestre
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <w6so387pju.fsf@wallace.nextel.no>
Jason Trenouth <·····@harlequin.com> writes:

> Well, if you thought KW was no different to PAIP Prolog then I can understand
> that, but I wanted to point out that it isn't EQL to PAIP Prolog and never has

I didn't think that it was no different, I was just very, very disappointed
by its performance, since I thought - and still think - that it would be
possible to implement a *real* prolog in lisp (we had hoped to use it to
integrate prolog- and lisp-based computational linguistics software).  

Obviously, I wasn't very lucky with my experiments, your figure of 30KLips
may very well be right (there are good reasons to believe that we had OS-
related problems: because of the hardware, we had to run Solaris 2.2 
on the test machine...), and seems consistent with your current figures of
2xPAIP Prolog.  But it's still a looong way from SICStus! 
-- 
  (espen)
From: Jason Trenouth
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <rUILOKP5e7wZfs3SeLo54GbIkryD@4ax.com>
On 18 Oct 1999 15:43:01 +0200, Espen Vestre
<·····@*do-not-spam-me*.vestre.net> wrote:

> Jason Trenouth <·····@harlequin.com> writes:
> 
> > Well, if you thought KW was no different to PAIP Prolog then I can understand
> > that, but I wanted to point out that it isn't EQL to PAIP Prolog and never has
> 
> I didn't think that it was no different, 

Sorry I thought you said "it wasn't any faster or more feature-rich than the
most advanced version of the code in Norvigs book."

> I was just very, very disappointed
> by its performance, since I thought - and still think - that it would be
> possible to implement a *real* prolog in lisp (we had hoped to use it to
> integrate prolog- and lisp-based computational linguistics software).  

Well we worked hard on performance and the implementation uses WAM-based
techniques. It isn't clear that a Lisp-hosted Prolog can go much faster
without dropping the implementation down below the level of compiling the
Prolog into Common Lisp.

> Obviously, I wasn't very lucky with my experiments, your figure of 30KLips
> may very well be right (there are good reasons to believe that we had OS-
> related problems: because of the hardware, we had to run Solaris 2.2 
> on the test machine...), and seems consistent with your current figures of
> 2xPAIP Prolog.  But it's still a looong way from SICStus! 

Of course. An option, these days, might be to have the two programs
communicate using CORBA if the interface is not a performance hotspot.

__Jason
From: Espen Vestre
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <w6ln8z7neb.fsf@wallace.nextel.no>
Jason Trenouth <·····@harlequin.com> writes:

> Sorry I thought you said "it wasn't any faster or more feature-rich than the
> most advanced version of the code in Norvigs book."

I did, and I apologise for that.  Looking through my old mail I see
that I was mostly upset by the speed.

-- 
  (espen)
From: Andras Simon
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <vcd3dv9w0oo.fsf@biro.math.bme.hu>
"Pascal Saremsky" <······@docdes.com> writes:

> Does anyone know of a lisp package that provides a pretty good prolog
> interpreter (or any logic inference engine) to be imbedded in and interact

If you really mean "any logic", you might be interested in ACL2
(Boyer-Moore logic, not first order logic)
http://www.cs.utexas.edu/users/moore/acl2/
Andras
From: ··@nanofab.utdallas.edu
Subject: Re: Prolog in Lisp
Date: 
Message-ID: <u7lkk36jj.fsf@nanofab.utdallas.edu>
"Pascal Saremsky" <······@docdes.com> writes:

> Does anyone know of a lisp package that provides a pretty good prolog
> interpreter (or any logic inference engine) to be imbedded in and interact
> with your Lisp code? Something like in Norvig's AI Programming book, but a
> bit more complete?
> 
> PS. I use Common Lisp.

If you want Prolog-in-Lisp, Symbolics Prolog looks pretty good (but
only runs in Symbolics Genera).  If you don't care about Prolog in
itself but just about what it can do, I would suggest you get Screamer
(ftp://ftp.ai.mit.edu/pub/screamer/), which does everything Prolog can
do and more, is well integrated into Common Lisp and has been ported
to several CL implementations.

It claims to be efficient, as well.  Anyone have any hard numbers
comparing a Screamer program to a Prolog program doing the same
alogrithm on the same hardware?