I haven't tried datascript, which appears to support negation. Maybe I will try that if/when I revisit this interest someday.
You can give http://www.dlvsystem.com/dlv/ a shot!
Alternatively, if you prefer open-source solutions, check https://abcdatalog.seas.harvard.edu/.
Due to a number of complications on my machine, I used DLV.
TY for the link to abcdatalog though!
p(X,Y) ← q(Y,X)
etc.The interactive tutorials on http://www.learndatalogtoday.org (Datomic's dialect) quickly sold me on the idea.
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 (https://docs.datomic.com/on-prem/indexes.html) to make Datalog queries fast?
Datalog is fascinating, but the blog post makes me curious about more concrete impl-related follow-up questions.
For those interested in the mentioned paper, see: https://www.utdallas.edu/~gupta/courses/acl/papers/datalog-p...
Is it really the case?
Human("Socrates").
Animal("Turtle").
Mortal(x) :- Human(x).
Mortal(x) :- Animal(x).
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).Is it really valid according to Datalog semantics?
No, you and sdbrady who commented above are correct; the :- only means "if". I have edited accordingly and apologise for the misunderstanding!
In particular: https://www.youtube.com/watch?v=R2Aa4PivG0g
Edge("a", "b").
Edge("b", "c").
Path(x, y) :-
Edge(x, y).
Path(x, z) :-
Path(x, y),
Edge(y, z).
Symmetric closure, assuming I'm understanding correctly, is also trivial: SymmetricEdge(Left, Right) :-
Edge(Left, Right).
SymmetricEdge(Left, Right) :-
Edge(Right, Left).