Hi,

I'm playing around with the latest commit on core.logic with Clojure 1.2.1.

There's a snippet of minikanren in the paper "Relational Programming in
miniKanren: Techniques, Applications, and Implementations"
that I'm having trouble translating.

(Page 13, http://pqdtopen.proquest.com/#abstract?dispub=3380156)

minikanren:

(run2 (q)
  (exist (x y z)
    (conde
      ((== (x y z x) q))
      ((== (z y x z) q)))))


Attempted translation to Clojure:

user=> (use '[clojure.core.logic minikanren prelude])
nil
WARNING: == already refers to: #'clojure.core/== in namespace: user, being
replaced by: #'clojure.core.logic.minikanren/==
WARNING: inc already refers to: #'clojure.core/inc in namespace: user, being
replaced by: #'clojure.core.logic.minikanren/inc
WARNING: reify already refers to: #'clojure.core/reify in namespace: user,
being replaced by: #'clojure.core.logic.minikanren/reify
user=> (run 2 [q]
            (exist [x y z]
                   (conde
                     ((== (x y z x) q))
                     ((== (z y x z) q)))))
#<RuntimeException java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.ClassCastException: clojure.core.logic.minikanren.LVar cannot be
cast to clojure.lang.IFn>


I'm a beginner with minikanren, I'm not really sure what `conde` does
anyway. Seems like an
equivalent to `do` in Clojure. Hopefully someone can correct me on this.

Thanks,
Ambrose

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to