PROLOG-REQUEST@SUSHI.STANFORD.EDU (Chuck Restivo, The Moderator) (04/20/87)
PROLOG Digest Monday, 20 Apr 1987 Volume 5 : Issue 28 Today's Topics: Query - Cut, Implementation - XOR & Errors & Frames & Objects ---------------------------------------------------------------------- Date: 17 Apr 87 18:34:02 GMT From: Rafail Ostrovsky <raf@bu-cs.bu.edu> Subject: cut for meta-interpreter Does anybody know how to implement PROLOG meta-circular interpreter with cut without using ancestor cut? Is there a clean way to implement (both at PROLOG level and at meta-interpreter level) ancestor cut? [see Volumes II and III for past discussions on this topic. -ed] ------------------------------ Date: Thu, 16 Apr 87 9:57:59 PDT From: Ken Kahn <Kahn.pa@Xerox.COM> Subject: Another approach to XOR In LM-Prolog I implemented a primitive called CASES whose syntax follows closely Lisp's COND. (cases (t-1 b-1) (t-2 b-2) ...) If t-1 has any solutions it is equivalent to (and t-1 b-1) i.e. the different possible solutions to t-1 were considered. If t-1 had no solutions then it is equivalent to (cases (t-2 b-2) ...). XOR can be defined by one clause in LM-Prolog: ((xor ?goal-1 ?goal-2) (cases (?goal-1) (?goal-2))) By the way, in a paper called "A Primitive for the Control of Logic Programs" in the 1984 IEEE Logic Programming Symposium I describe how by using a lazy bagof primitive one can define cases, xor, not, and so on. References -- PROLOG Digest V5 #27 ------------------------------ Date: Thu, 16 Apr 87 11:20:22 PDT From: Sanjai Narain <narain%pluto@rand-unix.ARPA> Subject: Reply to Ken Laws Ken Laws asks whether the frequency with which errors are made in coding trivial-appearing applications in Prolog is due to the subtlety of the applications or whether Prolog is awkward and unintuitive. The answer clearly is none of the above. No tool is 100% tolerant of human fallibility, or impetuosity. He further asks whether Prolog is a language for ordinary mortals for solving everyday problems. Yes, of course. Especially, if first order LISP is appropriate for the problem. However, to do serious work in Prolog it is important to understand its logical basis. Doing so can also reduce the frequency of errors. Of course, this is quite possible to do, even for ordinary mortals. You see, logic programming and Prolog were also invented by mortals (though perhaps not quite ordinary). -- Sanjai ------------------------------ Date: Thu, 16 Apr 87 13:44 EDT From: Brad Miller <miller@ACORN.CS.ROCHESTER.EDU> Subject: Frames/Objects You might also check out Allen et.al., "The HORNE Reasoning System in COMMON LISP" TR 126 revised, CS dept. University of Rochester, August 1986. HORNE is not Prolog, but it is a logic programming language that uses Horn clauses. It has substantial frame stuff built-in. -- Brad Miller ------------------------------ End of PROLOG Digest ********************