Polyvariant Detection of Uninitialized Arguments of Prolog Predicates

Abstract Uninitialized variables are important to high-performance Prolog implementations since they can be bound much more efficiently than standard variables and may reduce the size of environments. In this paper, we propose a straightforward program transformation that detects uninitialized arguments to calls and rewrites the program to make such arguments obvious to the compiler. Our algorithm detects more uninitialized arguments than previously proposed methods, is robust when declarations are lacking and calling modes vary, and never performs worse than the monovariant method previously described in the literature. On a substantial set of benchmarks, our algorithm always performs as well as previous methods, and sometimes considerably better. The transformation adds specialized predicates to the program, on the order of 20% of the original number of predicates.