cKanren is a wonderful system created by Claire Alvis and the group at IU for relational programming. This paper describes cKanren. cKanren builds on another wonderful system called miniKanren created by William Byrd and Prof. Dan Friedman of IU.
Off late, I started reading “The Little Schemer” series and started reading the awesome ”The Reasoned Schemer”, also by the same team that wrote miniKanren. cKanren is written in R6RS scheme and is developed on Chez, evidently. Since I wanted to use Racket and DrRacket environment, I started looking at changes to be done to make it run on Racket. What follows below are the instructions to setup DrRacket for cKanren programming. I am using Racket version 5.2. If you are using other version, I recommend upgrading to v5.2 or above.
Download my fork of cKanren
$ git clone git://github.com/vu3rdd/cKanren.git
Switch to the ‘racketification branch’
$ cd cKanren
$ git checkout -b racketification origin/racketification
Now, make cKanren module visible in the Racket ‘collections’. Note that ‘raco link’ works only on Racket versions 5.2 or above. (I will update this page when I learn about a solution which work with lower versions)
$ raco link .
Now, fireup DrRacket. In the definitions window, use the following as the language.
#lang cKanren
Hack away in cKanren!