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.
Introduction to Datalog
11–20 of 40 posts
Re: Introduction to Datalog
#12> The :- means if and only if, or iff. 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!
Re: Introduction to Datalog
#13I haven't tried datascript, which appears to support negation. Maybe I will try that if/when I revisit this interest someday.
Re: Introduction to Datalog
#14Earlier quoted context omitted.
Transitive closure is the first thing nearly every introduction to datalog (or Prolog, for that matter) will show you. All you had to do was click the link and scroll down: 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) :…
I was wondering about termination. With finite ground facts that appears not to be an issue. Complexity is another matter.
Re: Introduction to Datalog
#15Can anyone recommend any implementation of Datalog (+ negation) that is not datomic? I haven't tried datascript, which appears to support negation. Maybe I will try that if/when I revisit this interest someday.
Re: Introduction to Datalog
#16Can anyone recommend any implementation of Datalog (+ negation) that is not datomic? 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.
Re: Introduction to Datalog
#17Can anyone recommend any implementation of Datalog (+ negation) that is not datomic? I haven't tried datascript, which appears to support negation. Maybe I will try that if/when I revisit this interest someday.
Hi Joel. 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!
Re: Introduction to Datalog
#18Can anyone recommend any implementation of Datalog (+ negation) that is not datomic? I haven't tried datascript, which appears to support negation. Maybe I will try that if/when I revisit this interest someday.
Check out Datahike aswell, if you are interested in a durable datalog database. https://github.com/replikativ/datahike
Re: Introduction to Datalog
#19Re: Introduction to Datalog
#20Thanks 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.
Hi Stephen. You are absolutely right, thank you for the feedback! I have edited accordingly.