Prev Next Up Home Keys Figs Search New

Prolog vs. Database Search

Appeared in Volume 9/2, May 1996

Keywords: databases.


csun@netcom.com
Charles Sun
23rd January 1996

I need to create a database of facts in BinProlog which will be searched with a set of rules. This will work fine if the database size is small.

However, the database is expected to grow much larger than physical memory. In that case, is it better to store the facts in a traditional database such as Oracle?

How difficult is it to develop such a Prolog/Database interface?


draxler@cis.uni-muenchen.de
Christoph Draxler
23rd January 1996

First, there are several excellent Database extensions for Prolog environments, e.g. MegaLog in Eclipse of ECRC (MegaLog is the database, Eclipse the LP environment). Contact eclipse@ecrc.de or micha.meier@ecrc.de for details.

Second, all commercial Prolog systems provide extensions to common SQL or other database systems (Oracle, Sybase, etc.). However, these DB access extensions may not be cheap. Since BinProlog is not a commercial Prolog system, ask the developers whether they have such an interface.

Third, you can do (most of) it yourself: get my Prolog to SQL compiler and link the Prolog system and the DBMS via inter-process communication. It's been done and the code is available at:

ftp://ftp.cis.uni-muenchen.de/pub/prolog_sql/

Both the second and third solution require some conversion between the DBMS types and the Prolog data structures. In practice, this means that you can store only atomic and ground values in the DBMS, since complex terms or variables are not supported by the DBMSs. In commercial system, you don't have to worry about that. In self-written system, you have to solve the problem.

Prev Next Up Home Keys Figs Search New