@maryStar well I have a problem trying to execute something, I keep entering infinite loops which I don't know how to avoid.
I have a net of slots (like a table), each slot may have a neighbour above, below, to the left or the right (and also diagonal, of course). I want to create a predicate that will tell me the position of a slot compared to another one, i,e, position(Name1, Name2, X, Y).