wfc@cl.cam.ac.uk (William Clocksin on jenny) (12/14/89)
Could somebody send me the source code of a Prolog interpreter written in LISP (or the reference of a paper where one may be found)? I need this for teaching purposes only, and can't spare the time just at the moment to write one myself. I already know about the "smallest one in the world" in John Campbell's book, but I wonder whether somebody has got a more realistic one to share. Thank you.
dorai@titan.rice.edu (Dorai Sitaram) (12/19/89)
In article <1690@gannet.cl.cam.ac.uk> wfc@cl.cam.ac.uk (William Clocksin) writes:
$Could somebody send me the source code of a Prolog interpreter
$written in LISP (or the reference of a paper where one may be found)?
$I need this for teaching purposes only, and can't spare the time
$just at the moment to write one myself. I already know about
$the "smallest one in the world" in John Campbell's book, but I
$wonder whether somebody has got a more realistic one to share.
$Thank you.
[This is also addressed to people other than Clocksin.]
I have a fairly complete (i.e., it includes bagof and ilk, though I
didn't feel the need to add assert/detract!) and "easily" extensible
Prolog embedding written in Scheme, modeled on the one described in
Matthias Felleisen's "Transliterating Prolog into Scheme," Tech. Rep.
182, Indiana Univ. Comp. Sci. Dept., 1985. I may have referred to
this in my only previous posting on c.l.p. a few weeks ago.
It's "better" than an interpreter since it's an embedding, i.e., I can
use both languages with something approaching gay abandon. I am not
sure if this is what you want, since the language used is Scheme
(Ch*z) rather than Lisp. First-class continuations of Scheme,
something not available in Lisp, are exploited. If you think you still
want it, send me email, I'll see if I can make it subscribe to RRRS
standards to make it portable (allow time for delivery!), and email
you a copy. If you don't have a Scheme at your place, my code will
probably not be a good idea, since a Prolog embedding in a Scheme
interpreter written on top of your Lisp would be enough to break your
back, efficiency-wise, I should think.
--dorai
--
-------------------------------------------------------------------------------
It may be that the gulfs will wash us down;
It may be we shall touch the Happy Isles.
-------------------------------------------------------------------------------
dorai@titan.rice.edu (Dorai Sitaram) (12/20/89)
In article <3833@brazos.Rice.edu> dorai@titan.rice.edu (Dorai Sitaram) writes: >[This is also addressed to people other than Clocksin.] > >I have a fairly complete (i.e., it includes bagof and ilk, though I >didn't feel the need to add assert/detract!) and "easily" extensible >Prolog embedding written in Scheme, modeled on the one described in >[...] >want it, send me email, I'll see if I can make it subscribe to RRRS >standards to make it portable (allow time for delivery!), and email >you a copy. If you don't have a Scheme at your place, my code will >[...] I somewhat underestimated the response I would get for the above message. I've emailed the code to some of you, but there's still a backlog, and there are some of you I couldn't reach. There were suggestions that I _post_ the code. I guess, though, it'd be more convenient to all concerned if I made it ftp'able from Rice, rather than clog the net. Procedure: ftp titan.rice.edu (as anonymous) get public/slog.sh slog.sh is a shar file, and contains two implementation files (slog.ss and bagof.ss), two doc (loosely speaking!) files (Readme and Usage), and a bunch of example files (mostly from Sterling&Shapiro) to make it easy to acquire a feel for the possibly unusual syntax. The code is _not_ completely RRRS-compatible, but should be easily fixable for the Scheme of your choice/fate by adding requisite definitions of extend-syntax, boxes and printf (see The Scheme Programming Language by R. Kent Dybvig). If you encounter bugs/problems or get royally chewed by you-don't-know-what, email me, and I'll see if I can fix it. BTW, I would still like to get email from those who will be ftp'ing the stuff, so that I can get back to you if there are changes. (No, the list of names will _not_ be released to junk-mail senders. :-) --dorai ps: The code is completely free, and users can make all the changes and/or extensions to it they want. You might want to tell me about it, if you think it's significant, though. -- ------------------------------------------------------------------------------- It may be that the gulfs will wash us down; It may be we shall touch the Happy Isles. -------------------------------------------------------------------------------
dorai@titan.rice.edu (Dorai Sitaram) (12/22/89)
In article <3841@brazos.Rice.edu> dorai@titan.rice.edu (Dorai Sitaram) writes: >convenient to all concerned if I made it ftp'able from Rice, rather >than clog the net. > >Procedure: ftp titan.rice.edu (as anonymous) > get public/slog.sh > >slog.sh is a shar file, and contains two implementation files (slog.ss Drew Adams of Laboratoires de Marcoussis, France, very graciously informs me that the name "slog" is already used and probably copyrighted for a functional/logic language developed by his lab since 1984. To avoid complications, I've changed the name of the Prolog-in-Scheme embedding to "schelog," and hopefully this is a safe name. The file to ftp is now schelog.sh, but I've retained a soft link to it called slog.sh, so my previous instructions still remain valid for would-be ftp'ers. My thanks to Drew for letting me know. By the way, "schelog" is pronounced "Ski Lodge," of course. --dorai -- ------------------------------------------------------------------------------- It may be that the gulfs will wash us down; It may be we shall touch the Happy Isles. -------------------------------------------------------------------------------