Mode declarations are a way for the user to give some additional information to the compiler, thus enabling it to do a better job. The ECLiPSe compiler makes use of the mode information mainly to improve indexing and to reduce code size.
Mode declarations are optional. They specify the argument instantiation patterns that a predicate will be called with at runtime, for example:
The possible argument modes and their meaning are::- mode p(+), q(-), r(++, ?).
Note that, if the actual instantiation of a predicate call violates its mode declaration, the behaviour is undefined. Usually, an unexpected failure occurs in this case.