Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!bionet!agate!labrea!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!enea!kth!sics!sics.se!alf From: alf@sics.se (Thomas Sj|land) Newsgroups: comp.lang.prolog Subject: Re: The meaning of "declarative" Message-ID: Date: 12 Oct 88 16:48:46 GMT References: <517@quintus.UUCP> Sender: news@sics.se Distribution: comp.lang.prolog Organization: Swedish Institute of Computer Science, Kista Lines: 61 In-reply-to: ok@quintus.uucp's message of 10 Oct 88 04:33:07 GMT I wanted to discuss the actually rather vague term "declarative", to make the point that this term should perhaps be avoided. I don't assume that something that is "declarative", a priori is "finer" than anything else. The unclarity has to do with which objects you attribute the property "declarative" to (is it a program, a specification, a programming language or a programming style or something else ?). Lloyd in his book "The foundation of logic programming" talks about "the declarative concept of finite failure" which indicates that concepts can be declarative, etc. Since "declarative" is a property attributed to programming languages I would like to make the point that we could consider a FORTRAN program as a syntactic sugar for a sequence of transition relations which when satisfied by a theorem prover represents the execution of the FORTRAN program, and thereby FORTRAN should be a "declarative" language. The "declarative reading" of some PROLOG programs is well defined in terms of least Herbrand models, of course, even though its practical use is more limited than we sometimes claim, since most PROLOG programming involves coding which sometimes adds meaning to the program that the PROLOG theorem prover cannot deduce if goal order is reversed etc. I would like to point out in contrast to some other comments on my posting that many normal uses of 'cut' does NOT cause a problem for the "declarative" reading of a Horn clause program as a set of axioms. It just affects the completeness in that some solutions are not found. In <517@quintus.UUCP> ROK writes: >In article alf@sics.se (Thomas Sj|land) writes: >>Statement 2, (viewpoint held by some experts who agree to statement 1): >> "functional languages are NOT declarative, while logic programming >> and equational languages are if they have completeness" > >Please name these experts, so that I will know whose books to avoid! This opinion was stated by some of my colleagues over dinner, and it may not be as silly as it looks. You can view "declarative programming" as meaning "programming with axioms and a theorem prover". If you see a pure functional program as syntactic sugar for a lambda expression, I guess it makes sense to say that the functional program is not "declarative", simply since a lambda expression is not an axiom in a theory. Another reading of a functional program could be that it is a way of defining a directed relation, whereby it suddenly becomes "declarative". Well... let's just avoid the term "declarative" when we try to describe properties of languages like Prolog, shall we ? I shouldn't have brought this up in the first place. We all know what we are talking about anyway. -- Thomas Sj|land SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Tel: +46 8 752 15 42 Ttx: 812 61 54 SICS S Fax: +46 8 751 72 30 Internet: alf@sics.se or {mcvax,munnari,ukc,unido}!enea!sics.se!alf