Compositional Datalog on SQL: Relational Algebra of the Environment(philipzucker.com) |
Compositional Datalog on SQL: Relational Algebra of the Environment(philipzucker.com) |
Unfortunate you can't add new operators in Python the way you can in Prolog or OCaml to get a readable infix syntax like the one you chose but without the misleading operators like <= for :-. (I've done worse, though...)
My maybe inaccurate understanding of recursive CTEs was that they only allow linear occurrences of the recursively defined relation in the query and do not allow many mutually recursively defined relations. These might be per implementation restrictions. These are pretty harsh restrictions from a datalog perspective. I should explore what Postgres offers more. It's just so easy to try stuff out on sqlite.