Replies: 4 comments 1 reply
-
I also have similar questions. I've used various logic programming languages (Prolog, Datomic, and others). I am surprised at how different Cozo's datalog syntax is compared to others. |
Beta Was this translation helpful? Give feedback.
-
According to https://docs.cozodb.org/en/latest/queries.html :
|
Beta Was this translation helpful? Give feedback.
-
I also would like a standard syntax.
@gisborne That is not correct :-) Datalog programs do not run on a Prolog engine. For starters Prolog operates one tuple at a time, whereas Datalog operates with sets. Standard Datalog guarantees termination as it is designed mainly for query solving, whereas Prolog can't as it is a general purpose language. Datalog uses query optimizations techniques, in Cozo's case the evaluation is bottom-up and thus requires the Magic Sets transformation, something Prolog doesn't offer, etc. |
Beta Was this translation helpful? Give feedback.
-
On Sep 3, 2024, at 11:25, Alejandro M. Ramallo ***@***.***> wrote:
I also would like a standard syntax.
As I understand it, Datalog programs ought to even run on a Prolog engine.
@gisborne <https://github.com/gisborne> That is not correct :-) Datalog programs do not run on a Prolog engine. For starters Prolog operates one tuple at a time, whereas Datalog operates with sets. Standard Datalog guarantees termination as it is designed mainly for query solving, whereas Prolog can't as it is a general purpose language. Datalog uses query optimizations techniques, in Cozo's case the evaluation is bottom-up and thus requires the Magic Sets transformation, something Prolog doesn't offer, etc.
Yeah, but for Turing Completeness in Prolog, you need cut and/or functions, don’t you? And a Datalog query won’t have either.
I agree the Datalog program would be more efficient because of query optimisation.
|
Beta Was this translation helpful? Give feedback.
-
There must be good reasons, but why doesn't Cozo use the standard syntax of Datalog — a sub-language of Prolog. As I understand it, Datalog programs ought to even run on a Prolog engine.
This also includes me wondering why we need to differentiate := from ~>
Beta Was this translation helpful? Give feedback.
All reactions