PROLOG-REQUEST@SUSHI.STANFORD.EDU (Chuck Restivo, The Moderator) (04/16/87)
PROLOG Digest Thursday, 16 Apr 1987 Volume 5 : Issue 27 Today's Topics: Implementation - XOR & Frames & Objects & CProlog fixes ---------------------------------------------------------------------- Date: 6 Apr 87 05:55:38 GMT From: Lee Naish <munnari!mulga!lee@seismo.css.gov> Subject: XOR without redundancy and databases One problem with this is that nested calls to xor may not work correctly. The inner call can use the same string and cause it to be put in the dictionary, even though G1 (from the outer call) fails. This would prevent G2 from being called. eg: ?- xor((xor(true, fail), fail), true). % xor is a confusing name here fails when it should succeed (I think). Just to stop a dozen people sending in fixes, I guess I should point out that you can get around this by creating two related strings, both of which must be "new" then making one "old". The computation may create the string in other ways too (though this is unlikely, I guess). was_there_once/1 could get pretty slow on some systems also (maybe slower than finding the first solution to G1). Can anyone confirm that default/2 in Prolog II uses soft cut? Are there any other systems with soft cut implemented? -- Lee ------------------------------ From: Norbert E. Fuchs <fuchs%ifi.unizh.chunet@RELAY.CS.NET> Subject: Frames/Objects in Prolog My request for references to frame or object-oriented extensions to Prolog brought the following results. J. Malpas, Prolog, A Relational Language and Its Applications, Prentice-Hall, 1987, chapter 6 J. L. and C. Y. Cuadrado, AI in Computer Vision, Byte, January 86, pp. 237 - 258 C. T. Huu, U. Kekeritz, Eine Frame Implementation in Prolog (in German), Rundbrief des Fachausschusses 1.2 der GI, April 1986, pp. 19-25 Interface Computer, Objekt-orientierte Programmierung in Prolog (in German), IF Prolog Interface, Vol. 1, #3 (Oct. 86) K. Fukunaga, S. Hirose, An Experience with a Prolog-Based Object-Oriented Language, Oopsla Proceedings 1986 (ACM Sigplan Notices Vol. 21 # 11, November 1986) K. Kahn, E. D. Tribble, M. S. Miller, D. G. Bobrow, Objects in Concurrent Logic Programming Languages, SIGPLAN Notices Vol. 21 #10 (October 86) and Oopsla Proceedings 1986 Technische Hochschule Darmstadt (FRG), Fachbereich Informatik, Sachbericht fuer den Zeitraum 1.1.86 bis 30.6.86 (in German) Juergen Wagner, Fraunhofer Institut IAO, Stuttgart, sent me the source of an object-oriented extension to Prolog he has developed (seismo!unido.uucp!iaoobel!wagner) N. S. Lee, Programming with P-Shell, IEEE Expert, Summer 1986. The P-Shell software is in the process of being released to the public. C. Zaniolo, Object-Oriented Programming in Prolog, IEEE 1986 H. Nakashima, Knowledge Representation in Prolog, IEEE 1986 I would like to thank all who responded. -- nef ------------------------------ Date: 14 Apr 87 23:35:22 GMT From: Todd Aven <todd@eneevax.umd.edu> Subject: C-Prolog Bug Fixes Wanted OK, I hacked at it too. Read on... Looks like Chris made the substantive changes I wanted to work on 'when I got the time'. I made superficial changes, but in the course of fixing things I found that there were a lot of unnecessary '#ifdef VMS' lines floating around. So what I'll do is this... I'll incorporate Chris' modifications to my code (fixes bugs I haven't even discovered yet), then I'll DIFF against the distribution with SUM/SLP output to make changing easier. Then, if Edinburgh incorporates that into their distribution it might be worth money :-). No, I shouldn't really rag on them so hard, it really is a nice interpreter. I just don't think they should go out of their way to make VMS look so screwy. > copied times.h from Eunice distribution to current directory I fixed the timing code directly, instead of bringing in a foreign include file. My philosophy is that if it compiles on my VAX with C 2.2, then it will compile on *your* VAX. If you start bringing in extra files, things get muddy (and lost). Thus, it's a personal preference. But at least my way I get the same times reported for building the initial system on the Sun and the VAX, so it can't be all bad. So, I modified the makefile (only slightly) since VMS command lines are a little different, I used pl/all instead of pl/vmsall, and it runs. Regards, -- Todd Aven ------------------------------ Date: 14 Apr 87 01:59:49 GMT From: Robert J. Drabek <oddjob!hao!noao!arizona!robert@rsch.wisc.edu> Subject: C-Prolog Bug Fixes Wanted The following changes were made to C-Prolog+ by Chris Janton to get it to run under version 4.4 of VMS. file MAIN.C in initial "include" statements change extern int sys_nerr; extern char *sys_errlist[]; to #ifndef vms extern int sys_nerr; extern char *sys_errlist[]; #else #include perror #endif approx line 1529 change y = MolP(k1)->Env; k1 = MolP(k1)->Fn; to y = MolP(k1)->Env; k1 = SkelP(MolP(k1))->Fn; approx line 1747 change bn = &(SkelP(FunctorP(MolP(ARG1)->Sk)->Fn)->flgsoffe); to bn = &(FunctorP(SkelP(MolP(ARG1)->Sk)->Fn)->flgsoffe); file SYSBITS.C change extern int sys_nerr, PrologEvent; extern char *sys_errlist[]; to #ifndef vms extern int sys_nerr, PrologEvent; extern char *sys_errlist[]; #else #include perror extern int PrologEvent; #endif change function ToEOL from char ToEOL(reply,count) register char *reply; int count; { extern FILE *freopen(); extern int isatty(); char c0, c; /* check for eof */ if ( feof(stdin) ) { freopen( "/dev/tty", "r", stdin ); return PlEOF; } while ((c0 = getchar()) <= ' ' && c0 != '\n'); c = c0; while (c0 != '\n') { c0 = getchar(); if (reply && --count>0) *reply++ = c0; } if (reply) *reply = '\0'; if (c >= 'A' && c <= 'Z') c += 'a'-'A'; return c; } to char ToEOL(reply,count) register char *reply; int count; { extern FILE *freopen(); extern int isatty(); char c0, c; /* check for eof */ /* if ( feof(stdin) ) { /* freopen( "/dev/tty", "r", stdin ); /* return PlEOF; /* } */ fclose(stdin); stdin = fopen("SYS$COMMAND:", "r"); while ((c0 = getchar()) <= ' ' && c0 != '\n'); c = c0; while (c0 != '\n') { c0 = getchar(); if (reply && --count>0) *reply++ = c0; } if (reply) *reply = '\0'; if (c >= 'A' && c <= 'Z') c += 'a'-'A'; fclose(stdin); stdin = fopen("SYS$COMMAND:", "r"); return c; } file PL.H change extern int errno; to #ifndef vms extern int errno; #else extern int noshare errno; #endif copied times.h from Eunice distribution to current directory -- Robert J. Drabek ------------------------------ End of PROLOG Digest ********************