Lulu Press, 2012 - 2nd edition - 53 pages - 6" x 9" format - public domain code
Order a PDF copy at Lulu.com
Order a paperback copy at Lulu.com
Download the code from the book
This small book answers all these questions in about 50 pages of prose.
Chapter 1 introduces basic logic programming techniques.
Chapter 2 applies the techniques to a well-known puzzle. (No, not the one on the cover page.)
Chapter 3 rolls your own logic programming system in 170 lines of Scheme.
The code in this book is purely functional, purely symbolic, and easy to follow.