Re:Differential Datalog
by flyingsilverfin on Saturday March 20, 2021 @08:15AM
(#26522662)
The company I work for, Grakn Labs (grakn.ai), builds a database that does datalog + negation type rules! You can add/remove data as you go, and also add/remove rules in the schema over time.
The terminology the post here uses is different from ours, but roughly we do "Backward-chaining", which starts from the query to the set of facts that are inserted, which the article calls "top-down".
[ Parent
| on HN ]
Do you handle incremental changes to the input data? Because that's the major selling point of DDlog: low-latency responses to changes in inputs.
Re:Differential Datalog
by flyingsilverfin on Saturday March 20, 2021 @07:42PM
(#26526928)
We don't do this right now - optimising for incremental changes is actually better done by maintaining forward-chaining inferences (like the OP) rather than backward chaining, and then invalidating and updating just the inferences that have modified dependencies.
Which you want depends on use case often: if you have often changing data backward chaining is generally better, but if it's largely static you can get large performance wins by materialising all the inferences, once, via forward-chaining.
Re:Differential Datalog
by seanmcdirmid on Saturday March 20, 2021 @10:38AM
(#26523517)
Isn’t datalog with backward chaining just prolog? Datalog was known for forward chaining (bottom up) while prolog was known for backward chaining, datalog with backward chaining sounds like a misnomer.
Re:Differential Datalog
by flyingsilverfin on Saturday March 20, 2021 @07:44PM
(#26526935)
You're not wrong - the other big difference between datalog and prolog is that datalog is a subset of prolog's functionality that enables forward-chaining to be safe (gets trickier with negation for example). I was mostly referring to the fact that Graql implements datalog semantics/capabilities, plus negation - but the execution strategy is backward-chaining.