List comprehensions in Prolog