Scryer Prolog documentation

Module pairs

:- use_module(library(pairs)).

Reasoning about pairs.

Pairs are Prolog terms with principal functor (-)/2. A pair often has the form Key-Value. The predicates of this library relate pairs to keys and values.

pairs_keys_values(?Pairs, ?Keys, ?Values)

The first argument is a list of Pairs, the second the corresponding Keys, and the third argument the corresponding values.

pairs_keys(?Pairs, ?Keys)

Same as pairs_keys_values(Pairs, Keys, _).

pairs_values(?Pairs, ?Values)

Same as pairs_keys_values(Pairs, _, Values).