Next: , Previous: , Up: Pragmas   [Contents]


18.4 No determinism warnings

A declaration of the form

:- pragma no_determinism_warning(Name/Arity).

tells the compiler not to generate any warnings that the determinism declarations of procedures of the predicate or function with name Name and arity Arity are not as tight as they could be.

pragma no_determinism_warning’ declarations are intended for use in situations in which the code of a predicate has one determinism, but the declared determinism of the procedure must be looser due to some outside requirement. One such situation is when a set of procedures are all possible values of the same higher-order variable, which requires them to have the same argument types, modes, and determinisms. If (say) most of the procedures are det but some are erroneous (that is, they always throws an exception), the procedures that are declared det but whose bodies have determinism erroneous will get a warning saying their determinism declaration could be tighter, unless the programmer specifies this pragma for them.