next up previous contents index
Next: Initialization Up: Directives Previous: Mode declaration   Contents   Index

Determinacy declaration

In the ATOAM, only one frame is used for a predicate call even though the predicate is nondeterminate. Before discarding the frame of a predicate call, the ATOAM must ensure by run-time checking that there are no choice points remaining. The programmer can provide determinacy declarations to help the compiler eliminate such run-time checks.

A call is said to be determinate if it does not leave any choice point behind after it succeeds. By default, the compiler assumes any call to a predicate defined outside of a file to be nondeterminate. To declare the calls to a predicate to be determinate, use the following declaration:


		  :-determinate([Atom/Arity,...,Atom/Arity]).
The compiler will take advantage of the declarations to generate code that does fewer run-time checks.



Neng-Fa Zhou
1999-11-24