9 ms·
Thank you very much for your interest, I greatly appreciate it! I hope you are all doing reasonably well. Please take care! This book was most recently discus
by triska 7y ago
Thank you very much for your interest, I greatly appreciate it!
I hope you are all doing reasonably well. Please take care!
This book was most recently discussed here in May 2018:
https://news.ycombinator.com/item?id=17121028 https://news.ycombinator.com/item?id=17121028
Since then, I have added a new chapter, Logical Foundations of Prolog:
https://www.metalevel.at/prolog/logic https://www.metalevel.at/prolog/logic
Also, I have made several other additions and improvements. You can
see most of the changes since the last discussion in a public git
repository:
https://github.com/triska/the-power-of-prolog/compare/8a94ed3d0ab73d31d6400ab18b9b341ed56fbad1...master https://github.com/triska/the-power-of-prolog/compare/8a94ed...
Currently, I am working on several videos that will eventually form
the core of the book. Here are a few previews:
https://www.metalevel.at/prolog/videos/logic https://www.metalevel.at/prolog/videos/logic
https://www.metalevel.at/prolog/videos/timetabling https://www.metalevel.at/prolog/videos/timetabling
https://www.metalevel.at/prolog/videos/sparrows_on_eagles https://www.metalevel.at/prolog/videos/sparrows_on_eagles
These videos are all work in progress, and they may be replaced by
better versions at any time. Hence, if possible, please use the links
above to refer to them: They will always point to the latest versions.
Alternatively, please use the following overview page that shows all videos:
https://www.metalevel.at/prolog/videos/ https://www.metalevel.at/prolog/videos/
Also, I have published a comprehensive journal paper about my
CLP(B) system, i.e., a SAT solver with some nice algebraic
properties, seamlessly integrated into Prolog as a specialized form of
unification:
https://www.metalevel.at/boolean.pdf https://www.metalevel.at/boolean.pdf
For Prolog application programmers and system implementors, the
paper's appendices may be especially interesting. They formalize a few
important concepts that are also a major theme in the book.
As of October 2019, the CLP(B) system is also available in Mark Thom's
Scryer Prolog. Scryer is a Rust-based Prolog implementation that is
freely available, conforms to the Prolog ISO standard, represents
strings efficiently as lists of characters, and includes important
features for implementing Prolog-based constraint solvers:
https://github.com/mthom/scryer-prolog https://github.com/mthom/scryer-prolog
As of a few days ago, Scryer Prolog also ships with my implementation
of CLP(ℤ), Constraint Logic Programming over integers. This is a very
useful declarative paradigm for solving combinatorial tasks, in some
ways superior to SAT solving because it allows more convenient
modeling, easier experimentation with different formulations, and
reasoning at a higher conceptual level. The chapter on declarative
integer arithmetic contains more information, and further pointers:
https://www.metalevel.at/prolog/clpz https://www.metalevel.at/prolog/clpz
For illustration, here is an example page where you can solve timetabling instances with this approach:
https://www.metalevel.at/prolog/timetabling/ https://www.metalevel.at/prolog/timetabling/
I welcome all comments and suggestions about the book, these videos,
and Prolog in general. Also, I would like to take this opportunity to
thank all readers for your thoughtful comments and endorsements. Your
feedback and encouragement are making this work especially worthwhile.
Enjoy!
- carapace 7y agoI want to say thank you, for your book and for all the work you're doing promoting and improving Prolog.
- triska 7y agoYou are very welcome! I greatly enjoy all your postings about your Prolog-based interpreter for Joy: https://osdn.net/projects/joypy/scm/hg/Joypy/blobs/tip/thun/thun.pl https://osdn.net/projects/joypy/scm/hg/Joypy/blobs/tip/thun/... I impulsively upvote this every time I see it. Thank you for sharing such an interesting project!
- carapace 7y agoYou're very kind. It's unfinished, and I doubt whether it will ever be useful for anything (other than just being kinda neat in and of itself.) I need to deal with compiling loops/recursion/fixpoints. But thanks! I appreciate it. Your advice to use CLP(FD) for the semantics of integer math operations was fantastic!
- mthom 7y agoYou don't mind if I port Thun to Scryer Prolog, do you? With full credit to you, of course. I'd like to include it as an example.
- carapace 7y agoNot at all, that would be awesome. It's GPL'd, have at it. (^_^) I typically use SWI Prolog but I hope the code is mostly portable. The parser uses a couple of DCGs from the "basics" lib but I think those are also portable or at least simple to re-implement. The tricky bit might be the semantics of math (and comparison) ops. I've tried two other sets of semantics, one that attempts to perform math operations (and catch the errors if e.g. an arg is a logic var rather than an int) as you go, and another that just builds expression trees (evaluation is delayed) like so: func(+, [int(A), int(B)|S], [int(A + B)|S]). Just to point out, in SWI Prolog the ints are "BigNums" while in GNU Prolog they're machine words (so modular arithmetic, mod 2^32). You could use Rationals or make up some other semantics. This all gets into Categorical paradigm programming. http://conal.net/papers/compiling-to-categories/ http://conal.net/papers/compiling-to-categories/ The same (point-free) expression can be used to develop concrete programs over various categories: Hardware circuits, partial evaluation, differentiation, dataflow graphs, and so on.