I think separating the facts from determining the hierarchy makes it easier:
(defrel typeof* p c)
(facts typeof* [[:homo :homo-sapiens]
[:hominidae :homo]
[:primate :hominidae]
[:mammalia :primate]
[:chordata :mammalia]
Thank you all!
David, as always, greatly appreciated!
On Jan 23, 11:09 pm, David Nolen wrote:
> On Tue, Jan 24, 2012 at 12:00 AM, Cedric Greevey wrote:
> > On Mon, Jan 23, 2012 at 11:41 PM, David Nolen
> > wrote:
> > > (def homo-sapiens
> > > {:domain :eukarya
> > > :kingdom :animalia-met
On Tue, Jan 24, 2012 at 12:00 AM, Cedric Greevey wrote:
> On Mon, Jan 23, 2012 at 11:41 PM, David Nolen
> wrote:
> > (def homo-sapiens
> > {:domain :eukarya
> >:kingdom :animalia-metazoa
> >:phylum :chordata
> >:class :mammalia
> >:order :primate
> >:family :hominidae
> >
On Mon, Jan 23, 2012 at 11:41 PM, David Nolen wrote:
> (def homo-sapiens
> {:domain :eukarya
> :kingdom :animalia-metazoa
> :phylum :chordata
> :class :mammalia
> :order :primate
> :family :hominidae
> :genus :homo
> :species :homo-sapiens})
Looks like putting all the trans
One way:
(ns hierarchy.core
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]))
(def order [:domain :kingdom :phylum :class :order :family :genus :species])
(def homo-sapiens
{:domain :eukarya
:kingdom :animalia-metazoa
:phylum :chordata
:class :mammalia
:order :primate
On Mon, Jan 23, 2012 at 11:04 PM, Edmund 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 l
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 ?
Edmund
On 24/01/2012 01:35, Base wrote:
> Hi -
>
> I am attempting to model some hi
Hi -
I am attempting to model some hierarchical data for use in my first
logic program and am having some problems understanding how to create
a “typeof?” relationship with my data.
Defining parent child is easy enough of course; however I would like
to design a generic way of defining a subclass