Comment by upghost
Comment by upghost 6 months ago
Datalog is a syntactic subset of Prolog[1], which this is... not.
I think the most misunderstood thing about Prolog (and Datalog, the functor-free subset of pure Prolog) is that the syntax is really, really important.
It's like, the whole gimmick of the language. It is designed to efficiently and elegantly query and transform itself. If you lose the syntax you lose all of intermediate and advanced Prolog (and Datalog).
Semantics are more important than syntax. Prolog's flexible syntax is a nice-to-have rather than essential when you're in Lisp. And Datalog is purely first-order, so the advanced Prolog you're talking about doesn't exist in it.
However, syntax does matter, and this is not acceptable
as a way to ask I think you could, however, write a bit more Scheme and be able to ask which would be acceptable.However, the ordering betrays a deeper semantic difference with orthodox Datalog, which is about distinct N-ary relations, like a relational database, not binary relations. This implementation seems to be specific to binary relations, so it's not really Datalog for reasons that go beyond mere syntax.
On the other hand, this (from the initial goal) would be perfectly fine:
The orthodox Datalog syntax is: