PostgreSQL-Prolog: A Prolog library to connect to PostgreSQL databases
github.com
github.com
As it stands, quering (pseudocode) "connect(C), insert(C, data), false" has no solution but side-effects.
SLD-resolution probably just does not work with side-effects.
Of course, that's hard to do when interacting with external systems!
I do think consensus algorithms have something deeply in common here, as CALM (Consistency As Logical Monotonicity) seems to cover the space of join-semilattice structures pretty crisply, and CALM is all about when you don't need consensus. But again, just my own musings.
And then you just write down all the rules.
edit: As long as queries aren't recursive in a difficult manner, like co-recursive or have multiple recursive calls in the same rule.
For example, the string "abc" takes only 4 bytes in this representation, and the unification "abc" = [a,b,c] succeeds. Indeed, we have:
?- write_canonical("abc").
'.'(a,'.'(b,'.'(c,[]))) true.
On 64-bit systems, a conventional internal representation of "abc" as the compound term .(a, .(b, .(c, []))) takes 8 bytes per functor (each '.'/2 takes 8 bytes, i.e., 1 cell in the WAM), 8 bytes per character (as a pointer to the atom table, again 1 cell in the WAM), and 8 bytes for each tail. All Prolog systems before Scryer Prolog use 16 to 24 times as much memory to represent a list of characters. As of recent, Trealla Prolog also uses the efficient representation, at least for fully instantiated strings. Scryer Prolog can also represent partial strings such as [a,b,c|Ls] with the efficient encoding.That's not correct. As I said, it's a pretty basic optimization to store strings as native char buffers, and then only convert to explicit list representation if a variable bound to a string in that way is used in eg unification against a (partial) list, or subjected to a list (or other non-string) builtin. Definitely not new with Scryer Prolog; maybe true of F/OSS Prologs though I doubt it.
It has first-class Datalog constraints as a language feature!
As being a FP language it's of course good at modeling data. At the same time it's fast enough for heavy tasks: It runs on the JVM, having also access to its rich ecosystem.