On Mon, Jan 23, 2012 at 11:04 PM, Edmund <edmundsjack...@gmail.com> wrote:
> Hi Base,
>
>        In Dave Nolen's tutorial:
> https://github.com/swannodette/logic-tutorial there is a section on
> genealogy in which he composes child and child to create grandchild.
> Seems similar, maybe helpful ?

Caveat: I'm familiar with logic, but not with logic programming.

That said, I'd suggest defining a transitive "descended from"
relation, so "if A is descended from B, and B is descended from C,
then A is descended from C" is an axiom of the system.

Then define that "Homo sapiens is descended from Homo", and "Homo is
descended from Primates", and etc., and the transitive relations such
as "Homo sapiens is descended from Primates" will be theorems of the
system rather than having to be put in by hand.

It's just first-order logic so I doubt it's not possible with the
core.logic system. But again, I don't know the specific syntax. You
need something like (for all [x y z] (if (and (typeof? x y) (typeof? y
z)) (fact (typeof? x z)))) but the for and if forms, at least, are
pseudo-code here. Someone who knows more about core.logic could tell
you how to specify something like this, syntactically speaking. Maybe
you know enough of the syntax to put the rest together without further
assistance.

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