Did you know ... Search Documentation:
Predicate pairfrom/4
 pairfrom(?Set, ?Element1, ?Element2, ?Residue) is semidet[private]
is true when Set is a list, Element1 occurs in list, Element2 occurs in list after Element1, and Residue is everything in Set bar the two Elements. The point of this thing is to select_20_faster pairs of elements from a set without selecting the same pair twice in different orders.