Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!purdue!decwrl!hplabs!hpl-opus!hpccc!hp-sde!hpfcdc!hpfclp!fritz From: fritz@hpfclp.SDE.HP.COM (Gary Fritz) Newsgroups: comp.lang.prolog Subject: Re: :- deterministic (HP Prolog) Message-ID: <6960006@hpfclp.SDE.HP.COM> Date: 26 Apr 88 16:23:57 GMT References: <900@cresswell.quintus.UUCP> Organization: HP SDE, Fort Collins, CO Lines: 27 Caveat: I am not one of the designers/implementors of HP Prolog, and therefore do not pretend to understand all the subtleties of the design. Until I get one of the designers to respond, though, allow me to make a few remarks: The deterministic declaration does result in behavior rather like that achieved by inserting a cut at the end of the predicate. There is, however, a more useful effect. Since the compiler knows that predicate X is deterministic, and cannot possibly backtrack, it can emit more efficient efficient code to call it. Since HP Prolog is implemented in Common Lisp, nested closures were used to implement success continuations. This happens to be very efficient in HP's Common Lisp, but obviously it's more efficient if you don't have to do this. The deterministic declarations allow the compiler to just call the predicate without pushing a level of closures. You could garner the same information by examining the definition of predicate X, but the declaration has a more global effect (just like compiler declarations in other languages). It can be made available in other source files, etc. Is this what you were looking for, or am I just stating the obvious? I'm afraid I don't understand what you mean by a "non-steadfast" predicate, so I can't address that. Care to enlighten me? Gary