Path: utzoo!utgpu!water!watmath!clyde!att!alberta!ubc-cs!voda From: voda@ubc-cs (Paul Voda) Newsgroups: comp.lang.prolog Subject: Re: Re: determinism, once etc, Trilogy Message-ID: <2601@ubc-cs.UUCP> Date: 16 May 88 05:31:24 GMT References: <2316@ubc-cs.UUCP> <6960007@hpfclp.SDE.HP.COM> Sender: nobody@ubc-cs.UUCP Reply-To: Gary Fritz Organization: UBC Department of Computer Science, Vancouver, B.C., Canada Lines: 40 I guess I have to apologize to Gary Fritz, he indeed did not say that HP Prolog's deterministic construct is a hack without a logic. This is what I have concluded from what he has said about the deterministic construct in the HP-Prolog. In the meantime it has been confirmed that the deterministic construct is indeed implemented by inserting a cut at the end of each clause. So hack it is! I have been very careful in the design and implementation of Trilogy to provide for the deterministic predicates in a sound way. Such predicates are called procedures in Trilogy and they can be compiled by tests and jumps without any choice points because Trilogy makes sure they cannot backtrack. So we have both an efficient implementation and logic! But then the predicate q(0). q(1). deterministic q must be rejected by a sound Prolog and Trilogy indeed rejects: proc Q(x:>I) iff x = 0 | x = 1 {x is OUTPUT} although it accepts proc Q(x:Hm. Certainly 'q(X), X = 2' requires backtracking, and would fail. >However, 'q(2)' is a perfectly reasonable query, and *would* succeed. >Therefore, is it necessary for a sound Prolog to reject the definition >of 'q'? Unfortunately a sound Prolog has to reject the definition because both queries mean the same. Paul Voda