Re:Why Learning Prolog Can Make You a Better Programmer
by swannodette on Friday April 08, 2011 @03:56PM
(#2425366)
I second The Reasoned Schemer as a fantastic introduction to logic programming. You can get miniKanren and its variants here - http://code.google.com/p/iucs-relational-research/. They'll run in pretty much any R5RS Scheme.
If you're a Clojurian you can give my bells & whistles implementation a spin: https://github.com/swannodette/logos. It has good performance, tabling, pattern-matching, and disequality constraints.
Re:Why Learning Prolog Can Make You a Better Programmer
by silentbicycle on Friday April 08, 2011 @04:09PM
(#2425405)
_The Craft of Prolog_ has a lot of good bits, but is written in response to something less readily available, so its organization seems a bit weird.
I also recommend the hell out of _The Art of Prolog_. Have done so here, many times. Also: Prolog systems with constraint extensions are MUCH more powerful. SWI Prolog (http://www.swi-prolog.org/) and GNU Prolog (http://www.gprolog.org/) are both good.
I'm about 2/3 of the way through the book, and I highly recommend it to anyone looking to learn the language in a more or less rigorous way. It won't make you a production Prolog programmer (any more than SICP will make you a production Schemer), but it starts with a firm grounding in the theory of logic programming, and works that up to a good grounding in Prolog step by step, before spending the latter half of the book working through idiomatic Prolog solutions to a bunch of standard (once-standard?) problems (a shell, an interpreter, a compiler), as well as problems more in line with Prolog's traditional uses (ELIZA, an expert system).
The book is here:
``The Craft of Prolog'', which this post mentions is in the same series, and provides somewhat of a more pragmatic view of the language. I may get to that next. Meanwhile, ``The Reasoned Schemer'' provides the entry of ``the Little Schemer'' series into the field of logic programming, using the MiniKanren logic programming system for Scheme.