4 ms·
Is there any good resources for the internals of prolog / writing a prolog interpreter?
by keithnz 8y ago
Is there any good resources for the internals of prolog / writing a prolog interpreter?
- Tistel 8y agoPeter Norvig (of google fame) describes how to write a prolog like language in Common Lisp: https://www.amazon.ca/Paradigms-Artificial-Intelligence-Programming-Studies/dp/1558601910/ref=sr_1_4?ie=UTF8&qid=1539204305&sr=8-4&keywords=Peter+norvig https://www.amazon.ca/Paradigms-Artificial-Intelligence-Prog...
- qohen 8y agoMIT Press published a book called "The Warren Abstract Machine: A Tutorial Reconstruction" by Hassan Ait-Kaci. This short -- 114 pages -- book about the Prolog VM has been made available for free download by the author (it's out-of-print). [0] A good description of what it's about is at MIT Press' page for the author [1]. (While out-of-print, apparently a paperback version can be had for $21 on Amazon [2]). [0] http://wambook.sourceforge.net/ http://wambook.sourceforge.net/ [1] https://mitpress.mit.edu/contributors/hassan-ait-kaci https://mitpress.mit.edu/contributors/hassan-ait-kaci [2] https://www.amazon.com/Warrens-Abstract-Machine-Reconstruction-Programming/dp/0262510588 https://www.amazon.com/Warrens-Abstract-Machine-Reconstructi...
- qohen 8y agoAnd, interestingly, there are Github repositories of people implementing the material in this book, e.g.: https://github.com/rm-hull/wam https://github.com/rm-hull/wam (WAM in Clojure) https://github.com/rupertlssmith/hak_wambook https://github.com/rupertlssmith/hak_wambook (WAM in Java)
- GregBuchholz 8y agoChapter 4 of "The Art of Prolog" ("The Computation Model of Logic Programs") is about that very topic. It doesn't go into gory details on how to optimize an interpreter for fast execution, but it does go into enough detail that I was able to create a Prologish interpreter in ~30 lines of Haskell many years ago. Apparently "The Art of Prolog" is a free download now (there is a PDF link on the left side of the page).