By convention, the functor `(-)/2`

is often used to denote **pairs** of elements in Prolog. For example, the term `-(A, B)`

denotes the pair of elements `A`

and `B`

. In Prolog, `(-)/2`

is defined as an *infix operator*. Therefore, the term can be written equivalently as `A-B`

.

Many commonly available predicates also use this syntax to denote pairs. Examples of this are `keysort/2`

and `pairs_keys_values/3`

.

This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0

This website is not affiliated with Stack Overflow