4 ms·
Wouldn’t Datalog be a better alternative?
by optimalsolver 4y ago
Wouldn’t Datalog be a better alternative?
- rhelz 4y agoDatalog is great for database programming, and since it is a restricted subset of prolog, a datalog comes in every box of prolog :-)
- cmrdporcupine 4y agoAren't there significant differences in implementation between a Datalog system and Prolog running similar rules, though? Bottom-up vs top-down eval, is what I read...
- rhelz 4y agoClassically, yes, but most prolog implementations these days support a tabled search strategy as Datalog typically does.
- Avshalom 4y agoSort of. Because of it's restrictions it traditionally uses different search/resolution strategies than Prolog. And in the other direction the SLD resolution strategy Prolog traditionally uses can fail on syntactically valid Datalog (clause ordering issues). That said, the big Prolog implementations all support multiple resolution strategies although I suspect there are a lot of various optimizations Datalog squeezes out of it's restrictions that let it handle things that might not be reasonable in a given Prolog.
- rhelz 4y agoGood point; in the olden days of prolog only the SLD search strategy came out of the box, and you had to roll your own if you wanted others. However, happily a lot of the tabled programming research from the XSB prolog group (and others) has osmosed out into the mainstream prolog implementations by now.
- ddejohn 4y ago> great for database programming Can you elaborate on what you mean by this? Like, custom database implementations? I wrote a little bit of Prolog in college and thought it was neat but I haven't looked at it since. I've seen Datalog mentioned recently in relation to biscuits, a technology I think is incredibly cool but that I don't fully grok.
- gamache 4y agoOn one hand, Prolog is more powerful than Datalog. But on the other hand, Prolog is more powerful than Datalog.
- telekid 4y agoWith great power comes great irresponsibility.
- tpoacher 4y agoQuery: morepowerfullthan(Prolog, Datalog). yes; yes; yes; yes; yes; yes; yes; yes; ...
- DonHopkins 4y agoJust as C combines the power and performance of assembly language with the flexibility and ease-of-use of assembly language.
- maweki 4y agoIn this case, it's even worse. Prolog is computationally complete. With everything that comes with rice's theorem. Every non-trivial property of a program being generally undecidable. Datalog, on the other hand, isn't. It's terminating, like SQL. And many program properties are indeed decidable.
- anon291 4y agoYes. Datalog is not Turing-complete; thus is much easier to reason about, and good query optimizers can be much more aggressive. Once you introduce cuts (as in prolog), you have to throw a lot of that out the window. But Datalog is a subset of prolog.