projog

3.115. pairs_keys(Pairs,Keys) / pairs_values(Pairs,Values) - get keys or values from list of Key-Value pairs.

Examples

?- pairs_keys([a-y, c-x, b-z], L).
L = [a,c,b]

yes

?- pairs_keys([a-y, a-x, a-z], L).
L = [a,a,a]

yes

?- pairs_values([a-y, c-x, b-z], L).
L = [y,x,z]

yes

?- pairs_values([a-y, c-y, b-y], L).
L = [y,y,y]

yes