I need to make a predicate called fAtomPairs so that given an atom (first argument), and a list of pairs (each pair is in turn a list of two atoms), unify a third parameter with the filtered list of pairs by selecting only those pairs that have as their first component the atom which is the first argument.
For example :
fAtomPairs(sA,[[basA,absAb],[ab,bbsA],[sA,abbsB],[bsA,sAsB],[sA,bb]],X)
must result in
X = [[sA,abbsB],[sA,bb]]
How can I do this?, I'm currently working in SWISH