Path: utzoo!attcan!uunet!mcvax!ukc!etive!lfcs!jha From: jha@lfcs.ed.ac.uk (Jamie Andrews) Newsgroups: comp.lang.prolog Subject: Re: The meaning of "declarative" Message-ID: <859@etive.ed.ac.uk> Date: 19 Oct 88 11:06:06 GMT References: <818@etive.ed.ac.uk> <590@dcl-csvax.comp.lancs.ac.uk> Sender: news@etive.ed.ac.uk Reply-To: jha@lfcs.ed.ac.uk (Jamie Andrews) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 62 Hum, I guess I should be happy that I got *some* response, although I didn't really expect this... Perhaps I wasn't clear enough in what I was saying. I was not asserting that Prolog is "more declarative" than Lisp or that you can program everything declaratively in Prolog. I was comparing the logic programming paradigm to the functional programming paradigm, in general. I was pointing out that the overall structure of logic programs makes them suitable for problem domains with lots of logical dependencies, whereas the overall structure of functional programs makes them suitable for problem domains involving functions -- seemingly fewer. Though functions come up naturally quite frequently in programs, they seldom seem to capture the essence of the whole problem. That doesn't mean that functional programming is "bad", just that people seem to use functional programming languages for reasons having nothing to do with the utility (or lack thereof) of the functional programming paradigm. In article <590@dcl-csvax.comp.lancs.ac.uk> simon@comp.lancs.ac.uk (Simon Brooke) writes: >Oh, come on now! Very, very few people can even be taught logic. Most of >those who can will always find it excrutiatingly difficult. It is a most >unnatural and tedious way of 'deducing information from assumptions'; and >if you cand find anyone who thinks logically, I wish you'ld introduce them >to me - it would be a new and fascinating experience. These statements are quite bizarre to me. Formulae are formalisations of mathematical statements. Derivations are formalisations of proofs. Proof systems are often given direct philosophical justifications, from introspection and observation of the way informal proofs in papers work. If you meant something like "proof systems are not close to the way we search for true assertions", I would agree with you, but that's not what I was saying. > ... Prolog is not an easy language in which to write an >inference engine.... > ... Most Prolog programs which do anything useful >are procedural; but when a piece of procedural Prolog goes wrong, it is >(in my experience) horrible to debug. You're talking about things to do with the problems of control, determinism, ease of doing code with assignment, etc., in Prolog. I didn't deny these problems exist, but you must realise that these are being addressed in more modern logic programming languages like Trilogy. I was talking, in any case, about the general applicability of the paradigms. Your comments about useful Prolog programs also apply to useful programs in the Langage International Superieur de Programmation (:-)). In most of these, the functional structure is just superficial and the real work is non-declarative. The difference is that the functional structure (*alone*) rarely buys you anything that you couldn't get in imperative programs, whereas a logical structure (*alone*) often does. --Jamie. jha@lfcs.ed.ac.uk "Autumn, to me the most congenial of seasons; the university, to me the most congenial of lives" --R.Davies