Logic programming on the JVM

Just a quick post (the time is rather late) to note that my port of the Mini Kanren logic programming system to Scala is now available for download (and bug reports) on GitHub; for the scaladoc API documentation and a presentation discussing the porting effort, visit the project homepage.

It has an almost-complete numerical stack — the missing arithmetic relations are not coded yet because I was documenting and/or getting larger test cases to work — and likewise with list-processing support. The years-old stack overflow problem I initially attributed (when taking a programming language course, and having no time to debug thoroughly) to Java’s lack of TCO turns out to be fixable by some judicious call-by-name optimizations.

Having just discovered metalua and its macro goodness, I’d say that after bringing Kanren to the JVM, the next step would be to have a C-embeddable Kanren written in metalua. There might be some performance snags, though — the Scala port is currently about 3x slower than Mini Kanren running on Petite Chez Scheme.

Technorati Tags: , , , , , ,

3 responses to “Logic programming on the JVM

    • I’ve not been working on it myself — I’m not aware currently of any other implementations, but would be interested to see one!

      The best reimplementation currently is Clojure’s core.logic — I’d recommend checking it out.

      • Yeah, I know core.logic – in fact it started my interest in minikanrenšŸ˜‰
        Btw, do you know any lua module for logic programming (doesn’t have to be minikanern impl.)? Because I can’t find any…..