9.7.3 Checker Output

The output of the determinacy checker is quite simple. For each
clause containing unexpected nondeterminacy, a single line is
printed showing the module, name, arity, and clause
number (counting from 1). The form of the information is:

* Non-determinate: module:name/arity (clause number)

A second line for each nondeterminate clause indicates the
cause of the nondeterminacy. The recognized causes are:

The clause contains a disjunction that is not forced to be
determinate with a cut or by ending the clause with a
call to fail/0 or raise_exception/1.

The clause calls a nondeterminate predicate. In this
case the predicate is named.

There is a later clause for the same predicate whose first
argument has the same principal functor (or one of the two
clauses has a variable for the first argument), and
this clause does not contain a cut or end with a call to
fail/0 or raise_exception/1. In this case, the
clause number of the other clause is mentioned.

If the predicate is multifile, clause indexing
is not considered sufficient to ensure determinacy. This is because
other clauses may be added to the predicate in other files,
so the determinacy checker cannot be sure it has seen all the
clauses for the predicate. It is good practice to include a
cut (or fail) in every clause of a multifile
predicate.

The determinacy checker also occasionally prints warnings when
declarations are made too late in the file or not at all. For
example, if you include a dynamic, nondet, or
discontiguous declaration for a predicate after some
clauses for that predicate, or if you put a dynamic
or nondet declaration for a predicate after a
clause that includes a call to that predicate, the
determinacy checker may have missed some nondeterminacy in your
program. The checker also detects undeclared discontiguous
predicates, which may also have undetected nondeterminacy.
Finally, the checker looks for goals in your program that
indicate that predicates are dynamic; if no dynamic
declaration for those predicates exists, you will be warned.

These warnings take the following form:

! warning: predicate module:name/arity is property.
! Some nondeterminacy may have been missed.
! Add (or move) the directive
! :- property module:name/arity.
! near the top of this file.