Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!zodiac!joyce!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: setof / ,/2 Message-ID: <322@quintus.UUCP> Date: 30 Aug 88 00:26:52 GMT References: <1411@kulcs.kulcs.uucp> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 101 In article <1411@kulcs.kulcs.uucp> bimbart@kulcs.UUCP (Bart Demoen) writes: >I will try one more time: if setof/3 is non-logical when its solutions are not >ground, that is because @arguments; after all, setof/3 tries to order with @In article <307@quintus.UUCP> ok@quintus.uucp (Richard A. O'Keefe) writes: > >> {I claim that clause((_,_), _) SHOULD report an error in every Prolog; >> (_,_) has a definition, it's just that the Prolog system refuses to >> show it do you.} > >sounds as if ok@quintus wants to tell us that (_,_) actually has a Prolog >definition, but that his favourite Prolog doesn't want to show it by means >of clause/2 ... a disease inherited from Edinburgh ? >I am amazed: there is no reason why 'every Prolog' should have a Prolog >definition of (_,_); on the contrary >,/2 is a syntactic construct, with a semantics, but it is not a builtin >predicate, nor a predicate defined in Prolog I said "a definition". I did *not* say "a Prolog definition". Demoen actually agrees with me: he says that it has "a semantics", which is no more and no less than "a definition". Similarly, consider foreign code, perhaps a Fortran subroutine which has been dynamically loaded into a Prolog program. The interface predicate is defined, you can call it, it is capable of succeeding, but clause/2 cannot show you the definition (although there IS a definition). I never claimed that _any_ Prolog system should have "a Prolog definition of (_,_)". What I said was that I think that every Prolog system should report as an error any attempt to obtain the Prolog code for a (particular built-in) predicate which has a definition _that is not in Prolog_ (or is for some other reason unavailable). I didn't say that clause((_,_), _) should be an error because (_,_) HAS a Prolog definition, but because it HASN'T. I am saying that it only makes sense to call clause/2 on predicates whose definition is thought to be in Prolog. What is so amazing about that? In "Edinburgh" Prologs, ','/2 _is_ a built-in predicate: you can at run-time do e.g. C = ',', A = (X=1), B = (Y=2), Goal =.. [C,A,B], call(Goal) With the aid of LIB:APPLY.PL or library(call) you can even do call(',', call(=,X,1), call(=,Y,2)). Looks like a built-in predicate to me. What properties distinguish "a builtin predicate" from "a syntactic construct, with a semantics" in Prolog? [Of course you can have a logic programming language, even one with "call", where ',' _is_ just a syntactic construct. That's not the question.]