🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #2869

Re: Badness

#2869
From: Lee Naish
Date: Fri, 13 Nov 1987 07:57
27 lines
1878 bytes
I hope not too many people are getting bored by this discussion
(I haven't got any flames yet).

In article <4815@burdvax.PRC.Unisys.COM> blenko@burdvax.PRC.Unisys.COM (Tom Blenko) writes:
>Programming declaratively, in the sense of pure PROLOG
>is not even powerful enough to express IF-THEN-ELSE,

Forget pure Prolog.  Think about logic.  Then think about how much of logic
can be implemented reasonably efficiently (more than pure Prolog!).
There are loads of techniques which have been discovered, ranging from
the reasonable well documented WAM to the undocumented
$copyVariablesToTopOfHeap/1 (useful for implementing inequality:-).

>declarative program for append3() that you cite in a paper as suffering
>from non-termination,
>So I think the "program declaratively" admonition is not even safe,
>efficiency questions aside.

I use append3/4 as an example of how purely declarative programming *is*
possible, given the right tools.  Its true that the techniques don't
work for all programs.  But, when append3 gets into an infinite loop,
adding a cut is not the best solution.  The version with a cut is
*incorrect*.  If only declarative constructs are used then the program
can at least be read declaratively, even if efficiency and termination
was considered at the time of writing.

	lee
Technical Details
Message-ID: <2397@mulga.oz>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!munnari!mulga!lee
References: <8711090842.AA20806@ucbvax.Berkeley.EDU> <2385@mulga.oz> <4815@burdvax.PRC.Unisys.COM>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!munnari!mulga!lee
From: lee@mulga.oz (Lee Naish)
Newsgroups: comp.lang.prolog
Subject: Re: Badness
Message-ID: <2397@mulga.oz>
Date: Fri, 13-Nov-87 02:57:53 EST
Article-I.D.: mulga.2397
Posted: Fri Nov 13 02:57:53 1987
Date-Received: Tue, 17-Nov-87 03:48:08 EST
References: <8711090842.AA20806@ucbvax.Berkeley.EDU> <2385@mulga.oz> <4815@burdvax.PRC.Unisys.COM>
Reply-To: lee@mulga.UUCP (Lee Naish)
Organization: Comp Sci, Melbourne Uni, Australia
Lines: 27