volatile/1 declaration

Synopsis

:- volatile +PredSpecs

Declares PredSpecs to be volatile. Volatile predicates are not saved in QOF files by Prolog save predicates.

Arguments


PredSpecs pred_spec_forest [MOD]
A single predicate specification of the form Name/Arity, or a sequence of predicate specifications separated by commas. Name must be an atom and Arity an integer in the range 0..255.

Description

A built-in prefix operator, so that declarations can be written as e.g.

      :- volatile a/1, b/3.
     

callable both at compile-time and run-time. In both cases the predicate specified will, with immediate effect, be declared as volatile.

When used as a compile-time directive, the volatile declaration of a predicate must appear before all clauses of that predicate. The predicate is reinitialized.

When used as a callable goal, the only effect on the predicate is that it is set to be volatile.

Exceptions


instantiation_error
If PredSpec is not ground.
type_error
If PredSpec is not a proper predicate specification.
permission_error
PredSpec names a non-volatile predicate that is already defined (This exception is only raised when volatile is used as a compile-time directive.)

Comments

Whether PredSpec is volatile can be checked with predicate_property/2.

The properties, as well as the predicate, can be deleted with abolish/1.

PredSpec clauses are saved by qpc.

Examples

see examples under initialization/1.

See Also

initialization/1, save_program/[1,2], save_modules/2, save_predicates/2 ref-sls-igs-vol