Hi minikanren list!

I was implementing my own version of minikanren in clojure and i figure out 
i could interleave walk with unifiy, so i could flatten out lvars chain.
Beside the current version isnt tail recursive (and may stackoveflow), see 
any problem.
I guess cache may missbehave, but lvars are not compacted together, soo i 
dont know.
Is there a minikanren benchmark test anywhere? 
Someone already tried this?


(defn unify [x y a]
(cond
(lvar? x) (let [x' (get-var a x)
;; get-var is not walk
a' (if (lvar? x')
(if (= x x') 
(ext-s a x' y)
(unify x' y a))
(unify y x' a))
x'' (get-var a' x')]
;; compress path
(ext-s a' x x''))
(or (seq? x)
(seq? y)) (unify-seq x y a)
(= x y) a 
:else nil))

Bye.

-- 
You received this message because you are subscribed to the Google Groups 
"minikanren" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/minikanren.
For more options, visit https://groups.google.com/d/optout.

Reply via email to