For most of these deterministic predicates it is important to be highly efficient. Besides attempts at efficient compilation of deterministic PROLOG itself [\protect\citeauthoryearVan Roy1994], this can be achieved by either implementing deterministic predicates in a loosely coupled imperative or functional programming language (as described in section 4.1) or by specifying them in a relational language with subsequent transformation into an efficient (e.g. imperative or functional) language by an intelligent compiler.
Loose coupling has often the disadvantage of not maintaining full declarativeness: the application has to be split into parts specified in different paradigms of different levels. A much more declarative approach is to implement the complete program in a relational language and then leave it to the compiler to achieve the desired efficiency.
In the following subsections, a set of transformations and intermediate languages is described which are used to detect and compile deterministic relations into LL.