Can anyone recommend any implementation of Datalog (+ negation) that is not datomic?<p>I haven't tried datascript, which appears to support negation. Maybe I will try that if/when I revisit this interest someday.
Thanks for sharing. There is one very significant conceptual error early on, however, and it is captured first in this statement: "The :- means if and only if, or iff". `:-` means if - or more precisely represents material conditional - where the consequent is on the left and the antecedent is on the right. iff is logical biconditional.
Pretty cool deep-dive on Datalog.<p>The interactive tutorials on <a href="http://www.learndatalogtoday.org" rel="nofollow">http://www.learndatalogtoday.org</a> (Datomic's dialect) quickly sold me on the idea.<p>Though coming from Datomic, I'm curious how much of my knowledge is Datomic-specific rather than how you'd generally approach a database queryable with Datalog. For example, do you need four indexes like Datomic (<a href="https://docs.datomic.com/on-prem/indexes.html" rel="nofollow">https://docs.datomic.com/on-prem/indexes.html</a>) to make Datalog queries fast?
Great post! Still working through it, but there is a slight error in the nested diagram at the start. Relational algebra has set difference, which is akin to negation-as-failure, but it lacks recursion. So the positive Datalog and RA circles should overlap without either containing the other. See <a href="http://www.lifl.fr/%7Ekuttler/elfe/biblio/datalog-overview-gottlob.pdf" rel="nofollow">http://www.lifl.fr/%7Ekuttler/elfe/biblio/datalog-overview-g...</a>
Nice post. Still, I find the most accessible article describing datalog is "What you Always Wanted to Know About Datalog (And Never Dared to Ask)." by Ceri, Gottlob, Tanca (1989)
> The :- means if and only if, or iff.<p>Is it really the case?<p><pre><code> Human("Socrates").
Animal("Turtle").
Mortal(x) :- Human(x).
Mortal(x) :- Animal(x).
</code></pre>
Suppose :- means iff. Turtle is Mortal (lines 2+4, implication to the left). Because Turtle is Mortal, it must be a Human (line 3, implication to the right).<p>Is it really valid according to Datalog semantics?
Sharing an interesting implementation in python which I stumbled upon yesterday.
Repo: <a href="https://github.com/pcarbonn/pyDatalog" rel="nofollow">https://github.com/pcarbonn/pyDatalog</a>
Tutorial: <a href="https://sites.google.com/site/pydatalog/Online-datalog-tutorial" rel="nofollow">https://sites.google.com/site/pydatalog/Online-datalog-tutor...</a>
If model-theoretic semantics and the various ways to slice, dice, and extend Datalog are interesting to you, then almost any talk by Peter Alvaro might be as well.<p>In particular: <a href="https://www.youtube.com/watch?v=R2Aa4PivG0g" rel="nofollow">https://www.youtube.com/watch?v=R2Aa4PivG0g</a>