Hi Will! 
      Thanks, for the response, and sorry for the delay :D.
I did a unify-flatten instead of a walk-flatten,  but is the same idea. 
Im writting type checker/linter as a personal project.
Maybe when i finish it (if i ever do :) ), i could try switching between 
implementations.

Cheers, Paulo.


On Monday, February 6, 2017 at 10:35:45 PM UTC-3, William Byrd wrote:
>
> Hi Paulo!
>
> Sorry for the delay.
>
> As far as path compression, you might check out section 3.2 in this 
> unpublished paper:
>
> https://www.cs.indiana.edu/~lkuper/papers/walk.pdf
>
> Have you tried benchmarking your code?
>
> Cheers,
>
> --Will
>
>
> On Thu, Feb 2, 2017 at 6:39 PM, Paulo César Cuneo <[email protected] 
> <javascript:>> wrote:
>
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/minikanren.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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