|
|
|
|
|
by trurl
2959 days ago
|
|
While it is possible to view Datalog as a subset of Prolog, they are really very different languages. In particular Datalog implementations generally use forward rather than backwards chaining evaluation. As such, programs you might write in Datalog might diverge in naïve Prolog implementation. Depending on what variant and extensions of Datalog you are using, a program that you could write in the subset of Prolog that matches Datalog might similarly diverge in a Datalog engine. So really linking to a text on Prolog is not really relevant to a discussion of the merits of Datalog. |
|
SLG resolution (also called "tabling" in Prolog) prevents both positive and negative loops, and always terminates for programs that have the bounded term-size property, as is the case for all Datalog programs. XSB Prolog is a notable example of a Prolog system that supports this mode, which you can enable with the table/1 directive:
http://xsb.sourceforge.net/shadow_site/manual1/node2.html
Therefore, you can use a Prolog system such as XSB Prolog also to learn Datalog, and then seamlessly move to Prolog. Conversely, if you know Prolog, then learning Datalog is very easy. Another very nice system for learning Datalog is DES, which you can run in SICStus Prolog and other systems:
http://des.sourceforge.net/
Various extensions such as aggregate functions and object-oriented programming (which are mentioned in the Wikipedia entry for Datalog) are also applicable to both Prolog and Datalog with identical or closely related semantics.