9.6.1 Using the Determinacy Checker

There are two different ways to use the determinacy checker, either as a stand-alone tool, or during compilation. You may use it whichever way fits best with the way you work. Either way, it will discover the same nondeterminacy in your program.

The stand-alone determinacy checker is called spdet, and is run from the shell prompt, specifying the names of the Prolog source files you wish to check.

The determinacy checker can also be integrated into the compilation process, so that you receive warnings about unwanted nondeterminacy along with warnings about singleton variables or discontiguous clauses. To make this happen, simply insert the line

     :- load_files(library(detcheck),
                   [when(compile_time), if(changed)]).

Once this line is added, every time that file is loaded, it will be checked for unwanted nondeterminacy.

Send feedback on this subject.