Programs can often be made more readable by the placing of
cuts as early as possible in clauses. For example, consider
p/0 defined by
p :- a, b, !, c, d. p :- e, f.
b/0 is a test that determines which clause of
a/0 may or may not be a test, but
d/0 are not supposed to fail under any circumstances. A
cut is most appropriately placed after the call to
a/0 is the test and
b/0 is not supposed to fail,
it would be much clearer to move the cut before the call to
A tool to aid in determinacy checking is included in the distribution. It is described in depth in The Determinacy Checker.