3 ms·
I believe several of the canonical Lisp books implement a simple Prolog as an exercise. I’m pretty sure Norvig’s Paradigms of Artifical Intelligence Programming
by gglitch 6y ago
I believe several of the canonical Lisp books implement a simple Prolog as an exercise. I’m pretty sure Norvig’s Paradigms of Artifical Intelligence Programming, pg's On Lisp, and Winston & Horn’s Lisp all do.
- Jtsummers 6y agoThe relevant section of PAIP: https://github.com/norvig/paip-lisp/blob/master/docs/chapter11.md https://github.com/norvig/paip-lisp/blob/master/docs/chapter... Also worth exploring The Reasoned Schemer which teaches minikanren, which can be (and has been) implemented in many programming languages. It explores much of the same space as Prolog. I wrote most of a minikanren in Common Lisp while working through the book (someone else had already published a version to quicklisp which was better than what I made).
- abecedarius 6y agoThe PAIP implementation seems more practical than the other textbook Prologs I've seen like SICP's, while still quite small and clear.
- Jtsummers 6y agoIf you've never gone through PAIP, you're in for a treat. Most of the code is very practically written (I'd wager all, but it's been a while since I read/worked through it). Norvig writes good code, see also his website and many of the Python programs he's published over the years since he switched to it.