Stathis Sideris <[email protected]> writes:
Hi Stathis,
> With the code below you can query transitive relationships between
> entities successfully. Is there any way to use core.logic "explain"
> the relationship? Specifically, is there any way to write a function
> explain so that:
>
>> (explain :pitbull :chordate)
>
> will give you:
>
> [:pitbull :dog]
> [:dog :mammal]
> [:mammal :chordate]
Can't you define `iso` with 3 args, one being a list of intermediates?
E.g., something like
(defn iso [entity is parent]
(conde
[(is-a entity parent) (== is ())]
[(fresh [i nis]
(is-a entity i)
(conso i nis is)
(iso i nis parent))]))
Then you could run it like:
test.logic> (run* [q] (iso :pitbull q :animal))
((:dog :mammal :chordate))
Bye,
Tassilo
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en