When they are invoked, rules are translated into complex database queries, which are then executed taking advantage of the query processing ability of the DBMS's. All arguments are standard Prolog terms. It allows negation, the expression of arithmetic functions, and higher-order constructs such as grouping, sorting, and aggregate functions. Goal conjunctions translate to joins. Variables with single occurrences in the body are not translated.
Free variables translate to grouping attributes.
Shared variables in goals translate to equi-join conditions. Constants translate to equality comparisons of an attribute and the constant value. Nulls are translated to IS NULL conditions. In the following, we show the definition of a simple join view between the two database predicates Room and Floor . First Floor Backtracking can then be used to retrieve the next row of the view.