The db-spec defines which functors are allowed and which
parts of a term are used for indexing in a database. The
syntax of a db-spec is a skeletal goal with no module. The
db-spec is a list of atoms and compound terms where
the arguments are either
-. A term can
be inserted in the database if there is a spec in the spec
list with the same functor.
Multilevel indexing is not supported, terms have to be “flattened”.
Every spec with the functor of the indexed term specifies an
indexing. Every argument where there is a
+ in the spec is
The idea of the db-spec is illustrated with a few examples. (A section further down explains the db-spec in a more formal way).
Given a spec of
[f(+,-), .(+,-), g, f(-,+)] the indexing works
as follows. (The parts with indexing are underlined.)
|domain error||domain error|
[f(+,-), f(-,+)] is different from
[f(+,+)]. The first specifies that two indices are to be made
whereas the second specifies that only one index is to be made on both
arguments of the term.