Better Together: Unifying Datalog and Equality Saturation
arxiv.org
arxiv.org
This paper applies E-graphs to augment Datalog's reasoning/constraint solving.
Egg (and the e-graph theory behind it) has recently been put into use in some databases (e.g. cube[1]) and compilers (e.g. cranelift[2]). It lends itself well to the use-case of optimizing query planers and compilers, as it at the core avoids the optimization pass ordering problem (where an earlier optimization pass may destroy information that could be useful for a later one).
[0]: https://github.com/egraphs-good/egg
[1]: https://github.com/cube-js/cube
[2]: https://github.com/bytecodealliance/rfcs/blob/main/accepted/...
The egglog repo is here https://github.com/mwillsey/egg-smol with a wasm compiled web demo with examples here https://www.mwillsey.com/egg-smol/
It is still in pre-release, so there are no guarantees of stability and not necessarily ready for people to pile in.
This system is related to ones Yihong Zhang and I gave separate talks on at last year EGRAPHS 2022 workshop https://effect.systems/doc/pldi-2022-egraphs/abstract.pdf http://www.philipzucker.com/egglog/
They use BDDs in Datalog to solve previously unsolved problems like context-sensitive pointer analysis for large programs and show that analyses implemented with it are faster than hand-tuned implementations and use dramatically fewer lines of code.
Unfortunately the naming is all a bit confusing, isn't it....
I'm just trying to think of potential applications. This sounds cool!
- Higher-Order, Data-Parallel Structured Deduction https://arxiv.org/pdf/2211.11573.pdf
- Functional Programming with Datalog https://drops.dagstuhl.de/opus/volltexte/2022/16235/pdf/LIPI...
- A Systematic Approach to Deriving Incremental Type Checkers https://www.pl.informatik.uni-mainz.de/files/2020/10/increme...