PLOGHELP STATIC                                Robert Duncan, March 1988


    :- op(254, fx, static).

    ?- static PredicateSpec.


Declares all the predicates identified by PredicateSpec to be static,
meaning that their definitions will not be changed during the rest of
the program, other than perhaps by reconsulting.

PredicateSpec must be a conjunction of simple specifications of the form

    Fn/Arity

where Fn is an atom (the functor name of the predicate) and Arity an
integer (its arity). For example, the directive:

    :- static search/3, reduce/2.

declares that both search/3 and reduce/2 are static.

The default behaviour of the Prolog compiler is to make all user-defined
predicates static, which means that this declaration is redundant in
most cases. Instead, normal practice is to use the companion declaration
dynamic/1 to override the default behaviour for particular predicates
whose definitions are meant to change, usually because of assert and
retract operations. There can be situations however where, at a certain
point in a program, it is known that a predicate which has previously
been declared dynamic is no longer liable to change; in such cases,
using the static/1 declaration may improve the running speed of that
predicate. See PLOGHELP * DYNAMIC for more details.


--- C.all/plog/help/static
--- Copyright University of Sussex 1993. All rights reserved.
