In my very incomplete understanding, the main difference between datalog
and core.logic is that datalog is set-oriented and core.logic is
tuple-oriented. Also datalog is designed to join and filter on external
datasources, while in core.logic, fresh vars (i.e. join points ??) also can
be created in the query.
Hence datalog queries can be guaranteed to terminate, as long as you don't
get crazy and build a Y-combinator out of rules (gotta try that :-)

Were I to try and implement a zebra puzzle solver using datalog, I'd start
with representing an inhabitant as a set of all possible items on each
slot. Then I'd try to formulate a query that narrowed the possibilites
according to constraints and a query that propagated eliminated
possibilities between inhabitants. Then I'd try to run those queries in
lockstep until the result is stable and hopefully a definite allocation of
items to inhabitants.

That's just from my memory of hand-solving the zebra puzzle, unfortuately I
don't know how that would actually work out, I haven't had much time to
play with datomic yet. But I can see using it in my next project requiring
a database :-)

kind regards

P.S. One reason I love the clojure community the most, is that exchanges
here are conducted with the utmost amount of professional courtesy as well
as precision.

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