Clojure and Logic: Lojic Part Two
clojure.com
clojure.com
There seem to be three distinct implementations in the Kanren family at:
http://kanren.sourceforge.net/
1) Kanren (v4.50) - the full-blown logic system by Dan Friedman and Oleg.
2) "minikanren.scm" (v4.50) - this isn't the miniKanren that's used in The Reasoned Schemer (RS) - it appears to be a trimmed-down version of Kanren that may have been used in Univ. of Indiana classes, e.g:
http://www.cs.indiana.edu/l/www/classes/c311/minilop.pdf
It's an interesting version in its own right, and I've used it for some Datalog-like experiments. I wonder if this was an early attempt to adapt Kanren for teaching, or if anything else drove its implementation.
3) "mk.scm" (v1.3) - the RS' miniKanren by Friedman, Oleg Kiselyov, William Byrd, and Chung-chieh Shan...also described in Byrd's dissertation:
https://scholarworks.iu.edu/dspace/bitstream/handle/2022/877...
There are other versions as well - a microKanren, a couple of implementations by the U. of Indiana folks for things like nominal logic programming (alphaKanren) and constraint logic programming (cKanren), and of course the Clojure version discussed in the link.
These are all fascinating projects, and the full-blown Kanren implementation (in Scheme) is quite fast for things I've used it for. Much of the work you see recently on the web discusses the core.logic (miniKanren/Clojure) implementation. I'd be interested in hearing from others who've used any of these systems.
That's cool that you found minilop! It looks like that was an early attempt to whittle down Kanren to its essence which became the miniKanren used in The Reasoned Schemer.
2) is a version of miniKanren not much different from the one used in Byrd's dissertation.
cKanren is not really a "different" version of miniKanren. It retains most of the miniKanren core and adds constraint logic programming. From what I can tell, you can consider this the new miniKanren.
Great research by the way, it's awesome to see this kind of thing on HN.
For anyone else interested, it looks like Claire Alvis is leading development of cKanren. Here's a background paper and a link to the source on github:
http://scheme2011.ucombinator.org/papers/Alvis2011.pdf
https://github.com/calvis/cKanren
And here's a short example and discussion of use of cKanren by (I think) one of the core.logic creators:
http://dosync.posterous.com/another-taste-of-ckanren
http://groups.google.com/group/clojure/browse_thread/thread/...
Also, the Friedman group maintains some other source here:
https://github.com/iucs/relational-research
which includes...wait for it...babyMiniKanren (babymk)!
EDIT: You supplemented Clojure's implementation of miniKanren (core.logic) with great macros like defrel, facts, extend-rel, and a lot of other stuff. Those are the kinds of things that seemed a bit more convenient to me in Kanren (the optimized Scheme version), maybe because they seem more "Prolog-like" to me, especially extend-rel. I need to go back and look at RS miniKanren again to see how easy/desirable it would be to have those macros. Any thoughts?
You're right about the conciseness of RS miniKanren - it's just two pages in the "Connecting the Wires" part of the text.