On the Transformation of a Prolog Program to a More Efficient Binary Program

Binary definite programs consist of Horn clauses with at most one negative literal. It is unnatural to program just with such clauses and the naive automatic transformation from a general program to its binary equivalent makes it most often less efficient. Still, sometimes a binary program can solve a problem more efficiently. It is shown that partial evaluation of the alternative binary program, together with the deletion of unnecessary variables and a low level source code transformation, can lead to such an efficient binary program.