Date: Wednesday, 25-Jul-84 19:40:53-BST From: O'Keefe HPS (on ERCC DEC-10) Subject: Prolog built in predicates I recently had occasion to port the Prolog library from C-Prolog to PopLog. In 8 solid hours of hacking I didn't quite manage to finish the conversion, but if I'd had EMACS instead of EDT I would have. It is unfortunate that any conversion was needed at all; the library had already been converted from DEC-10 Prolog to C-Prolog, and I thought most of the DEC-10 specific stuff had either been knocked out entirely or identified. What I'd forgotten was that I'd introduced a fair bit of C-Prolog specific stuff in the interests of efficiency. One of these days I'll learn not to worry about efficiency... However, the C-Prolog version of the library does run under Bill Clocksin's Prolog-X system. I encountered three kinds of problems. 1) Pointless syntactic differences, such as the fact that /* start of commented out code: ...... /* end of commented out code */ caused Poplog to throw up its hands in horror and refuse to look at the rest of the file. I've now got a way around that: the DEC-10 parser and a suitable tokeniser are in the library. 2) Differences I was expecting, such as commands like "help" already being defined as something else, some predicates already being defined, some predicates the library uses not being defined, VMS file names being absurdly short so that library file names had to be changed, ... Some things are inherently system dependent, and the way to cope with this would have been for me to take more care to isolate system dependencies in the first place. 3) Differences in the built in predicates that I was not expecting and that did not add to the power of the language. I shouldn't *have* to cope with this problem. There are a number of Prolog systems that claim to be close enough to DEC-10 Prolog to be useful. However, because their authors have not had access to a clear description of what the built in predicates are supposed to do, such fundamental things as functor/3 often differ from DEC-10 Prolog/C-Prolog/Prolog-X enough so that the Prolog library can't be used. (By the way, I'm not saying that Poplog is unusually incompatible. On the contrary, it is unusually DEC-10 compatible, and is getting better all the time.) The differences generally don't do a thing to help anyone at all. So I've written a 100+ page document describing most of the predicates the Prolog library needs. It does NOT specify DEC-10 Prolog, indeed DEC-10 Prolog falls quite a way short of this "proposed standard" in many respects. It describes an upwards compatible extension, including strings and complex numbers as optional data types. I have tried to give design principles which determine what the built in predicates should do rather than to design each one on its own. The document isn't complete yet. It doesn't cover the data base or I/O, though it does touch on them. However, I shan't have any opportunity to do any more work on it this year, so I thought I'd solicit comments on the current draft. The document is now at SU-SCORE in PLSTD.MSS (I think) in SCRIBE format. It refers to a number of the library files, including some new ones written so that DEC-10 Prolog could run code assuming the new "standard". Please do read it if you can and send me your comments, either to OKeefe.R.A.%EDXA@UCL-CS ^ don't forget the third full stop! or to Richard A. O'Keefe, Department of Artificial Intelligence, University of Edinburgh, 8 Hope Park Square, Meadow Lane, Edinburgh EH8 9NW, SCOTLAND. If you want a hard copy, I'm afraid you'll have to wait until it comes out as a DAI Working Paper, which shouldn't be too long. I'm not the person to write to, you can find out who to write to for DAI reports by looking in almost any recent issue of SIGART.