README.md in micro_kanren-0.0.1 vs README.md in micro_kanren-0.0.2

- old
+ new

@@ -1,9 +1,16 @@ # microKanren in Ruby A port of microKanren, a minimalistic logic programming language, to Ruby. +## Description + +This is a port of [microKanren](http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf) +to Ruby. It is an almost exact translation of +[the original implementation](https://github.com/jasonhemann/microKanren), +which was written for [Petite Chez Scheme](http://www.scheme.com/petitechezscheme.html). + ## Installation Add this line to your application's Gemfile: gem 'micro_kanren' @@ -16,20 +23,27 @@ $ gem install micro_kanren ## Usage +The following example demonstrates how MicroKanren can be used from the console: + ```ruby -require 'micro_kanren' -include MicroKanren::Core +> require 'micro_kanren' +> include MicroKanren::Core +> include MicroKanren::MiniKanrenWrappers -call_fresh(-> (q) { eq(q, 5) }).call(empty_state) - -# The result is a set of nested lambda cons cells equivalent to ((([0] . 5 )) . 1)). +> res = call_fresh(-> (q) { eq(q, 5) }).call(empty_state) +> puts lprint(res) +(((([0] . 5)) . 1)) ``` -See the language_spec for more examples. +See the +[spec file](https://github.com/jsl/ruby_ukanren/blob/master/spec/micro_kanren/core_spec.rb) +for more examples. The spec file is almost an exact port of the [microKanren tests +written in Scheme](https://github.com/jasonhemann/microKanren/blob/master/microKanren-test.scm). + ## Credits The code in this gem is closely based on the following sources: * The [microKanren paper](http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf) @@ -38,11 +52,9 @@ about what this code is doing and how to write more effective logic programs. * This code is also in parts copied from [Scott Vokes' port of microKanren to Lua](https://github.com/silentbicycle/lua-ukanren). It was great to have the Lua code as a second example of the implementation in the paper, and it made my job especially easy since Lua is so similar to Ruby. -* Finally, I used the [microKanren examples in Scheme](https://github.com/jasonhemann/microKanren) - to see if this port worked as expected. ## Dependencies This project requires Ruby 2.0 or higher. You can see which Rubies work with this project in the [Travis CI Build Status](https://travis-ci.org/jsl/ruby_ukanren).