Re: Logic program and hierarchical data

2012-01-24 Thread Ryan Senior
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]

Re: Logic program and hierarchical data

2012-01-24 Thread Base
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

Re: Logic program and hierarchical data

2012-01-23 Thread David Nolen
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 > >

Re: Logic program and hierarchical data

2012-01-23 Thread Cedric Greevey
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

Re: Logic program and hierarchical data

2012-01-23 Thread David Nolen
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

Re: Logic program and hierarchical data

2012-01-23 Thread Cedric Greevey
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

Re: Logic program and hierarchical data

2012-01-23 Thread Edmund
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

Logic program and hierarchical data

2012-01-23 Thread Base
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