🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3369

Re: Re: determinism, once etc, Trilogy

#3369
From: Paul Voda
Date: Mon, 16 May 1988 05:31
40 lines
2001 bytes
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:<I) iff x = 0 | x = 1      {x is INPUT}

The reason why q must be rejected is because in the output situations
it does not behave soundly. The logically true 'q(X),X=1' fails
whereas the equivalent 'q(1)' succeeds.
Gary writes:

>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
Technical Details
Message-ID: <2601@ubc-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!alberta!ubc-cs!voda
References: <2316@ubc-cs.UUCP> <6960007@hpfclp.SDE.HP.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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