For Programmers: Free Programming Magazines  


Home > Archive > Prolog > September 2004 > Odd question bout Prolog









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Odd question bout Prolog
sap6210@rit.edu

2004-09-18, 8:56 pm

Hi guys, I'm trying to do a report, but I'm having problems finding
information about Prolog. Basically, what I'm struggling with is
finding negative aspects of Prolog: limitations, restrictions, poor
features, etc. I'm supposed to right about it's comparison with Lisp
for the purpose of AI applications, but again... I'm struggling. If
anyone could offer any insight.. I'd appreciate tremendously.

Andrzej Lewandowski

2004-09-19, 3:56 am

On 18 Sep 2004 17:11:56 -0700, sap6210@rit.edu wrote:

>Hi guys, I'm trying to do a report, but I'm having problems finding
>information about Prolog. Basically, what I'm struggling with is
>finding negative aspects of Prolog: limitations, restrictions, poor
>features, etc. I'm supposed to right about it's comparison with Lisp
>for the purpose of AI applications, but again... I'm struggling. If
>anyone could offer any insight.. I'd appreciate tremendously.


....and good aspects of Lisp?...

A.L.
sap6210@rit.edu

2004-09-19, 3:56 am

Well, the problem is there is SOOOO many websites about the pro/cons of
Lisp. There are a good number of websites that praise the positivies
of Prolog, which is good, but I'm struggling to find negatives. I was
just wondering if anyone had any ideas for bad things about it.

Andrzej Lewandowski

2004-09-19, 3:56 am

On 18 Sep 2004 20:48:30 -0700, sap6210@rit.edu wrote:

>Well, the problem is there is SOOOO many websites about the pro/cons of
>Lisp. There are a good number of websites that praise the positivies
>of Prolog, which is good, but I'm struggling to find negatives. I was
>just wondering if anyone had any ideas for bad things about it.


Maybe you should post this question on comp.lang.lisp. They will
find 1000 and one arguments why ANY language is worse than Lisp.
Prolog including. Actually, as I recall, there was already such
discussion in the past. Try to google the archive.

A.L.
sap6210@rit.edu

2004-09-19, 3:56 am

okay, I'll try that (and I'll try to look). I just wanted an opinion
from people who use it more. What do you guys wish it could do, etc.
I don't know (personally) a SINGLE prolog programmer (I know small
amounts, not enough to make a major program at all)... it's ,
really. I'll try there too, but if anyone could give me an opinion, or
even more places to look, I'd be glad to hear it! :) Thanks!

Steve

Andrzej Lewandowski

2004-09-19, 9:00 am

On 18 Sep 2004 21:41:23 -0700, sap6210@rit.edu wrote:

>okay, I'll try that (and I'll try to look). I just wanted an opinion
>from people who use it more. What do you guys wish it could do, etc.
>I don't know (personally) a SINGLE prolog programmer (I know small
>amounts, not enough to make a major program at all)... it's ,
>really. I'll try there too, but if anyone could give me an opinion, or
>even more places to look, I'd be glad to hear it! :) Thanks!
>
>Steve


Then you know one. I am using Prolog in two large commercial
applications (transportation management and warehouse management). I
am using Prolog, because this is the best tool for planning,
scheduling and optimization. Prolog works for me better than any
other language. Therefore, don't expect that I will find
divantages and problems.

A.L.
Christopher Browne

2004-09-19, 3:58 pm

Martha Stewart called it a Good Thing when Andrzej Lewandowski <alewando_tego_nie@oddpost_tego_tez_nie.com> wrote:
> On 18 Sep 2004 21:41:23 -0700, sap6210@rit.edu wrote:
>
>
> Then you know one. I am using Prolog in two large commercial
> applications (transportation management and warehouse management). I
> am using Prolog, because this is the best tool for planning,
> scheduling and optimization. Prolog works for me better than any
> other language. Therefore, don't expect that I will find
> divantages and problems.


Ah, but what usually happens is that there are aspects that make a
language preferable for the task, that are sufficiently dominant to
bind your choice, despite there being some aspects that you might wish
were better.

The thing that often binds projects at work to Perl is the enormous
set of CPAN extensions. The syntax is pretty ugly, but there was a
perfect module for doing [whatever].

One of the likely _demerits_ of Prolog is the absence of anything
similar to CPAN. If you need a library for some moderately obscure
purpose, you probably _can't_ just download it.

One thing I find a challenge in Prolog is when I have to do things
that are of a "traditional iterative" nature where I'd normally just
request some sort of LOOP construct in other languages. I find myself
fighting with Prolog at such moments.
--
output = reverse("gro.mca" "@" "enworbbc")
http://linuxfinances.info/info/languages.html
Smith's Test for Artificial Life:
When animal-rights activists and right-to-life protesters are marching
outside your laboratory, then you know you've definitely made progress
in your artificial life research. -- Donald A. Smith
Pere Montolio

2004-09-19, 3:58 pm

sap6210@rit.edu wrote in message news:<1095552716.820556.104140@k26g2000oda.googlegroups.com>...
> Hi guys, I'm trying to do a report, but I'm having problems finding
> information about Prolog. Basically, what I'm struggling with is
> finding negative aspects of Prolog: limitations, restrictions, poor
> features, etc. I'm supposed to right about it's comparison with Lisp
> for the purpose of AI applications, but again... I'm struggling. If
> anyone could offer any insight.. I'd appreciate tremendously.


I will not try to do a theoretically analysis of prolog, because I'm
not languages expert. In my opinion, and from a practical point of
view as prolog programmer in an enterprise environment:

- it is near than imposible to have a good prolog team of programmers:
thus, prolog is expensive in training.
- it is near than totally out of enterprise world: no enough
librarians, ...
- it has the tipically problems of non-imperative languages: it is
very dificult to do thinks that in a imperative language takes a few
minutes.
- it is a few outphased.

My conclusion, and my work: never do a project with only a single
language, combine modules in several ones. In particular, prolog is
perfect for the kernel, but not valid for the interfaces.
Paulo Moura

2004-09-20, 4:02 pm

Christopher Browne <cbbrowne@acm.org> wrote in message news:<2r5g2gF16caorU1@uni-berlin.de>...
> Martha Stewart called it a Good Thing when Andrzej Lewandowski <alewando_tego_nie@oddpost_tego_tez_nie.com> wrote:
> One thing I find a challenge in Prolog is when I have to do things
> that are of a "traditional iterative" nature where I'd normally just
> request some sort of LOOP construct in other languages. I find myself
> fighting with Prolog at such moments.


dowhile(Action, Condition) :-
\+ \+ call(Action),
whiledo(Condition, Action).

whiledo(Condition, Action) :-
call(Condition) ->
\+ \+ call(Action),
whiledo(Condition, Action)
;
true.

forto(First, Last, Call) :-
First =< Last ->
\+ \+ call(Call),
Next is First + 1,
forto(Next, Last, Call)
;
true.

forto(Count, First, Last, Call) :-
First =< Last ->
\+ \+ (Count = First, call(Call)),
Next is First + 1,
forto(Count, Next, Last, Call)
;
true.

fordownto(First, Last, Call) :-
First >= Last ->
\+ \+ call(Call),
Next is First - 1,
fordownto(Next, Last, Call)
;
true.

fordownto(Count, First, Last, Call) :-
First >= Last ->
\+ \+ (Count = First, call(Call)),
Next is First - 1,
fordownto(Count, Next, Last, Call)
;
true.

Enjoy :-) Btw, as a Prolog programmer, I've seldom needed any of the
above predicates...

Paulo
A.L.

2004-09-20, 4:02 pm

On 19 Sep 2004 13:32:00 GMT, Christopher Browne <cbbrowne@acm.org>
wrote:

>Ah, but what usually happens is that there are aspects that make a
>language preferable for the task, that are sufficiently dominant to
>bind your choice, despite there being some aspects that you might wish
>were better.
>
>The thing that often binds projects at work to Perl is the enormous
>set of CPAN extensions. The syntax is pretty ugly, but there was a
>perfect module for doing [whatever].
>
>One of the likely _demerits_ of Prolog is the absence of anything
>similar to CPAN. If you need a library for some moderately obscure
>purpose, you probably _can't_ just download it.
>


I wrote: "Prolog is good for optimization and planning" and not that
it is good as Universal Language To Do Everything. Prologs (especially
SICStus and ECLIPSE) have the libraries that are good for these
applications. In addition, if I want to interface Prolog with
something or interface somethingh with Prolog, there are pretty good
frameworks to do this. Actually, I call Prolog from non-Prolog world,
and call dlls written in C from within Prolog.


>One thing I find a challenge in Prolog is when I have to do things
>that are of a "traditional iterative" nature where I'd normally just
>request some sort of LOOP construct in other languages. I find myself
>fighting with Prolog at such moments.


If you need loops, then most likely you are not programming in Prolog
but "prologish". But if you really need them then you can have them.
See for example

Schimpf J, Logical Loops, in 18th International Conference ICLP 2002,
Copenhagen, Denmark, pg 224-238, Springer-Verlag, 2002. [postscript]

on this page

http://www-icparc.doc.ic.ac.uk/publ...s_byauthor.html

A.L>
A.L.

2004-09-20, 9:01 pm

On 19 Sep 2004 08:13:08 -0700, tmp123@menta.net (Pere Montolio) wrote:

>- it has the tipically problems of non-imperative languages: it is
>very dificult to do thinks that in a imperative language takes a few
>minutes.


Or reverse.

A.L.
robert

2004-09-20, 9:01 pm

sap6210@rit.edu wrote in message news:<1095552716.820556.104140@k26g2000oda.googlegroups.com>...
> Hi guys, I'm trying to do a report, but I'm having problems finding
> information about Prolog. Basically, what I'm struggling with is
> finding negative aspects of Prolog: limitations, restrictions, poor
> features, etc. I'm supposed to right about it's comparison with Lisp
> for the purpose of AI applications, but again... I'm struggling. If
> anyone could offer any insight.. I'd appreciate tremendously.


well, speaking from a prolog derivative, the main problem is that it
doesn't scale well. if at all. prolog and the relational database
were born at about the same time. the prologs (Amzi! possibly excluded)
want (require) an in-memory "database" (prolog's definition) which is
much more efficient as a true database. duplicating this into memory
is a waste. indexing (prolog jargon, but effectively the same as
the relational database) is poor.

the execution engine is effectively an exhaustive enumeration code
walker. even with an in-memory database (see above), things can go
on for a while. and may never end. amen.

then there's the issue of cut(!): it's necessity is non-declarative,
procedural, and may be non-obvious.

the syntax is a love it or hate it kind of thing.

OTOH, it is sometimes said that M$ Word runs on a prolog engine. could
be. there was a M$ prolog compiler long ago.
A.L.

2004-09-20, 9:01 pm

On 20 Sep 2004 14:23:01 -0700, gnuoytr@rcn.com (robert) wrote:

>well, speaking from a prolog derivative, the main problem is that it
>doesn't scale well. if at all. prolog and the relational database
>were born at about the same time. the prologs (Amzi! possibly excluded)
>want (require) an in-memory "database" (prolog's definition) which is
>much more efficient as a true database. duplicating this into memory
>is a waste. indexing (prolog jargon, but effectively the same as
>the relational database) is poor.
>
>the execution engine is effectively an exhaustive enumeration code
>walker. even with an in-memory database (see above), things can go
>on for a while. and may never end. amen.
>
>then there's the issue of cut(!): it's necessity is non-declarative,
>procedural, and may be non-obvious.
>
>the syntax is a love it or hate it kind of thing.


Sort of revelations for me. Have you ever seen Prolog?...

A.L.
Pere Montolio

2004-09-21, 3:58 pm

A.L. <alewando_won_@hot_won_mail.com> wrote in message news:<rvduk09hkqm9f1ebu7ates7qk97dfbhc36@4ax.com>...
> On 19 Sep 2004 08:13:08 -0700, tmp123@menta.net (Pere Montolio) wrote:
>
>
> Or reverse.
>
> A.L.


I agree. I feel always stupid when I must implement in C a double
linked list and start to write statements like (l->first)? p->next=o:
l->first=o; and after, implement the binary search, the sort, ...
A.L.

2004-09-21, 3:58 pm

On 21 Sep 2004 12:07:44 -0700, tmp123@menta.net (Pere Montolio) wrote:

>A.L. <alewando_won_@hot_won_mail.com> wrote in message news:<rvduk09hkqm9f1ebu7ates7qk97dfbhc36@4ax.com>...
>
>I agree. I feel always stupid when I must implement in C a double
>linked list and start to write statements like (l->first)? p->next=o:
>l->first=o; and after, implement the binary search, the sort, ...


I was feeling equally stupid when I have figured it out that I have
implemented in C++ a subset of Common Lisp to deal efficiently with
lists... (don't tell me that I should be using STL). C++ project was
abandoned after 30+K lines of code, when it became clear that with C++
the project will not meet the budget and the deadline. The same done
with SICStus Prolog resulted in about 8K lines of code. Performance is
excellent. This was, by the way, CLP(FD) application, and in C++
version we were using very reputable FD constraint library.

A.L.
robert

2004-09-21, 8:56 pm

A.L. <alewando_won_@hot_won_mail.com> wrote in message news:<r9juk0hfa12rq0b2i9gmml8auil2lt6dna@4ax.com>...
> On 20 Sep 2004 14:23:01 -0700, gnuoytr@rcn.com (robert) wrote:
>
>
> Sort of revelations for me. Have you ever seen Prolog?...
>
> A.L.



sure have.
anonymous

2004-09-22, 3:57 am


<sap6210@rit.edu> wrote in
news:1095552716.820556.104140@k26g2000oda.googlegroups.com...
> Hi guys, I'm trying to do a report, but I'm having problems finding
> information about Prolog. Basically, what I'm struggling with is
> finding negative aspects of Prolog: limitations, restrictions, poor
> features, etc. I'm supposed to right about it's comparison with Lisp
> for the purpose of AI applications, but again... I'm struggling. If
> anyone could offer any insight.. I'd appreciate tremendously.
>


It's depend on what you are using it for, I think, for example,
1. When you develop a full functional software, you usually find that
Prolog is not sufficient to behave as a good developing platform. Then
you'll try to combine Prolog with other Language platform, but you find
it''s really a hard task;
2. Prolog is a Liner Logic AI language, but the Intelligence is so
complicated, hence it's hard to express your smart idea by prolog.

Do you think so?


Paul Singleton

2004-09-22, 4:01 pm

sap6210@rit.edu wrote:

> Hi guys, I'm trying to do a report, but I'm having problems finding
> information about Prolog. Basically, what I'm struggling with is
> finding negative aspects of Prolog: limitations, restrictions, poor
> features, etc. I'm supposed to right about it's comparison with Lisp
> for the purpose of AI applications, but again... I'm struggling. If
> anyone could offer any insight.. I'd appreciate tremendously.


As currently packaged, Prolog is deficient in areas like:

* persistence/sharing of its database

* (lack of) standard libraries

* interoperability with native GUIs

and suffers from a fragmentation of development effort into
umpteen incompatible proprietary versions whose individual
innovations can't be combined.

But if you're being asked to compare the computational
essence of Lisp with that of Prolog I'm afraid I don't
know Lisp and can find no fault with Prolog :-)

Paul Singleton


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Stephan Schulz

2004-09-23, 8:56 am

In article <1095568883.223540.164050@k17g2000odb.googlegroups.com>,
sap6210@rit.edu wrote:
>okay, I'll try that (and I'll try to look). I just wanted an opinion
>from people who use it more. What do you guys wish it could do, etc.
>I don't know (personally) a SINGLE prolog programmer (I know small
>amounts, not enough to make a major program at all)... it's ,
>really. I'll try there too, but if anyone could give me an opinion, or
>even more places to look, I'd be glad to hear it! :) Thanks!


I don't know much Prolog, but I have to work with other peoples code
occasionally (and often have to rewrite parts in another
language). There are a couple of things I don't like:

- Limited portability. SICStus, Yap, Eclipse, SWI... all support
slightly different dialects. Yes, there is a IEEE standard, but I
have not yet encountered a serious program written in standard
Prolog. No standard Open Source implementation (like gcc), instead
there are multiple incompatible candidates. Which versions implement
occurs-check? By default? Why do _I_ have to know this?

- Efficiency is, at best, mixed. Especially if you really write
declarative programs, things are bound to explode into your face. If
I have to think about order or evaluation and cuts, I can just as
well use a modern or not-so modern functional language.

- Non-local side effects by unification.

Bye,

Stephan

--
-------------------------- It can be done! ---------------------------------
Please email me as schulz@informatik.tu-muenchen.de (Stephan Schulz)
----------------------------------------------------------------------------
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com