From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,24ac4e1c8cbfe3c X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: histrionics Date: 1999/09/11 Message-ID: <7rcddd$bfd$1@nnrp1.deja.com>#1/1 X-Deja-AN: 523598456 References: <37D670CE.855F96BD@interact.net.au> <37D678E4.9867000B@interact.net.au> <37d74de9@eeyore.callnetuk.com> <7r8c60$b2q$1@nnrp1.deja.com> <7r9rkj$g75$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x43.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Sat Sep 11 02:05:39 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-09-11T00:00:00+00:00 List-Id: In article , "Vladimir Olensky" wrote > May be this is because writing complex programs in Prolog > requires very high level of abstract thinking to be able to > express complex problems using short logic predicates > sentences. Actually I disagree strongly with your criticisms of Prolog. On the contrary, I think it is MUCH easier to think at the prolog level, than to think in the low level sequential manner that conventional programming requires (as I mentioned the sad thing in Prolog, is that once you use cut, which in practice you do need to in real programs, you have to go back to much lower level thinking). > It is always more easy to describe something in many words > than in couple of words:-) No, again I disagree, the power of very high level languages is directly related to the fact that you want to be able to describe things at a much higher level, and of course the descriptions are shorter. If I can say (this is SETL, without the nice character set :-) primes = {n in 2 .. 100 | notexists j in 2 .. n - 1 | n mod j = 0}; that's a WHOLE lot easier to understand than a seive programmed in a conventional procedural language. Vladimir, you can supply the corresponding prolog program if you like :-) I prefer the statement in SETL, since it seems close to the mathematical definition of primes, both syntactically and semantically > Another thing is that it may be difficult for many people to > grasp= the idea of backtracking Actually the nice thing about angelic non-determinism is precisely that you DON'T need to think about it, the right thing happens. Backtracking is not a fundamental part of the semantics of Prolog at a high level, rather it is an implementation mechanism for acheiving a correct pattern match as required by angelic ND. Of course, once again, if you worry about cut, then suddenly the backtracking becomes non-transparent. A very similar situation happens in SNOBOL-4 pattern matching, which at best can be considered to be fully declarative, but which provides lots of cut-like low level junk that requires you to know the procedural algorithm that is used. > and recursion Surely you are not saying recursion is hard to understand. Sure I know that beginning students may have trouble, but surely anyone who considers themselves a competent professional programmer has got past this long ago, and is completely comfortable with recursion ... > Iterative algorithms implemented using conventional languages > may have much more lines of code but be much more easy > understandable. This is the kind of criticism you expect from someone who basically does not like Prolog :-) I would strongly disagree an elegant program written in Prolog is far far easier to understand than the extended gobbledygook that passes for low level procedural programming :-) So, it's interesting, Dewar and Olensky have almost diametrically opposed views of Prolog. Dewar likes very high level languages in general, and finds examples of programs written in these languages compelling, and for examples, that feeling applies to Prolog. Elegant Prolog examples, even quite complex ones are quite beautiful, easy to understand, concise, and clear. Where Dewar gets off the Prolog admiration bus is where people claim that it is an appropriate and practical language for writing large scale applications, including expert systems. Olensky on the other hand is rather suspicious of Prolog, thinks it is hard to understand because of backtracking, logic etc, but nevertheless thinks it is the language of choice for large complex expert systems. Interesting .... Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.