|Did you know ...||Search Documentation:|
|Declaring predicate properties|
This section describes directives which manipulate attributes of predicate definitions. The functors dynamic/1, multifile/1, discontiguous/1 and public/1 are operators of priority 1150 (see op/3), which implies that the list of predicates they involve can just be a comma-separated list:
:- dynamic foo/0, baz/2.
In SWI-Prolog all these directives are just predicates. This implies they can also be called by a program. Do not rely on this feature if you want to maintain portability to other Prolog implementations.
:- dynamic p/1, q/1 as incremental., using
asas a high-priority operator. SWI-Prolog, YAP and Logtalk use
asfor aliasing imported predicates where as is defined as a low-priority operator. With a growing number of often combined properties we copied the idea of setting multiple attributes in a single directive but opted for the common option based approach. Defined Options are:
incremental. The only supported value is
0. With this option a call to the incremental dynamic predicate is recorded as the most generic term for the predicate rather than the specific variant.
local. See also thread_local/1.
non_terminalattribute on the predicate. This indicates that the predicate implements a grammar rule. Currently, predicates that are exported using Name//Arity syntax are flagged as non-terminals. Ideally we should add this flag to any predicate created from the expansion of a
rule, but that is difficult without breaking compatibility for programs that reason about expand_term/2,4.