recorded/3

Synopsis

recorded(-Key, -Term, +Ref)

recorded(+Key, *Term, *Ref)

searches the internal database for a term recorded under the key Key that unifies with Term, and whose database reference unifies with Ref.

Arguments


Key atomic

Term term

Ref db_reference

Description

If Ref is instantiated, then Key and Term are unified with the key and term associated with Ref. Otherwise, If Key is a compound term, only its principal functor is significant. That is, foo(1) represents the same key as foo(n).

A call to recorded/3 of the form (-, ?, +) will succeed if the expected relation holds. Key need not be instantiated.

Backtracking

Can be used to backtrack through all the matching terms recorded under the specified key. Therefore, if you want to match only a single term you should use a cut to prevent backtracking. Alternatively, use the library(not) predicate once/1.

Exceptions


type_error
Ref is not a database reference, or Key is a float
instantiation_error

See Also

record/3, recorda/3, current_key/3