Node:Using the Determinacy Checker, Next:Declaring Nondeterminacy, Previous:The Determinacy Checker, Up: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. You may omit the .pl
suffix if you like.
% spdet [-r] [-d] [-D] [-i ifile] fspec...
The spdet
tool is automatically installed when you install
SICStus Prolog. The tool takes a number of options:
-r
-d
-D
-i ifile
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.