Peter Verswyvelen wrote:
Thanks, this is very useful information!
Prolog is indeed on my list as languages I want to learn. I understand
the basic principles, but haven't digged deep yet. But first I want to
do Haskell, which I'm now totally addicted to!
But after reading http://en.wikipedia.org/wiki/Fifth_generation_computer,
it seemed to me that Prolog was a dead language, having only pure
theoretical purposes. Is this true?
Having a rich imperative background (I wrote some simple imperative
compilers and a large semi-functional visual programming toolkit
currently being used by a game development company), a book I found
really useful to understand how the inners of FP and Prolog work is Modern
Compiler Design.
It provides C code for all the concepts, so an imperative programmer
feels right at home. But to me it had the side effect that after
reading the last chapters on functional and logical programming, I felt
I had to get rid of these imperative languages as quickly as possible
(I always felt I was hacking when doing C, C++, or C#... which maybe
just meant I'm a bad programmer ;-)
PS: A part of the "Prolog for AI" book can be read on Google
Books (this Google Books thing looks *very* illegal to me, but
since it's google and not some hackers website, I felt free to provide
a link here...)
Cheers,
Peter Verswyvelen
jerzy.karczmarczuk@info.unicaen.fr
wrote:
Yes,
I know, this is Haskell list. So, I apologize, but not too much...
Johan Grönqvist cites me:
Anyway, I believe strongly that ALL
people
who have problems...
should be encouraged to learn Prolog. IN DEPTH,
Do you have a recommendation on how to do this?
(e.g., books, web-pages, (available) lecture notes, problem sets)
First, install a decent Prolog on your machine. There are plenty:
http://kti.mff.cuni.cz/~bartak/prolog/implementations.html
http://www.cs.cmu.edu/Groups/AI/html/faqs/lang/prolog/prg/part2/faq-doc-2.ht
ml
You may wish to install the free version of Visual Prolog.
My favourite is the SWI Prolog:
http://www.swi-prolog.org/
(University of Amsterdam)
The documentation is complete, and the reference manual contains
references
to such standard books as ClocksinMellish, or Sterling&Shapiro. The
last one
is very, very instructive.
Also, Prolog Programming for Artificial Intelligence, written by
Bratko, is
very useful. There are on the web collection of examples from this
book,
don't remember where.
Try here:
http://promethee.philo.ulg.ac.be/engdep1/download/prolog/bratko/
On-line there are thousands of examples, tutorials, etc.
J. Fisher: (There is an example of cut, especially for A. Coppin)
http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/contents.html
others:
http://www.coli.uni-saarland.de/~kris/learn-prolog-now/lpnpage.php?pageid=on
line
http://computing.unn.ac.uk/staff/cgpb4/prologbook/book.html
http://www.cs.nuim.ie/~jpower/Courses/PROLOG/
Etc., etc. Really!
Examples. For example:
http://www.csse.monash.edu.au/~lloyd/tildeLogic/Prolog.toy/Examples/
http://kti.mff.cuni.cz/~bartak/prolog/learning.html
http://www.visual-prolog.com/vip/example/
and of course there are discussion lists, FAQs, etc. Ask Google...
===================
Andrew Coppin writes:
I did once try to learn Prolog. And failed.
Miserably.
I just couldn't bend my head around how the
Prolog interpreter manages to > make seemingly "impossible" leaps of
deduction. (It's a *machine*! How can > it deduce arbitrarily
complex conclusions from any arbitrary set of axioms? That requires
*intelligence*!) And yet, in other, seemingly identical cases, it
utterly fails to deduce patently *obvious* results... really weird!
One of standard exercices in Prolog is the construction of the
meta-interpreter of Prolog in Prolog. While this is cheating, I
recommend
it to you. It opens eyes.
Actually, there are three basic items to learn while trying to master
Prolog
after having dealt with the syntactic essentials term construction, and
the
like.
1. The unification, which shows the "ultimate" instance of
pattern-matching
and is useful for recognizing some techniques for the automatic
inference
of types in functional languages.
2. The usage of unbound "logical variable", which sometimes permits to
to do things which require laziness in Haskell.
3. The control backtracking, which is at the heart of the logical
non-de-
terminism.
Now, the non-deterministic algorithms in Haskell are usually
implemented
using the *data backtracking*, or the List Monad. The control
backtrack,
via, say success/failure continuations, is more difficult, they are
rarely
taught, and problematic because of strong typing.
Prolog strategies are straightforward, and I simply cannot understand
the
comments of Andrew Coppin. Which arbitrary set of conclusions?? Which
patently obvious results not derivable?? Be kind, give some examples,
otherwise people may suspect that you are issuing vacuous statements...
The best.
Jerzy Karczmarczuk
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe