Quintus Prolog Homepage WELCOME TO
Quintus Prolog
The Industry Standard
  Quintus Home > ProDBI Evaluation License | Search 

ProDBI

Prolog and relational databases have a common heritage in formal logic. Prolog programs are written at a higher level than an RDBMS's SQL programs, because they are not concerned with the details of data representation.

The facts and rules in a Prolog system are referred to as the Prolog database. Because Prolog supports both facts and rules, database applications written in Prolog are sometimes referred to as deductive databases.

Records in an RDBMS are analogous to facts in a Prolog system. Prolog is more flexible in several ways:

  • New facts can be asserted at any time. It is not necessary to declare a table with a CREATE statement.
  • A fact's arguments (analogous to a record's fields) can be of any Prolog type. This includes complex types, such as lists.

ProDBI allows Prolog programs to access the RDBMS in two ways:

  • Any SQL command can be invoked from Prolog.
  • An RDBMS table can be attached to a Prolog predicate, making it appear as a set of Prolog facts.

In both cases, multiple records answering a query are returned to Prolog one-at-a-time, on backtracking. A database cursor is automatically opened when a query is initiated, and it is closed as soon as a Prolog cut or failure effectively terminates the query.

This is ideal for rapid prototyping. An application is developed with test data stored as Prolog facts. Later, that test data can be replaced with an external RDBMS.

The Prolog database also contains rules. These rules may express database integrity constraints, or they may contain domain-specific knowledge, as in an expert system. ProDBI's ability to make an RDBMS's tables appear as Prolog facts allows Prolog rules easy access to data.

Benefits of ProDBI

ProDBI makes all the benefits of Prolog programming available to RDBMS programmers.

For Prolog programmers:

  • Easy migration from Prolog database to external RDBMS
  • Easy to access data stored in an existing RDBMS and shared by multiple users
  • Very large quantities of data can be handled by the RDBMS
  • ProDBI type-checks arguments passed in database queries and performs type conversions

For RDBMS programmers:

  • Prolog is a high-level language, that frees the programmer from details of how data is stored
  • Quintus Prolog's interactive GUI with source-linked debugger reduces debugging time and increases productivity
  • Prolog rules can express integrity constraints or domain-specific, expert system-style knowledge
  • Prolog-based expert systems or natural language front-ends are easily connected to an RDBMS, to build intelligent databases

See also ProDBI version 4.0 user guide.